4 include_once(
"./Services/Export/classes/class.ilXmlImporter.php");
24 include_once
"./Modules/Test/classes/class.ilObjTest.php";
27 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_id))
34 $GLOBALS[
'ilLog']->write(__METHOD__.
': Called in non container mode');
40 if(!@file_exists($xml_file))
42 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot find xml definition: '. $xml_file);
45 if(!@file_exists($qti_file))
47 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot find xml definition: '. $qti_file);
54 $newObj->mark_schema->flush();
58 $qpl_id = $newObj->getId();
61 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
63 $qtiParser->setTestObject($newObj);
64 $result = $qtiParser->startParsing();
68 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
70 $contParser->setQuestionMapping($qtiParser->getImportMapping());
71 $contParser->startParsing();
73 $a_mapping->addMapping(
"Modules/Test",
"tst", $a_id, $newObj->getId());
85 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.$this->getImportDirectory());
90 $qti = $this->
getImportDirectory().
'/'.preg_replace(
'/test|tst/',
'qti', $basename).
'.xml';
92 return array($xml,$qti);