/** * Modify page content after xsl * * @param string $a_output * @return string */ function modifyPageContentPostXsl($a_output, $a_mode) { global $lng; if ($this->getPage()->getPageConfig()->getEnableSelfAssessment()) { // #14154 $q_ids = $this->getPage()->getQuestionIds(); if (sizeof($q_ids)) { include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; foreach ($q_ids as $q_id) { $q_gui = assQuestionGUI::_getQuestionGUI("", $q_id); if (!$q_gui->object->isComplete()) { $a_output = str_replace("{{{{{Question;il__qst_" . $q_id . "}}}}}", "<i>" . $lng->txt("cont_empty_question") . "</i>", $a_output); } } // this exports the questions which is needed below $qhtml = $this->getQuestionJsOfPage($a_mode == "edit" ? true : false, $a_mode); require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php'; $a_output = "<script>" . ilQuestionExporter::questionsJS($q_ids) . "</script>" . $a_output; if (!self::$initial_done) { $a_output = "<script>var ScormApi=null; var questions = new Array();</script>" . $a_output; self::$initial_done = true; } } } else { // set by T&A components $qhtml = $this->getPage()->getPageConfig()->getQuestionHTML(); } if (is_array($qhtml)) { foreach ($qhtml as $k => $h) { $a_output = str_replace("{{{{{Question;il__qst_{$k}" . "}}}}}", " " . $h, $a_output); } } return $a_output; }
/** * Reset initial state (for exports) */ static function resetInitialState() { self::$initial_done = false; }