ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilCSVTestExport Class Reference
+ Inheritance diagram for ilCSVTestExport:
+ Collaboration diagram for ilCSVTestExport:

Public Member Functions

 withAllResults ()
 
 withAggregatedResults ()
 
 deliver (string $title)
 
 getContent ()
 
- Public Member Functions inherited from ilTestExportAbstract
 deliver (string $title)
 
 getContent ()
 
 getDatarows (ilObjTest $test_obj)
 
 getHeaderRow (ilLanguage $lng, ilObjTest $test_obj)
 

Protected Attributes

string $content
 
- Protected Attributes inherited from ilTestExportAbstract
ilTestEvaluationData $complete_data
 
array $aggregated_data
 
array $additionalFields
 
ilLanguage $lng
 

Additional Inherited Members

- Protected Member Functions inherited from ilTestExportAbstract
 orderQuestions (array $questions)
 

Detailed Description

Author
Fabian Helfer fhelf.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 24 of file class.ilCSVTestExport.php.

Member Function Documentation

◆ deliver()

ilCSVTestExport::deliver ( string  $title)

Definition at line 84 of file class.ilCSVTestExport.php.

References ilUtil\deliverData(), exit, and ilFileUtils\getASCIIFilename().

84  : void
85  {
86  ilUtil::deliverData($this->content, ilFileUtils::getASCIIFilename($title . ".csv"));
87  exit;
88  }
exit
Definition: login.php:29
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
static getASCIIFilename(string $a_filename)
+ Here is the call graph for this function:

◆ getContent()

ilCSVTestExport::getContent ( )

Definition at line 90 of file class.ilCSVTestExport.php.

References $content.

90  : string
91  {
92  return $this->content;
93  }

◆ withAggregatedResults()

ilCSVTestExport::withAggregatedResults ( )

Definition at line 41 of file class.ilCSVTestExport.php.

References $data, ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\lng().

41  : self
42  {
43  $data = $this->test_obj->getAggregatedResultsData();
44  $rows = [];
45  $rows[] = [
46  $this->lng->txt("result"),
47  $this->lng->txt("value")
48  ];
49  foreach ($data["overview"] as $key => $value) {
50  $rows[] = [
51  $key,
52  $value
53  ];
54  }
55  $rows[] = [
56  $this->lng->txt("question_id"),
57  $this->lng->txt("question_title"),
58  $this->lng->txt("average_reached_points"),
59  $this->lng->txt("points"),
60  $this->lng->txt("percentage"),
61  $this->lng->txt("number_of_answers")
62  ];
63  foreach ($data["questions"] as $key => $value) {
64  $rows[] = [
65  $key,
66  $value[0],
67  $value[4],
68  $value[5],
69  $value[6],
70  $value[3]
71  ];
72  }
73  $csv = "";
74  $separator = ";";
75  foreach ($rows as $evalrow) {
76  $csvrow = $this->test_obj->processCSVRow($evalrow, true, $separator);
77  $csv .= implode($separator, $csvrow) . "\n";
78  }
79  $this->content = $csv;
80  return $this;
81  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ withAllResults()

ilCSVTestExport::withAllResults ( )

Definition at line 28 of file class.ilCSVTestExport.php.

References ilTestExportAbstract\getDatarows().

28  : self
29  {
30  $rows = $this->getDatarows($this->test_obj);
31  $separator = ";";
32  $csv = "";
33  foreach ($rows as $evalrow) {
34  $csvrow = $this->test_obj->processCSVRow($evalrow, true, $separator);
35  $csv .= implode($separator, $csvrow) . "\n";
36  }
37  $this->content = $csv;
38  return $this;
39  }
getDatarows(ilObjTest $test_obj)
+ Here is the call graph for this function:

Field Documentation

◆ $content

string ilCSVTestExport::$content
protected

Definition at line 26 of file class.ilCSVTestExport.php.

Referenced by getContent().


The documentation for this class was generated from the following file: