24 include_once(
"./classes/class.ilSaxParser.php");
26 define (
"IL_MO_PARSE_QTI", 1);
27 define (
"IL_MO_VERIFY_QTI", 2);
111 $this->qpl_id = $a_qpl_id;
112 $this->import_idents = array();
113 if (is_array($a_import_idents))
115 $this->import_idents =& $a_import_idents;
119 $this->hasRootElement = FALSE;
120 $this->import_mapping = array();
121 $this->assessments = array();
122 $this->assessment = NULL;
123 $this->section = NULL;
124 $this->path = array();
125 $this->items = array();
127 $this->depth = array();
128 $this->do_nothing = FALSE;
129 $this->qti_element =
"";
130 $this->in_presentation = FALSE;
131 $this->in_objectives = FALSE;
132 $this->in_reponse = FALSE;
133 $this->render_type = NULL;
134 $this->render_hotspot = NULL;
135 $this->response_label = NULL;
136 $this->material = NULL;
137 $this->response = NULL;
138 $this->assessmentcontrol = NULL;
139 $this->objectives = NULL;
140 $this->matimage = NULL;
141 $this->resprocessing = NULL;
142 $this->outcomes = NULL;
143 $this->decvar = NULL;
144 $this->respcondition = NULL;
145 $this->setvar = NULL;
146 $this->displayfeedback = NULL;
147 $this->itemfeedback = NULL;
148 $this->flow_mat = array();
149 $this->question_counter = 1;
151 $this->gap_index = 0;
152 $this->presentation = NULL;
153 $this->mattext = NULL;
154 $this->matapplet = NULL;
155 $this->sametag = FALSE;
156 $this->in_assessment = FALSE;
157 $this->characterbuffer =
"";
158 $this->metadata = array(
"label" =>
"",
"entry" =>
"");
163 $this->tst_object =& $a_tst_object;
164 if (is_object($a_tst_object))
166 $this->tst_id = $this->tst_object->getId();
172 $this->parser_mode = $a_mode;
173 $this->founditems = array();
174 $this->verifyroot =
false;
175 $this->verifyqticomment = 0;
176 $this->verifymetadatafield = 0;
177 $this->verifyfieldlabel = 0;
178 $this->verifyfieldentry = 0;
179 $this->verifyfieldlabeltext =
"";
180 $this->verifyfieldentrytext =
"";
181 $this->question_counter = 1;
191 xml_set_object($a_xml_parser,$this);
192 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
193 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
198 $this->question_counter = 1;
205 if ($this->depth[$a_xml_parser] > 0)
207 return $this->path[$this->depth[$a_xml_parser]-1];
220 switch ($this->parser_mode)
236 if ($this->do_nothing)
return;
237 $this->sametag = FALSE;
238 $this->characterbuffer =
"";
239 $this->depth[$a_xml_parser]++;
240 $this->path[$this->depth[$a_xml_parser]] = strtolower($a_name);
241 $this->qti_element = $a_name;
243 switch (strtolower($a_name))
246 include_once (
"./Services/QTI/classes/class.ilQTIAssessment.php");
247 $this->assessment =& $this->assessments[array_push($this->assessments,
new ilQTIAssessment())-1];
248 $this->in_assessment = TRUE;
249 if (is_array($a_attribs))
251 foreach ($a_attribs as $attribute => $value)
253 switch (strtolower($attribute))
256 $this->assessment->setTitle($value);
259 $this->assessment->setIdent($value);
265 case "assessmentcontrol":
266 include_once (
"./Services/QTI/classes/class.ilQTIAssessmentcontrol.php");
268 if (is_array($a_attribs))
270 foreach ($a_attribs as $attribute => $value)
272 switch (strtolower($attribute))
274 case "solutionswitch":
275 $this->assessmentcontrol->setSolutionswitch($value);
278 $this->assessmentcontrol->setHintswitch($value);
280 case "feedbackswitch":
281 $this->assessmentcontrol->setFeedbackswitch($value);
288 include_once (
"./Services/QTI/classes/class.ilQTIObjectives.php");
290 $this->in_objectives = TRUE;
293 include_once (
"./Services/QTI/classes/class.ilQTISection.php");
297 $this->in_itemmetadata = TRUE;
299 case "qtimetadatafield":
300 $this->metadata = array(
"label" =>
"",
"entry" =>
"");
303 include_once (
"./Services/QTI/classes/class.ilQTIFlow.php");
307 include_once (
"./Services/QTI/classes/class.ilQTIFlowMat.php");
311 include_once (
"./Services/QTI/classes/class.ilQTIItemfeedback.php");
313 if (is_array($a_attribs))
315 foreach ($a_attribs as $attribute => $value)
317 switch (strtolower($attribute))
320 $this->itemfeedback->setIdent($value);
323 $this->itemfeedback->setView($value);
329 case "displayfeedback":
330 include_once (
"./Services/QTI/classes/class.ilQTIDisplayfeedback.php");
332 if (is_array($a_attribs))
334 foreach ($a_attribs as $attribute => $value)
336 switch (strtolower($attribute))
339 $this->displayfeedback->setFeedbacktype($value);
342 $this->displayfeedback->setLinkrefid($value);
349 include_once (
"./Services/QTI/classes/class.ilQTISetvar.php");
351 if (is_array($a_attribs))
353 foreach ($a_attribs as $attribute => $value)
355 switch (strtolower($attribute))
358 $this->setvar->setAction($value);
361 $this->setvar->setVarname($value);
368 include_once (
"./Services/QTI/classes/class.ilQTIConditionvar.php");
372 if ($this->conditionvar != NULL)
374 $this->conditionvar->addNot();
378 if ($this->conditionvar != NULL)
380 $this->conditionvar->addAnd();
384 if ($this->conditionvar != NULL)
386 $this->conditionvar->addOr();
390 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
392 if (is_array($a_attribs))
394 foreach ($a_attribs as $attribute => $value)
396 switch (strtolower($attribute))
399 $this->responsevar->setCase($value);
402 $this->responsevar->setRespident($value);
405 $this->responsevar->setIndex($value);
412 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
414 if (is_array($a_attribs))
416 foreach ($a_attribs as $attribute => $value)
418 switch (strtolower($attribute))
421 $this->responsevar->setRespident($value);
424 $this->responsevar->setIndex($value);
431 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
433 if (is_array($a_attribs))
435 foreach ($a_attribs as $attribute => $value)
437 switch (strtolower($attribute))
440 $this->responsevar->setRespident($value);
443 $this->responsevar->setIndex($value);
450 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
452 if (is_array($a_attribs))
454 foreach ($a_attribs as $attribute => $value)
456 switch (strtolower($attribute))
459 $this->responsevar->setRespident($value);
462 $this->responsevar->setIndex($value);
469 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
471 if (is_array($a_attribs))
473 foreach ($a_attribs as $attribute => $value)
475 switch (strtolower($attribute))
478 $this->responsevar->setRespident($value);
481 $this->responsevar->setIndex($value);
488 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
490 if (is_array($a_attribs))
492 foreach ($a_attribs as $attribute => $value)
494 switch (strtolower($attribute))
497 $this->responsevar->setRespident($value);
500 $this->responsevar->setSetmatch($value);
503 $this->responsevar->setIndex($value);
510 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
512 if (is_array($a_attribs))
514 foreach ($a_attribs as $attribute => $value)
516 switch (strtolower($attribute))
519 $this->responsevar->setRespident($value);
522 $this->responsevar->setAreatype($value);
525 $this->responsevar->setIndex($value);
532 include_once(
"./Services/QTI/classes/class.ilQTIResponseVar.php");
534 if (is_array($a_attribs))
536 foreach ($a_attribs as $attribute => $value)
538 switch (strtolower($attribute))
541 $this->responsevar->setCase($value);
544 $this->responsevar->setRespident($value);
547 $this->responsevar->setIndex($value);
553 case "respcondition":
554 include_once(
"./Services/QTI/classes/class.ilQTIRespcondition.php");
556 if (is_array($a_attribs))
558 foreach ($a_attribs as $attribute => $value)
560 switch (strtolower($attribute))
563 $this->respcondition->setContinue($value);
566 $this->respcondition->setTitle($value);
573 include_once(
"./Services/QTI/classes/class.ilQTIOutcomes.php");
577 include_once(
"./Services/QTI/classes/class.ilQTIDecvar.php");
579 if (is_array($a_attribs))
581 foreach ($a_attribs as $attribute => $value)
583 switch (strtolower($attribute))
586 $this->decvar->setVarname($value);
589 $this->decvar->setVartype($value);
592 $this->decvar->setDefaultval($value);
595 $this->decvar->setMinvalue($value);
598 $this->decvar->setMaxvalue($value);
601 $this->decvar->setMembers($value);
604 $this->decvar->setCutvalue($value);
611 include_once(
"./Services/QTI/classes/class.ilQTIMatimage.php");
613 if (is_array($a_attribs))
615 foreach ($a_attribs as $attribute => $value)
617 switch (strtolower($attribute))
620 $this->matimage->setImagetype($value);
623 $this->matimage->setLabel($value);
626 $this->matimage->setHeight($value);
629 $this->matimage->setWidth($value);
632 $this->matimage->setUri($value);
635 $this->matimage->setEmbedded($value);
638 $this->matimage->setX0($value);
641 $this->matimage->setY0($value);
644 $this->matimage->setEntityref($value);
651 include_once(
"./Services/QTI/classes/class.ilQTIMaterial.php");
653 $this->material->setFlow($this->flow);
654 if (is_array($a_attribs))
656 foreach ($a_attribs as $attribute => $value)
658 switch (strtolower($attribute))
661 $this->material->setLabel($value);
668 include_once (
"./Services/QTI/classes/class.ilQTIMattext.php");
670 if (is_array($a_attribs))
672 foreach ($a_attribs as $attribute => $value)
674 switch (strtolower($attribute))
677 $this->mattext->setTexttype($value);
680 $this->mattext->setLabel($value);
683 $this->mattext->setCharset($value);
686 $this->mattext->setUri($value);
689 $this->mattext->setXmlspace($value);
692 $this->mattext->setXmllang($value);
695 $this->mattext->setEntityref($value);
698 $this->mattext->setHeight($value);
701 $this->mattext->setWidth($value);
704 $this->mattext->setX0($value);
707 $this->mattext->setY0($value);
714 include_once (
"./Services/QTI/classes/class.ilQTIMatapplet.php");
716 if (is_array($a_attribs))
718 foreach ($a_attribs as $attribute => $value)
720 switch (strtolower($attribute))
723 $this->matapplet->setLabel($value);
726 $this->matapplet->setUri($value);
729 $this->matapplet->setY0($value);
732 $this->matapplet->setHeight($value);
735 $this->matapplet->setWidth($value);
738 $this->matapplet->setX0($value);
741 $this->matapplet->setEmbedded($value);
744 $this->matapplet->setEntityref($value);
750 case "questestinterop":
751 $this->hasRootElement = TRUE;
759 if ($this->assessment != NULL)
761 $this->assessment->addSection($this->section);
763 $this->section = NULL;
766 $this->in_presentation = TRUE;
767 include_once (
"./Services/QTI/classes/class.ilQTIPresentation.php");
770 case "response_label":
771 if ($this->render_type != NULL)
773 include_once(
"./Services/QTI/classes/class.ilQTIResponseLabel.php");
775 foreach ($a_attribs as $attribute => $value)
777 switch (strtolower($attribute))
780 $this->response_label->setRshuffle($value);
783 $this->response_label->setRarea($value);
786 $this->response_label->setRrange($value);
789 $this->response_label->setLabelrefid($value);
792 $this->response_label->setIdent($value);
795 $this->response_label->setMatchGroup($value);
798 $this->response_label->setMatchMax($value);
804 case "render_choice":
805 if ($this->in_response)
807 include_once(
"./Services/QTI/classes/class.ilQTIRenderChoice.php");
809 foreach ($a_attribs as $attribute => $value)
811 switch (strtolower($attribute))
814 $this->render_type->setShuffle($value);
820 case "render_hotspot":
821 if ($this->in_response)
823 include_once(
"./Services/QTI/classes/class.ilQTIRenderHotspot.php");
825 foreach ($a_attribs as $attribute => $value)
827 switch (strtolower($attribute))
830 $this->render_type->setShuffle($value);
833 $this->render_type->setMinnumber($value);
836 $this->render_type->setMaxnumber($value);
843 if ($this->in_response)
845 include_once(
"./Services/QTI/classes/class.ilQTIRenderFib.php");
847 foreach ($a_attribs as $attribute => $value)
849 switch (strtolower($attribute))
852 $this->render_type->setEncoding($value);
855 $this->render_type->setFibtype($value);
858 $this->render_type->setRows($value);
861 $this->render_type->setMaxchars($value);
864 $this->render_type->setPrompt($value);
867 $this->render_type->setColumns($value);
870 $this->render_type->setCharset($value);
873 $this->render_type->setMaxnumber($value);
876 $this->render_type->setMinnumber($value);
895 include_once
"./Services/QTI/classes/class.ilQTIResponse.php";
896 switch (strtolower($a_name))
914 $this->in_response = TRUE;
916 $this->response->setFlow($this->flow);
917 if (is_array($a_attribs))
919 foreach ($a_attribs as $attribute => $value)
921 switch (strtolower($attribute))
924 $this->response->setIdent($value);
927 $this->response->setRTiming($value);
930 $this->response->setRCardinality($value);
933 $this->response->setNumtype($value);
940 include_once(
"./Services/QTI/classes/class.ilQTIItem.php");
941 $this->gap_index = 0;
942 $this->item =& $this->items[array_push($this->items,
new ilQTIItem())-1];
943 if (is_array($a_attribs))
945 foreach ($a_attribs as $attribute => $value)
947 switch (strtolower($attribute))
950 $this->item->setIdent($value);
951 if (count($this->import_idents) > 0)
953 if (!in_array($value, $this->import_idents))
955 $this->do_nothing = TRUE;
960 $this->item->setTitle($value);
963 $this->item->setMaxattempts($value);
969 case "resprocessing":
970 include_once(
"./Services/QTI/classes/class.ilQTIResprocessing.php");
972 if (is_array($a_attribs))
974 foreach ($a_attribs as $attribute => $value)
976 switch (strtolower($attribute))
979 $this->resprocessing->setScoremodel($value);
993 switch ($this->parser_mode)
1009 if (($this->do_nothing) && (strcmp(strtolower($a_name),
"item") != 0))
return;
1010 switch (strtolower($a_name))
1013 if (is_object($this->tst_object))
1015 $this->tst_object->fromXML($this->assessment);
1017 $this->in_assessment = FALSE;
1019 case "assessmentcontrol":
1020 $this->assessment->addAssessmentcontrol($this->assessmentcontrol);
1021 $this->assessmentcontrol = NULL;
1024 if (strcmp(strtolower($this->
getParent($a_xml_parser)),
"assessment") == 0)
1026 $this->assessment->addObjectives($this->objectives);
1028 $this->in_objectives = FALSE;
1030 case "itemmetadata":
1031 $this->in_itemmetadata = FALSE;
1033 case "qtimetadatafield":
1035 switch ($this->metadata[
"label"])
1037 case "ILIAS_VERSION":
1039 case "QUESTIONTYPE":
1040 if ($this->item != NULL)
1042 $this->item->setQuestiontype($this->metadata[
"entry"]);
1046 if ($this->item != NULL)
1048 $this->item->setAuthor($this->metadata[
"entry"]);
1051 if ($this->item != NULL)
1053 $this->item->addMetadata($this->metadata);
1057 if ($this->in_assessment)
1059 $this->assessment->addQtiMetadata($this->metadata);
1061 $this->metadata = array(
"label" =>
"",
"entry" =>
"");
1067 if (count($this->flow_mat))
1070 if (count($this->flow_mat))
1072 $this->flow_mat[count($this->flow_mat)-1]->addFlow_mat(
$flow_mat);
1074 else if ($this->itemfeedback != NULL)
1076 $this->itemfeedback->addFlow_mat(
$flow_mat);
1078 else if ($this->response_label != NULL)
1080 $this->response_label->addFlow_mat(
$flow_mat);
1086 include_once(
"./Services/QTI/classes/class.ilQTIMaterial.php");
1088 $finalStatementMat->setFlow(
$flow_mat->material[0]->flow);
1089 $finalStatementMat->addMattext(
$flow_mat->material[0]->materials[0][
'material']);
1090 $this->assessment->setPresentationMaterial($finalStatementMat);
1094 case "itemfeedback":
1095 if ($this->item != NULL)
1097 if ($this->itemfeedback != NULL)
1099 $this->item->addItemfeedback($this->itemfeedback);
1102 $this->itemfeedback = NULL;
1104 case "displayfeedback":
1105 if ($this->respcondition != NULL)
1107 if ($this->displayfeedback != NULL)
1109 $this->respcondition->addDisplayfeedback($this->displayfeedback);
1112 $this->displayfeedback = NULL;
1115 if ($this->respcondition != NULL)
1117 if ($this->setvar != NULL)
1119 $this->respcondition->addSetvar($this->setvar);
1122 $this->setvar = NULL;
1124 case "conditionvar":
1125 if ($this->respcondition != NULL)
1127 $this->respcondition->setConditionvar($this->conditionvar);
1129 $this->conditionvar = NULL;
1138 case "varsubstring":
1139 if ($this->conditionvar != NULL)
1141 if ($this->responsevar != NULL)
1143 $this->conditionvar->addResponseVar($this->responsevar);
1146 $this->responsevar = NULL;
1148 case "respcondition":
1149 if ($this->resprocessing != NULL)
1151 $this->resprocessing->addRespcondition($this->respcondition);
1153 $this->respcondition = NULL;
1156 if ($this->resprocessing != NULL)
1158 $this->resprocessing->setOutcomes($this->outcomes);
1160 $this->outcomes = NULL;
1163 if ($this->outcomes != NULL)
1165 $this->outcomes->addDecvar($this->decvar);
1167 $this->decvar = NULL;
1169 case "presentation":
1170 $this->in_presentation = FALSE;
1171 if ($this->presentation != NULL)
1173 if ($this->item != NULL)
1175 $this->item->setPresentation($this->presentation);
1178 $this->presentation = NULL;
1180 case "response_label":
1181 if ($this->render_type != NULL)
1183 $this->render_type->addResponseLabel($this->response_label);
1184 $this->response_label = NULL;
1187 case "render_choice":
1188 case "render_hotspot":
1190 if ($this->in_response)
1192 if ($this->response != NULL)
1194 if ($this->render_type != NULL)
1196 $this->response->setRenderType($this->render_type);
1197 $this->render_type = NULL;
1202 case "response_lid":
1204 case "response_str":
1205 case "response_num":
1206 case "response_grp":
1208 if ($this->presentation != NULL)
1210 if ($this->response != NULL)
1212 $this->presentation->addResponse($this->response);
1213 if ($this->item != NULL)
1215 $this->item->addPresentationitem($this->response);
1219 $this->response = NULL;
1220 $this->in_response = FALSE;
1223 if ($this->do_nothing)
1225 $this->do_nothing = FALSE;
1228 if (strlen($this->item->getQuestionType()))
1244 $qt = $this->item->determineQuestionType();
1247 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1249 $question =
new $qt();
1250 $question->fromXML($this->item, $this->qpl_id, $this->tst_id, $this->tst_object, $this->question_counter, $this->import_mapping);
1253 if ($this->material)
1255 $mat = $this->material->getMaterial(0);
1256 if ((strcmp($mat[
"type"],
"mattext") == 0) && (strcmp($mat[
"material"]->getLabel(),
"suggested_solution") == 0))
1258 $this->item->addSuggestedSolution($mat[
"material"], $this->gap_index);
1260 if ($this->in_objectives)
1262 $this->objectives->addMaterial($this->material);
1264 else if (($this->render_type != NULL) && (strcmp(strtolower($this->
getParent($a_xml_parser)),
"render_hotspot") == 0))
1266 $this->render_type->addMaterial($this->material);
1268 else if (count($this->flow_mat) && (strcmp(strtolower($this->
getParent($a_xml_parser)),
"flow_mat") == 0))
1270 $this->flow_mat[count($this->flow_mat)-1]->addMaterial($this->material);
1272 else if ($this->itemfeedback != NULL)
1274 $this->itemfeedback->addMaterial($this->material);
1276 else if ($this->response_label != NULL)
1278 $this->response_label->addMaterial($this->material);
1280 else if ($this->response != NULL)
1282 if ($this->response->hasRendering())
1284 $this->response->setMaterial2($this->material);
1288 $this->response->setMaterial1($this->material);
1291 elseif (($this->in_presentation) && (!$this->in_response))
1293 if (!is_object($this->item->getQuestiontext()))
1295 $this->item->setQuestiontext($this->material);
1297 $this->presentation->addMaterial($this->material);
1299 else if ($this->presentation != NULL)
1301 $this->presentation->addMaterial($this->material);
1302 if ($this->item != NULL)
1304 $this->item->addPresentationitem($this->material);
1308 $this->material = NULL;
1311 if ($this->material != NULL)
1313 if ($this->matimage != NULL)
1315 $this->material->addMatimage($this->matimage);
1318 $this->matimage = NULL;
1320 case "resprocessing":
1321 if ($this->item != NULL)
1323 $this->item->addResprocessing($this->resprocessing);
1325 $this->resprocessing = NULL;
1328 if ($this->material != NULL)
1330 $this->material->addMattext($this->mattext);
1332 $this->mattext = NULL;
1335 if ($this->material != NULL)
1337 $this->material->addMatapplet($this->matapplet);
1339 $this->matapplet = NULL;
1342 $this->depth[$a_xml_parser]--;
1350 switch ($this->parser_mode)
1366 if ($this->do_nothing)
return;
1367 $this->characterbuffer .= $a_data;
1369 switch ($this->qti_element)
1372 $this->metadata[
"label"] = $a_data;
1375 $this->metadata[
"entry"] = $a_data;
1377 case "response_label":
1378 if ($this->response_label != NULL)
1380 $this->response_label->setContent($a_data);
1384 if ($this->setvar != NULL)
1386 $this->setvar->setContent($a_data);
1389 case "displayfeedback":
1390 if ($this->displayfeedback != NULL)
1392 $this->displayfeedback->setContent($a_data);
1402 case "varsubstring":
1403 if ($this->responsevar != NULL)
1405 $this->responsevar->setContent($a_data);
1409 if (strlen($a_data))
1411 if ($this->decvar != NULL)
1413 $this->decvar->setContent($a_data);
1418 if ($this->mattext != NULL)
1420 $this->mattext->setContent($a_data);
1424 if ($this->matapplet != NULL)
1426 $this->matapplet->setContent($a_data);
1430 if ($this->matimage != NULL)
1432 $this->matimage->setContent($a_data);
1436 switch ($this->
getParent($a_xml_parser))
1445 $this->item->setDuration($a_data);
1450 switch ($this->
getParent($a_xml_parser))
1453 $this->item->setComment($a_data);
1456 $this->assessment->setComment($a_data);
1463 $this->sametag = TRUE;
1471 switch (strtolower($a_name))
1473 case "questestinterop":
1474 $this->verifyroot =
true;
1476 case "qtimetadatafield":
1477 $this->verifymetadatafield = 1;
1480 $this->verifyfieldlabeltext =
"";
1481 if ($this->verifymetadatafield == 1) $this->verifyfieldlabel = 1;
1484 $this->verifyfieldentrytext =
"";
1485 if ($this->verifymetadatafield == 1) $this->verifyfieldentry = 1;
1489 if (is_array($a_attribs))
1491 foreach ($a_attribs as $attribute => $value)
1493 switch (strtolower($attribute))
1501 array_push($this->founditems, array(
"title" =>
"$title",
"type" =>
"",
"ident" => $a_attribs[
"ident"]));
1503 case "response_lid":
1504 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1507 if (is_array($a_attribs))
1509 foreach ($a_attribs as $attribute => $value)
1511 switch (strtolower($attribute))
1513 case "rcardinality":
1514 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
1515 switch (strtolower($value))
1524 $this->founditems[count($this->founditems)-1][
"type"] =
QT_ORDERING;
1533 case "response_str":
1534 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1537 if (is_array($a_attribs))
1539 foreach ($a_attribs as $attribute => $value)
1541 switch (strtolower($attribute))
1543 case "rcardinality":
1544 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
1545 switch (strtolower($value))
1548 $this->founditems[count($this->founditems)-1][
"type"] =
QT_CLOZE;
1551 $this->founditems[count($this->founditems)-1][
"type"] =
QT_TEXT;
1561 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1563 $this->founditems[count($this->founditems)-1][
"type"] =
QT_IMAGEMAP;
1566 case "response_num":
1567 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1569 $this->founditems[count($this->founditems)-1][
"type"] =
QT_NUMERIC;
1572 case "response_grp":
1573 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1575 $this->founditems[count($this->founditems)-1][
"type"] =
QT_MATCHING;
1580 $this->verifyqticomment = 1;
1582 case "presentation":
1583 if (is_array($a_attribs))
1585 foreach ($a_attribs as $attribute => $value)
1587 switch (strtolower($attribute))
1590 $this->founditems[count($this->founditems)-1][
"title"] = $value;
1604 switch (strtolower($a_name))
1608 $this->verifyqticomment = 0;
1610 case "qtimetadatafield":
1611 $this->verifymetadatafield = 0;
1612 if (strcmp($this->verifyfieldlabeltext,
"QUESTIONTYPE") == 0)
1618 $this->verifyfieldlabel = 0;
1621 $this->verifyfieldentry = 0;
1631 if ($this->verifyqticomment == 1)
1633 if (preg_match(
"/Questiontype\=(.*)/", $a_data, $matches))
1635 if (count($this->founditems))
1637 $this->founditems[count($this->founditems)-1][
"type"] = $matches[1];
1641 else if ($this->verifyfieldlabel == 1)
1643 $this->verifyfieldlabeltext = $a_data;
1645 else if ($this->verifyfieldentry == 1)
1647 $this->verifyfieldentrytext = $a_data;
1662 if (!is_array($this->import_mapping))