24 define(
"QT_UNKNOWN",
"unknown");
25 define(
"QT_KPRIM_CHOICE",
"assKprimChoice");
26 define(
"QT_LONG_MENU",
"assLongMenu");
27 define(
"QT_MULTIPLE_CHOICE_SR",
"assSingleChoice");
28 define(
"QT_MULTIPLE_CHOICE_MR",
"assMultipleChoice");
29 define(
"QT_CLOZE",
"assClozeTest");
30 define(
"QT_ERRORTEXT",
"assErrorText");
31 define(
"QT_MATCHING",
"assMatchingQuestion");
32 define(
"QT_ORDERING",
"assOrderingQuestion");
33 define(
"QT_ORDERING_HORIZONTAL",
"assOrderingHorizontal");
34 define(
"QT_IMAGEMAP",
"assImagemapQuestion");
35 define(
"QT_JAVAAPPLET",
"assJavaApplet");
36 define(
"QT_FLASHAPPLET",
"assFlashApplet");
37 define(
"QT_TEXT",
"assTextQuestion");
38 define(
"QT_FILEUPLOAD",
"assFileUpload");
39 define(
"QT_NUMERIC",
"assNumeric");
40 define(
"QT_FORMULA",
"assFormulaQuestion");
41 define(
"QT_TEXTSUBSET",
"assTextSubset");
77 $this->response = array();
78 $this->resprocessing = array();
79 $this->itemfeedback = array();
80 $this->presentation = null;
81 $this->presentationitem = array();
82 $this->suggested_solutions = array();
83 $this->itemmetadata = array();
85 $this->iliasSourceVersion = null;
86 $this->iliasSourceNic = null;
91 $this->ident = $a_ident;
101 $this->title = $a_title;
111 if (preg_match(
"/(.*?)\=(.*)/", $a_comment, $matches)) {
113 switch ($matches[1]) {
114 case "ILIAS Version":
115 $this->ilias_version = $matches[2];
119 $this->questiontype = $matches[2];
123 $this->author = $matches[2];
138 if (preg_match(
"/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches)) {
139 $this->duration = array(
154 $this->questiontext = $a_questiontext;
164 array_push($this->resprocessing, $a_resprocessing);
169 array_push($this->itemfeedback, $a_itemfeedback);
174 $this->maxattempts = $a_maxattempts;
184 $this->label = $a_label;
194 $this->xmllang = $a_xmllang;
204 $this->presentation = $a_presentation;
215 if ($this->presentation != null) {
221 $this->questiontype = $a_questiontype;
231 array_push($this->presentationitem, $a_presentationitem);
236 switch ($this->questiontype) {
237 case "ORDERING QUESTION":
239 case "KPRIM CHOICE QUESTION":
241 case "LONG MENU QUESTION":
243 case "SINGLE CHOICE QUESTION":
245 case "MULTIPLE CHOICE QUESTION":
247 case "MATCHING QUESTION":
249 case "CLOZE QUESTION":
251 case "IMAGE MAP QUESTION":
253 case "JAVA APPLET QUESTION":
255 case "TEXT QUESTION":
257 case "NUMERIC QUESTION":
259 case "TEXTSUBSET QUESTION":
262 if (!$this->presentation) {
265 foreach ($this->presentation->order as $entry) {
266 switch ($entry[
"type"]) {
268 $response = $this->presentation->response[$entry[
"index"]];
304 $material = $this->presentation->material[$entry[
"index"]];
305 if (is_array($material->matapplet) && count($material->matapplet) > 0) {
311 if (strlen($this->questiontype) == 0) {
320 $this->author = $a_author;
362 array_push($this->suggested_solutions, array(
"solution" => $a_solution,
"gap_index" => $a_gap_index));
367 array_push($this->itemmetadata, $a_metadata);
377 foreach ($this->itemmetadata as
$metadata) {
378 if (strcmp($metadata[
"label"], $a_label) == 0) {
379 return $metadata[
"entry"];
setPresentation($a_presentation)
addResprocessing($a_resprocessing)
const R_CARDINALITY_ORDERED
getMetadataEntry($a_label)
$metadata['__DYNAMIC:1__']
const QT_MULTIPLE_CHOICE_SR
setQuestiontext($a_questiontext)
setQuestiontype($a_questiontype)
addSuggestedSolution($a_solution, $a_gap_index)
setIliasSourceVersion($iliasSourceVersion)
const QT_MULTIPLE_CHOICE_MR
setIliasSourceNic($iliasSourceNic)
addItemfeedback($a_itemfeedback)
setMaxattempts($a_maxattempts)
const R_CARDINALITY_SINGLE
const R_CARDINALITY_MULTIPLE
addPresentationitem($a_presentationitem)