/** * Constructor * @access public */ function ilSCORM2004Objective($a_treeid = null, $a_obj_id = null) { parent::ilSCORM2004Item($a_treeid); if ($a_obj_id != null && $a_treeid != null) { $xpath_obj = new DOMXPath($this->dom); $obj_node_list = $xpath_obj->query('//objective[@objectiveID = "' . $a_obj_id . '"] | ' . '//primaryObjective[@objectiveID = "' . $a_obj_id . '"]'); $this->setNode($obj_node_list->item(0)); } else { if ($a_obj_id == null && $a_treeid != null) { $obj_con = $this->dom->createElement("objectives"); $obj = $this->dom->createElement("primaryObjective"); $root = $this->dom->getElementsByTagName("sequencing")->item(0); $obj_con->appendChild($obj); $root->appendChild($obj_con); $this->node = $this->dom->getElementsByTagName("primaryObjective")->item(0); } } }
/** * Constructor * @access public */ function ilSCORM2004Sequencing($a_treeid = null, $a_rootlevel = false) { parent::ilSCORM2004Item($a_treeid, $a_rootlevel); if ($a_treeid != null) { $xpath_obj = new DOMXPath($this->dom); $obj_node_list = $xpath_obj->query('//controlMode'); $this->setNode($obj_node_list->item(0)); if ($obj_node_list->length != 1) { $obj_con = $this->dom->createElement("controlMode"); $root = $this->dom->getElementsByTagName("sequencing")->item(0); $root->appendChild($obj_con); $this->node = $this->dom->getElementsByTagName("controlMode")->item(0); $this->setFlow(true); $this->setChoice(true); $this->setForwardOnly(false); } } }