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_orderinghorizontal_output.html", TRUE, TRUE, "Modules/TestQuestionPool"); $elements = $this->object->getRandomOrderingElements(); 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); if (count($solutions) == 1) { $elements = split("{::}", $solutions[0]["value1"]); } } if (strlen($_SESSION['qst_selection'])) { $this->object->moveRight($_SESSION['qst_selection'], $active_id, $pass); unset($_SESSION['qst_selection']); $solutions =& $this->object->getSolutionValues($active_id, $pass); if (count($solutions) == 1) { $elements = split("{::}", $solutions[0]["value1"]); } } if (count($solutions) == 0) { $_SESSION['qst_ordering_horizontal_elements'] = $elements; } else { unset($_SESSION['qst_ordering_horizontal_elements']); } $idx = 0; foreach ($elements as $id => $element) { $template->setCurrentBlock("element"); $template->setVariable("ELEMENT_ID", "e_" . $this->object->getId() . "_{$id}"); $template->setVariable("ELEMENT_VALUE", ilUtil::prepareFormOutput($element)); $this->ctrl->setParameterByClass('iltestoutputgui', 'qst_selection', $idx); $idx++; $url = $this->ctrl->getLinkTargetByClass('iltestoutputgui', 'gotoQuestion'); $template->setVariable("MOVE_RIGHT", $url); $template->setVariable("TEXT_MOVE_RIGHT", $this->lng->txt('move_right')); $template->setVariable("RIGHT_IMAGE", ilUtil::getImagePath('nav_arr_R.png')); $template->parseCurrentBlock(); } if ($this->object->textsize >= 10) { echo $template->setVariable("STYLE", " style=\"font-size: " . $this->object->textsize . "%;\""); } $template->setVariable("VALUE_ORDERRESULT", ' value="' . join($elements, '{::}') . '"'); $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE)); $questionoutput = $template->get(); if (!$show_question_only) { // get page object output $questionoutput = $this->getILIASPage($questionoutput); } include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDragDropAnimation(); $this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/orderinghorizontal.js"); $questionoutput = $template->get(); $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput); return $pageoutput; }