/** * Save sequencing */ function saveSequencing() { global $tpl, $lng, $ilCtrl; include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php"; include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php"; $t = $this->object->getTree(); $root_node = $t->getNodeData($t->getRootId()); $nodes = $this->object->getTree()->getSubtree($root_node); foreach ($nodes as $node) { if (in_array($node["type"], array("", "chap", "sco"))) { if ($node["type"] == "") { $item = new ilSCORM2004Item($this->object->getId(), true); } else { $item = new ilSCORM2004Item($node["child"]); } $xml = '<?xml version="1.0"?>' . ilUtil::stripSlashes($_POST["seq"][$node["child"]], false); $ob_texts = array(); if ($node["type"] == "sco") { $sco = new ilSCORM2004Sco($this->object, $node["child"]); $objectives = $sco->getObjectives(); foreach ($objectives as $o) { $ob_texts[$o->getId()] = $o->getObjectiveId(); } } $item->setSeqXml($xml); $item->initDom(); $item->update(); if ($node["type"] == "sco") { foreach ($ob_texts as $id => $t) { $objective = new ilScorm2004Objective($node["child"], $id); $objective->setObjectiveId($t); $objective->updateObjective(); } } } } ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true); $ilCtrl->redirect($this, "showSequencing"); }
public function updateObjective() { parent::update(); }