function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE, $show_feedback = FALSE) { // generate the question output $template = new ilTemplate("tpl.il_as_qpl_errortext_output.html", TRUE, TRUE, "Modules/TestQuestionPool"); if ($active_id) { $solutions = NULL; include_once "./Modules/Test/classes/class.ilObjTest.php"; if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) { if (is_null($pass)) { $pass = ilObjTest::_getPass($active_id); } } $solutions =& $this->object->getSolutionValues($active_id, $pass); } $errortext_value = ""; if (strlen($_SESSION['qst_selection'])) { $this->object->toggleSelection($_SESSION['qst_selection'], $active_id, $pass); unset($_SESSION['qst_selection']); $solutions =& $this->object->getSolutionValues($active_id, $pass); } $selections = array(); if (is_array($solutions)) { foreach ($solutions as $solution) { array_push($selections, $solution['value1']); } $errortext_value = join(",", $selections); } if ($this->object->getTextSize() >= 10) { echo $template->setVariable("STYLE", " style=\"font-size: " . $this->object->getTextSize() . "%;\""); } $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE)); $errortext = $this->object->createErrorTextOutput($selections); $errortext = preg_replace_callback("/#HREF(\\d+)/is", array(&$this, 'exchangeURL'), $errortext); $this->ctrl->setParameterByClass('iltestoutputgui', 'errorvalue', ''); $template->setVariable("ERRORTEXT", $errortext); $template->setVariable("ERRORTEXT_ID", "qst_" . $this->object->getId()); $template->setVariable("ERRORTEXT_VALUE", $errortext_value); $questionoutput = $template->get(); if (!$show_question_only) { // get page object output $questionoutput = $this->getILIASPage($questionoutput); } include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initElementSelection(); $this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/errortext.js"); $questionoutput = $template->get(); $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput); return $pageoutput; }