/** * Constructor * * @param object $a_parent_obj parent gui object * @param string $a_parent_cmd parent cmd * @param ilLMPresentationGUI $a_lm_pres learning module presentation gui object * @param string $a_lang language */ function __construct($a_parent_obj, $a_parent_cmd, ilLMPresentationGUI $a_lm_pres, $a_lang = "-") { parent::__construct($a_parent_obj, $a_parent_cmd, $a_lm_pres, $a_lang); include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; $chaps = ilLMObject::_getAllLMObjectsOfLM($this->lm->getId(), $a_type = "st"); foreach ($chaps as $c) { $this->setNodeOpen($c); } }
/** * Load LM tracking data. Loaded when needed. * * @param * @return */ protected function loadLMTrackingData() { global $ilDB; // we must prevent loading tracking data multiple times during a request where possible // please note that the dirty flag works only to a certain limit // e.g. if questions are answered the flag is not set (yet) // or if pages/chapter are added/deleted the flag is not set if ($this->loaded_for_node === (int) $this->getCurrentPage() && !$this->dirty) { return; } $this->loaded_for_node = (int) $this->getCurrentPage(); $this->dirty = false; // load lm tree in array $this->tree_arr = array(); $nodes = $this->lm_tree->getSubTree($this->lm_tree->getNodeData($this->lm_tree->readRootId())); foreach ($nodes as $node) { $this->tree_arr["childs"][$node["parent"]][] = $node; $this->tree_arr["parent"][$node["child"]] = $node["parent"]; $this->tree_arr["nodes"][$node["child"]] = $node; } // load all lm obj ids of learning module include_once "./Modules/LearningModule/classes/class.ilLMObject.php"; $this->lm_obj_ids = ilLMObject::_getAllLMObjectsOfLM($this->lm_obj_id); // load read event data $this->re_arr = array(); $set = $ilDB->query("SELECT * FROM lm_read_event " . " WHERE " . $ilDB->in("obj_id", $this->lm_obj_ids, false, "integer")); while ($rec = $ilDB->fetchAssoc($set)) { $this->re_arr[$rec["obj_id"]] = $rec; } // load question/pages information $this->page_questions = array(); $this->all_questions = array(); include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php"; $q = ilLMPageObject::queryQuestionsOfLearningModule($this->lm_obj_id, "", "", 0, 0); foreach ($q["set"] as $quest) { $this->page_questions[$quest["page_id"]][] = $quest["question_id"]; $this->all_questions[] = $quest["question_id"]; } // load question answer information include_once "./Services/COPage/classes/class.ilPageQuestionProcessor.php"; $this->answer_status = ilPageQuestionProcessor::getAnswerStatus($this->all_questions, $this->user_id); $this->has_incorrect_answers = false; $has_pred_incorrect_answers = false; $has_pred_incorrect_not_unlocked_answers = false; $this->determineProgressStatus($this->lm_tree->readRootId(), $has_pred_incorrect_answers, $has_pred_incorrect_not_unlocked_answers); $this->has_incorrect_answers = $has_pred_incorrect_answers; }