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);
966 case "resprocessing":
967 include_once(
"./Services/QTI/classes/class.ilQTIResprocessing.php");
969 if (is_array($a_attribs))
971 foreach ($a_attribs as $attribute => $value)
973 switch (strtolower($attribute))
976 $this->resprocessing->setScoremodel($value);
990 switch ($this->parser_mode)
1006 if (($this->do_nothing) && (strcmp(strtolower($a_name),
"item") != 0))
return;
1007 switch (strtolower($a_name))
1010 if (is_object($this->tst_object))
1012 $this->tst_object->fromXML($this->assessment);
1014 $this->in_assessment = FALSE;
1016 case "assessmentcontrol":
1017 $this->assessment->addAssessmentcontrol($this->assessmentcontrol);
1018 $this->assessmentcontrol = NULL;
1021 if (strcmp(strtolower($this->
getParent($a_xml_parser)),
"assessment") == 0)
1023 $this->assessment->addObjectives($this->objectives);
1025 $this->in_objectives = FALSE;
1027 case "itemmetadata":
1028 $this->in_itemmetadata = FALSE;
1030 case "qtimetadatafield":
1032 switch ($this->metadata[
"label"])
1034 case "ILIAS_VERSION":
1036 case "QUESTIONTYPE":
1037 if ($this->item != NULL)
1039 $this->item->setQuestiontype($this->metadata[
"entry"]);
1043 if ($this->item != NULL)
1045 $this->item->setAuthor($this->metadata[
"entry"]);
1048 if ($this->item != NULL)
1050 $this->item->addMetadata($this->metadata);
1054 if ($this->in_assessment)
1056 $this->assessment->addQtiMetadata($this->metadata);
1058 $this->metadata = array(
"label" =>
"",
"entry" =>
"");
1064 if (count($this->flow_mat))
1067 if (count($this->flow_mat))
1069 $this->flow_mat[count($this->flow_mat)-1]->addFlow_mat(
$flow_mat);
1071 else if ($this->itemfeedback != NULL)
1073 $this->itemfeedback->addFlow_mat(
$flow_mat);
1075 else if ($this->response_label != NULL)
1077 $this->response_label->addFlow_mat(
$flow_mat);
1081 case "itemfeedback":
1082 if ($this->item != NULL)
1084 if ($this->itemfeedback != NULL)
1086 $this->item->addItemfeedback($this->itemfeedback);
1089 $this->itemfeedback = NULL;
1091 case "displayfeedback":
1092 if ($this->respcondition != NULL)
1094 if ($this->displayfeedback != NULL)
1096 $this->respcondition->addDisplayfeedback($this->displayfeedback);
1099 $this->displayfeedback = NULL;
1102 if ($this->respcondition != NULL)
1104 if ($this->setvar != NULL)
1106 $this->respcondition->addSetvar($this->setvar);
1109 $this->setvar = NULL;
1111 case "conditionvar":
1112 if ($this->respcondition != NULL)
1114 $this->respcondition->setConditionvar($this->conditionvar);
1116 $this->conditionvar = NULL;
1125 case "varsubstring":
1126 if ($this->conditionvar != NULL)
1128 if ($this->responsevar != NULL)
1130 $this->conditionvar->addResponseVar($this->responsevar);
1133 $this->responsevar = NULL;
1135 case "respcondition":
1136 if ($this->resprocessing != NULL)
1138 $this->resprocessing->addRespcondition($this->respcondition);
1140 $this->respcondition = NULL;
1143 if ($this->resprocessing != NULL)
1145 $this->resprocessing->setOutcomes($this->outcomes);
1147 $this->outcomes = NULL;
1150 if ($this->outcomes != NULL)
1152 $this->outcomes->addDecvar($this->decvar);
1154 $this->decvar = NULL;
1156 case "presentation":
1157 $this->in_presentation = FALSE;
1158 if ($this->presentation != NULL)
1160 if ($this->item != NULL)
1162 $this->item->setPresentation($this->presentation);
1165 $this->presentation = NULL;
1167 case "response_label":
1168 if ($this->render_type != NULL)
1170 $this->render_type->addResponseLabel($this->response_label);
1171 $this->response_label = NULL;
1174 case "render_choice":
1175 case "render_hotspot":
1177 if ($this->in_response)
1179 if ($this->response != NULL)
1181 if ($this->render_type != NULL)
1183 $this->response->setRenderType($this->render_type);
1184 $this->render_type = NULL;
1189 case "response_lid":
1191 case "response_str":
1192 case "response_num":
1193 case "response_grp":
1195 if ($this->presentation != NULL)
1197 if ($this->response != NULL)
1199 $this->presentation->addResponse($this->response);
1200 if ($this->item != NULL)
1202 $this->item->addPresentationitem($this->response);
1206 $this->response = NULL;
1207 $this->in_response = FALSE;
1210 if ($this->do_nothing)
1212 $this->do_nothing = FALSE;
1215 if (strlen($this->item->getQuestionType()))
1231 $qt = $this->item->determineQuestionType();
1234 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1236 $question =
new $qt();
1237 $question->fromXML($this->item, $this->qpl_id, $this->tst_id, $this->tst_object, $this->question_counter, $this->import_mapping);
1240 if ($this->material)
1242 $mat = $this->material->getMaterial(0);
1243 if ((strcmp($mat[
"type"],
"mattext") == 0) && (strcmp($mat[
"material"]->getLabel(),
"suggested_solution") == 0))
1245 $this->item->addSuggestedSolution($mat[
"material"], $this->gap_index);
1247 if ($this->in_objectives)
1249 $this->objectives->addMaterial($this->material);
1251 else if (($this->render_type != NULL) && (strcmp(strtolower($this->
getParent($a_xml_parser)),
"render_hotspot") == 0))
1253 $this->render_type->addMaterial($this->material);
1255 else if (count($this->flow_mat) && (strcmp(strtolower($this->
getParent($a_xml_parser)),
"flow_mat") == 0))
1257 $this->flow_mat[count($this->flow_mat)-1]->addMaterial($this->material);
1259 else if ($this->itemfeedback != NULL)
1261 $this->itemfeedback->addMaterial($this->material);
1263 else if ($this->response_label != NULL)
1265 $this->response_label->addMaterial($this->material);
1267 else if ($this->response != NULL)
1269 if ($this->response->hasRendering())
1271 $this->response->setMaterial2($this->material);
1275 $this->response->setMaterial1($this->material);
1278 elseif (($this->in_presentation) && (!$this->in_response))
1280 if (!is_object($this->item->getQuestiontext()))
1282 $this->item->setQuestiontext($this->material);
1284 $this->presentation->addMaterial($this->material);
1286 else if ($this->presentation != NULL)
1288 $this->presentation->addMaterial($this->material);
1289 if ($this->item != NULL)
1291 $this->item->addPresentationitem($this->material);
1295 $this->material = NULL;
1298 if ($this->material != NULL)
1300 if ($this->matimage != NULL)
1302 $this->material->addMatimage($this->matimage);
1305 $this->matimage = NULL;
1307 case "resprocessing":
1308 if ($this->item != NULL)
1310 $this->item->addResprocessing($this->resprocessing);
1312 $this->resprocessing = NULL;
1315 if ($this->material != NULL)
1317 $this->material->addMattext($this->mattext);
1319 $this->mattext = NULL;
1322 if ($this->material != NULL)
1324 $this->material->addMatapplet($this->matapplet);
1326 $this->matapplet = NULL;
1329 $this->depth[$a_xml_parser]--;
1337 switch ($this->parser_mode)
1353 if ($this->do_nothing)
return;
1354 $this->characterbuffer .= $a_data;
1356 switch ($this->qti_element)
1359 $this->metadata[
"label"] = $a_data;
1362 $this->metadata[
"entry"] = $a_data;
1364 case "response_label":
1365 if ($this->response_label != NULL)
1367 $this->response_label->setContent($a_data);
1371 if ($this->setvar != NULL)
1373 $this->setvar->setContent($a_data);
1376 case "displayfeedback":
1377 if ($this->displayfeedback != NULL)
1379 $this->displayfeedback->setContent($a_data);
1389 case "varsubstring":
1390 if ($this->responsevar != NULL)
1392 $this->responsevar->setContent($a_data);
1396 if (strlen($a_data))
1398 if ($this->decvar != NULL)
1400 $this->decvar->setContent($a_data);
1405 if ($this->mattext != NULL)
1407 $this->mattext->setContent($a_data);
1411 if ($this->matapplet != NULL)
1413 $this->matapplet->setContent($a_data);
1417 if ($this->matimage != NULL)
1419 $this->matimage->setContent($a_data);
1423 switch ($this->
getParent($a_xml_parser))
1432 $this->item->setDuration($a_data);
1437 switch ($this->
getParent($a_xml_parser))
1440 $this->item->setComment($a_data);
1443 $this->assessment->setComment($a_data);
1450 $this->sametag = TRUE;
1458 switch (strtolower($a_name))
1460 case "questestinterop":
1461 $this->verifyroot =
true;
1463 case "qtimetadatafield":
1464 $this->verifymetadatafield = 1;
1467 $this->verifyfieldlabeltext =
"";
1468 if ($this->verifymetadatafield == 1) $this->verifyfieldlabel = 1;
1471 $this->verifyfieldentrytext =
"";
1472 if ($this->verifymetadatafield == 1) $this->verifyfieldentry = 1;
1476 if (is_array($a_attribs))
1478 foreach ($a_attribs as $attribute => $value)
1480 switch (strtolower($attribute))
1488 array_push($this->founditems, array(
"title" =>
"$title",
"type" =>
"",
"ident" => $a_attribs[
"ident"]));
1490 case "response_lid":
1491 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1494 if (is_array($a_attribs))
1496 foreach ($a_attribs as $attribute => $value)
1498 switch (strtolower($attribute))
1500 case "rcardinality":
1501 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
1502 switch (strtolower($value))
1511 $this->founditems[count($this->founditems)-1][
"type"] =
QT_ORDERING;
1520 case "response_str":
1521 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1524 if (is_array($a_attribs))
1526 foreach ($a_attribs as $attribute => $value)
1528 switch (strtolower($attribute))
1530 case "rcardinality":
1531 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
1532 switch (strtolower($value))
1535 $this->founditems[count($this->founditems)-1][
"type"] =
QT_CLOZE;
1538 $this->founditems[count($this->founditems)-1][
"type"] =
QT_TEXT;
1548 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1550 $this->founditems[count($this->founditems)-1][
"type"] =
QT_IMAGEMAP;
1553 case "response_num":
1554 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1556 $this->founditems[count($this->founditems)-1][
"type"] =
QT_NUMERIC;
1559 case "response_grp":
1560 if (strlen($this->founditems[count($this->founditems)-1][
"type"]) == 0)
1562 $this->founditems[count($this->founditems)-1][
"type"] =
QT_MATCHING;
1567 $this->verifyqticomment = 1;
1569 case "presentation":
1570 if (is_array($a_attribs))
1572 foreach ($a_attribs as $attribute => $value)
1574 switch (strtolower($attribute))
1577 $this->founditems[count($this->founditems)-1][
"title"] = $value;
1591 switch (strtolower($a_name))
1595 $this->verifyqticomment = 0;
1597 case "qtimetadatafield":
1598 $this->verifymetadatafield = 0;
1599 if (strcmp($this->verifyfieldlabeltext,
"QUESTIONTYPE") == 0)
1605 $this->verifyfieldlabel = 0;
1608 $this->verifyfieldentry = 0;
1618 if ($this->verifyqticomment == 1)
1620 if (preg_match(
"/Questiontype\=(.*)/", $a_data, $matches))
1622 if (count($this->founditems))
1624 $this->founditems[count($this->founditems)-1][
"type"] = $matches[1];
1628 else if ($this->verifyfieldlabel == 1)
1630 $this->verifyfieldlabeltext = $a_data;
1632 else if ($this->verifyfieldentry == 1)
1634 $this->verifyfieldentrytext = $a_data;
1649 if (!is_array($this->import_mapping))