4include_once(
"./Services/Export/classes/class.ilXmlImporter.php");
24 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_id))
27 #$newObj->setImportDirectory(dirname(rtrim($this->getImportDirectory(),'/')));
32 $GLOBALS[
'ilLog']->write(__METHOD__.
': Called in non container mode');
37 include_once
"./Services/Survey/classes/class.SurveyImportParser.php";
41 if(!@file_exists($xml_file))
43 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot find xml definition: '. $xml_file);
48 $import->setSurveyObject($newObj);
49 $import->startParsing();
51 if (is_array(
$_SESSION[
"import_mob_xhtml"]))
53 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
54 include_once
"./Services/RTE/classes/class.ilRTE.php";
55 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
56 foreach (
$_SESSION[
"import_mob_xhtml"] as $mob)
58 $importfile = dirname($xml_file) .
"/" . $mob[
"uri"];
59 if (file_exists($importfile))
63 $newObj->setIntroduction(str_replace(
"src=\"" . $mob[
"mob"] .
"\"",
"src=\"" .
"il_" . IL_INST_ID .
"_mob_" . $media_object->getId() .
"\"", $newObj->getIntroduction()));
64 $newObj->setOutro(str_replace(
"src=\"" . $mob[
"mob"] .
"\"",
"src=\"" .
"il_" . IL_INST_ID .
"_mob_" . $media_object->getId() .
"\"", $newObj->getOutro()));
69 $ilLog->write(
"Error: Could not open XHTML mob file for test introduction during test import. File $importfile does not exist!");
77 $a_mapping->addMapping(
"Modules/Survey",
"svy", $a_id, $newObj->getId());
90 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.$this->getImportDirectory());
Survey Question Import Parser.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
Importer class for files.
parseXmlFileNames()
Create qti and xml file name.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
getImportDirectory()
Get import directory.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.