private function buildQuestionPage(assQuestionGUI $questionGUI) { $this->tpl->addCss('Services/COPage/css/content.css'); include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; $pageGUI = new ilAssQuestionPageGUI($questionGUI->object->getId()); $pageGUI->setOutputMode("presentation"); $pageGUI->setRenderPageContainer(true); $pageGUI->setPresentationTitle($questionGUI->object->getTitle()); $questionGUI->object->setShuffle(false); // dirty, but works ^^ $questionHTML = $questionGUI->getSolutionOutput(0, 0, false, false, true, false, true, false, true); $pageGUI->setQuestionHTML(array($questionGUI->object->getId() => $questionHTML)); $pageHTML = $pageGUI->presentation(); $pageHTML = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $pageHTML); return $pageHTML; }
private function populateQuestionOutput(ilTemplate $tpl) { // FOR WHAT EXACTLY IS THIS USEFUL? $this->ctrl->setReturnByClass('ilAssQuestionPageGUI', 'view'); $this->ctrl->setReturnByClass('ilObjQuestionPoolGUI', 'questions'); include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; $pageGUI = new ilAssQuestionPageGUI($this->questionOBJ->getId()); $pageGUI->setRenderPageContainer(false); $pageGUI->setEditPreview(true); $pageGUI->setEnabledTabs(false); // FOR WHICH SITUATION IS THIS WORKAROUND NECCESSARY? (sure .. imagemaps, but where this can be done?) if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST['editImagemapForward_x'])) { $this->ctrl->setCmdClass(get_class($pageGUI)); $this->ctrl->setCmd('preview'); } $this->questionGUI->setPreviewSession($this->previewSession); $questionHtml = $this->questionGUI->getPreview(true, $this->isShowSpecificQuestionFeedbackRequired()); $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $questionHtml)); //$pageGUI->setHeader($this->questionOBJ->getTitle()); // NO ADDITIONAL HEADER $pageGUI->setPresentationTitle($this->questionOBJ->getTitle()); //$pageGUI->setTemplateTargetVar("ADM_CONTENT"); // NOT REQUIRED, OR IS? $tpl->setVariable('QUESTION_OUTPUT', $pageGUI->preview()); }