24 define (
"QT_UNKNOWN",
"unknown");
25 define (
"QT_KPRIM_CHOICE",
"assKprimChoice");
26 define (
"QT_MULTIPLE_CHOICE_SR",
"assSingleChoice");
27 define (
"QT_MULTIPLE_CHOICE_MR",
"assMultipleChoice");
28 define (
"QT_CLOZE",
"assClozeTest");
29 define (
"QT_MATCHING",
"assMatchingQuestion");
30 define (
"QT_ORDERING",
"assOrderingQuestion");
31 define (
"QT_IMAGEMAP",
"assImagemapQuestion");
32 define (
"QT_JAVAAPPLET",
"assJavaApplet");
33 define (
"QT_TEXT",
"assTextQuestion");
34 define (
"QT_NUMERIC",
"assNumeric");
35 define (
"QT_TEXTSUBSET",
"assTextSubset");
71 $this->response = array();
72 $this->resprocessing = array();
73 $this->itemfeedback = array();
74 $this->presentation = NULL;
75 $this->presentationitem = array();
76 $this->suggested_solutions = array();
77 $this->itemmetadata = array();
79 $this->iliasSourceVersion = null;
80 $this->iliasSourceNic = null;
85 $this->ident = $a_ident;
95 $this->title = $a_title;
105 if (preg_match(
"/(.*?)\=(.*)/", $a_comment, $matches))
110 case "ILIAS Version":
111 $this->ilias_version = $matches[2];
115 $this->questiontype = $matches[2];
119 $this->author = $matches[2];
124 $this->comment = $a_comment;
134 if (preg_match(
"/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches))
136 $this->duration = array(
151 $this->questiontext = $a_questiontext;
161 array_push($this->resprocessing, $a_resprocessing);
166 array_push($this->itemfeedback, $a_itemfeedback);
171 $this->maxattempts = $a_maxattempts;
181 $this->label = $a_label;
191 $this->xmllang = $a_xmllang;
201 $this->presentation = $a_presentation;
212 if ($this->presentation != NULL)
219 $this->questiontype = $a_questiontype;
229 array_push($this->presentationitem, $a_presentationitem);
234 switch ($this->questiontype)
236 case "ORDERING QUESTION":
238 case "KPRIM CHOICE QUESTION":
240 case "SINGLE CHOICE QUESTION":
242 case "MULTIPLE CHOICE QUESTION":
244 case "MATCHING QUESTION":
246 case "CLOZE QUESTION":
248 case "IMAGE MAP QUESTION":
250 case "JAVA APPLET QUESTION":
252 case "TEXT QUESTION":
254 case "NUMERIC QUESTION":
256 case "TEXTSUBSET QUESTION":
260 foreach ($this->presentation->order as $entry)
262 switch ($entry[
"type"])
265 $response = $this->presentation->response[$entry[
"index"]];
266 switch ($response->getResponsetype())
269 switch ($response->getRCardinality())
286 switch ($response->getRCardinality())
304 $material = $this->presentation->material[$entry[
"index"]];
309 if (strlen($this->questiontype) == 0)
321 $this->author = $a_author;
363 array_push($this->suggested_solutions, array(
"solution" => $a_solution,
"gap_index" => $a_gap_index));
368 array_push($this->itemmetadata, $a_metadata);
378 foreach ($this->itemmetadata as $metadata)
380 if (strcmp($metadata[
"label"], $a_label) == 0)
382 return $metadata[
"entry"];