24 define (
"QT_UNKNOWN",
"unknown");
25 define (
"QT_MULTIPLE_CHOICE_SR",
"assSingleChoice");
26 define (
"QT_MULTIPLE_CHOICE_MR",
"assMultipleChoice");
27 define (
"QT_CLOZE",
"assClozeTest");
28 define (
"QT_MATCHING",
"assMatchingQuestion");
29 define (
"QT_ORDERING",
"assOrderingQuestion");
30 define (
"QT_IMAGEMAP",
"assImagemapQuestion");
31 define (
"QT_JAVAAPPLET",
"assJavaApplet");
32 define (
"QT_TEXT",
"assTextQuestion");
33 define (
"QT_NUMERIC",
"assNumeric");
34 define (
"QT_TEXTSUBSET",
"assTextSubset");
67 $this->response = array();
68 $this->resprocessing = array();
69 $this->itemfeedback = array();
70 $this->presentation = NULL;
71 $this->presentationitem = array();
72 $this->suggested_solutions = array();
73 $this->itemmetadata = array();
78 $this->ident = $a_ident;
88 $this->title = $a_title;
98 if (preg_match(
"/(.*?)\=(.*)/", $a_comment, $matches))
103 case "ILIAS Version":
104 $this->ilias_version = $matches[2];
108 $this->questiontype = $matches[2];
112 $this->author = $matches[2];
117 $this->comment = $a_comment;
127 if (preg_match(
"/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches))
129 $this->duration = array(
144 $this->questiontext = $a_questiontext;
154 array_push($this->resprocessing, $a_resprocessing);
159 array_push($this->itemfeedback, $a_itemfeedback);
164 $this->maxattempts = $a_maxattempts;
174 $this->label = $a_label;
184 $this->xmllang = $a_xmllang;
194 $this->presentation = $a_presentation;
205 if ($this->presentation != NULL)
212 $this->questiontype = $a_questiontype;
222 array_push($this->presentationitem, $a_presentationitem);
227 switch ($this->questiontype)
229 case "ORDERING QUESTION":
231 case "SINGLE CHOICE QUESTION":
233 case "MULTIPLE CHOICE QUESTION":
235 case "MATCHING QUESTION":
237 case "CLOZE QUESTION":
239 case "IMAGE MAP QUESTION":
241 case "JAVA APPLET QUESTION":
243 case "TEXT QUESTION":
245 case "NUMERIC QUESTION":
247 case "TEXTSUBSET QUESTION":
251 foreach ($this->presentation->order as $entry)
253 switch ($entry[
"type"])
256 $response = $this->presentation->response[$entry[
"index"]];
257 switch ($response->getResponsetype())
260 switch ($response->getRCardinality())
277 switch ($response->getRCardinality())
295 $material = $this->presentation->material[$entry[
"index"]];
300 if (strlen($this->questiontype) == 0)
312 $this->author = $a_author;
322 array_push($this->suggested_solutions, array(
"solution" => $a_solution,
"gap_index" => $a_gap_index));
327 array_push($this->itemmetadata, $a_metadata);
337 foreach ($this->itemmetadata as $metadata)
339 if (strcmp($metadata[
"label"], $a_label) == 0)
341 return $metadata[
"entry"];