private function populateSolutionOutput(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->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); $pageGUI->setQuestionHTML(array($this->questionOBJ->getId() => $this->questionGUI->getSolutionOutput(0))); //$pageGUI->setHeader($this->questionOBJ->getTitle()); // NO ADDITIONAL HEADER //$pageGUI->setPresentationTitle($this->questionOBJ->getTitle()); //$pageGUI->setTemplateTargetVar("ADM_CONTENT"); // NOT REQUIRED, OR IS? $tpl->setCurrentBlock('solution_output'); $tpl->setVariable('SOLUTION_OUTPUT', $pageGUI->preview()); $tpl->parseCurrentBlock(); }
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; }