/** * fill row * * @access public * @param * @return */ public function fillRow($data) { global $ilUser, $ilAccess; include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php"; $class = strtolower(assQuestionGUI::_getGUIClassNameForId($data["question_id"])); $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $data["question_id"]); $this->ctrl->setParameterByClass("ilAssQuestionPreviewGUI", "q_id", $data["question_id"]); $this->ctrl->setParameterByClass($class, "q_id", $data["question_id"]); $points = 0; if (!$this->confirmdelete) { $this->tpl->setCurrentBlock('checkbox'); $this->tpl->setVariable('CB_QUESTION_ID', $data["question_id"]); $this->tpl->parseCurrentBlock(); if ($this->getEditable()) { $this->tpl->setCurrentBlock("edit_link"); $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit")); $this->tpl->setVariable("LINK_EDIT", $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit")); $this->tpl->parseCurrentBlock(); } if ($data["complete"] == 0) { $this->tpl->setCurrentBlock("qpl_warning"); $this->tpl->setVariable("IMAGE_WARNING", ilUtil::getImagePath("icon_alert.svg")); $this->tpl->setVariable("ALT_WARNING", $this->lng->txt("warning_question_not_complete")); $this->tpl->setVariable("TITLE_WARNING", $this->lng->txt("warning_question_not_complete")); $this->tpl->parseCurrentBlock(); } else { $points = $data["points"]; $this->totalWorkingTime = assQuestion::sumTimesInISO8601FormatH_i_s_Extended($this->totalWorkingTime, $data['working_time']); } $this->totalPoints += $points; foreach ($this->getSelectedColumns() as $c) { if (strcmp($c, 'points') == 0) { $this->tpl->setCurrentBlock('points'); $this->tpl->setVariable("QUESTION_POINTS", $points); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'statistics') == 0) { $this->tpl->setCurrentBlock('statistics'); $this->tpl->setVariable("LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class, "assessment")); $this->tpl->setVariable("TXT_ASSESSMENT", $this->lng->txt("statistics")); include_once "./Services/Utilities/classes/class.ilUtil.php"; $this->tpl->setVariable("IMG_ASSESSMENT", ilUtil::getImagePath("assessment.gif", "Modules/TestQuestionPool")); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'author') == 0) { $this->tpl->setCurrentBlock('author'); $this->tpl->setVariable("QUESTION_AUTHOR", $data["author"]); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'created') == 0) { $this->tpl->setCurrentBlock('created'); $this->tpl->setVariable('QUESTION_CREATED', ilDatePresentation::formatDate(new ilDateTime($data['created'], IL_CAL_UNIX))); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'tstamp') == 0) { $this->tpl->setCurrentBlock('updated'); $this->tpl->setVariable('QUESTION_UPDATED', ilDatePresentation::formatDate(new ilDateTime($data['tstamp'], IL_CAL_UNIX))); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'working_time') == 0) { $this->tpl->setCurrentBlock('working_time'); $this->tpl->setVariable('WORKING_TIME', $data["working_time"]); $this->tpl->parseCurrentBlock(); } } $this->tpl->setCurrentBlock('preview'); $this->tpl->setVariable("TXT_PREVIEW", $this->lng->txt("preview")); $this->tpl->setVariable("LINK_PREVIEW", $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW)); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('hidden'); $this->tpl->setVariable('HIDDEN_QUESTION_ID', $data["question_id"]); $this->tpl->parseCurrentBlock(); } foreach ($this->getSelectedColumns() as $c) { if (strcmp($c, 'description') == 0) { $this->tpl->setCurrentBlock('description'); $this->tpl->setVariable("QUESTION_COMMENT", strlen($data["description"]) ? $data["description"] : " "); $this->tpl->parseCurrentBlock(); } if (strcmp($c, 'type') == 0) { $this->tpl->setCurrentBlock('type'); $this->tpl->setVariable("QUESTION_TYPE", assQuestion::_getQuestionTypeName($data["type_tag"])); $this->tpl->parseCurrentBlock(); } } $this->tpl->setVariable('QUESTION_ID', $data["question_id"]); $this->tpl->setVariable("QUESTION_TITLE", $data["title"]); }
/** * fill row * * @access public * @param * @return */ public function fillRow($data) { global $ilUser, $ilAccess; $q_id = $data["question_id"]; $this->tpl->setVariable("QUESTION_ID", $q_id); if (isset($this->visibleOptionalColumns['qid'])) { $this->tpl->setVariable("QUESTION_ID_PRESENTATION", $q_id); } if ($this->getWriteAccess() && !$this->getTotal() && $data["obj_fi"] > 0) { if (!$data['complete']) { $this->tpl->setVariable("IMAGE_WARNING", ilUtil::getImagePath("icon_alert.svg")); $this->tpl->setVariable("ALT_WARNING", $this->lng->txt("warning_question_not_complete")); $this->tpl->setVariable("TITLE_WARNING", $this->lng->txt("warning_question_not_complete")); } $qpl_ref_id = current(ilObject::_getAllReferences($data["obj_fi"])); $this->tpl->setVariable("QUESTION_TITLE", "<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(), "questions") . "&eqid={$q_id}&eqpl={$qpl_ref_id}" . "\">" . $data["title"] . "</a>"); // obligatory checkbox (when obligation is possible) if ($data["obligationPossible"]) { $CHECKED = $data["obligatory"] ? "checked=\"checked\" " : ""; $OBLIGATORY = "<input type=\"checkbox\" name=\"obligatory[{$q_id}]\" value=\"1\" {$CHECKED}/>"; } else { $OBLIGATORY = ""; } } else { global $lng; $this->tpl->setVariable("QUESTION_TITLE", $data["title"]); // obligatory icon if ($data["obligatory"]) { $OBLIGATORY = "<img src=\"" . ilUtil::getImagePath("obligatory.gif", "Modules/Test") . "\" alt=\"" . $lng->txt("question_obligatory") . "\" title=\"" . $lng->txt("question_obligatory") . "\" />"; } else { $OBLIGATORY = ''; } } if ($this->parent_obj->object->areObligationsEnabled()) { $this->tpl->setVariable("QUESTION_OBLIGATORY", $OBLIGATORY); } $this->tpl->setVariable("QUESTION_SEQUENCE", $this->lng->txt("tst_sequence")); if ($this->getWriteAccess() && !$this->getTotal()) { if ($data["sequence"] != 1) { $this->tpl->setVariable("BUTTON_UP", "<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(), "questions") . "&up=" . $data["question_id"] . "\">" . ilGlyphGUI::get(ilGlyphGUI::UP, $this->lng->txt('up')) . "</a>"); } if ($data["sequence"] != count($this->getData())) { $this->tpl->setVariable("BUTTON_DOWN", "<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(), "questions") . "&down=" . $data["question_id"] . "\">" . ilGlyphGUI::get(ilGlyphGUI::DOWN, $this->lng->txt('down')) . "</a>"); } } if (isset($this->visibleOptionalColumns['description'])) { if ($data["description"]) { $this->tpl->setVariable("QUESTION_COMMENT", $data["description"] ? $data["description"] : ' '); } else { $this->tpl->touchBlock('question_comment_block'); } } include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; $this->tpl->setVariable("QUESTION_TYPE", assQuestion::_getQuestionTypeName($data["type_tag"])); $this->tpl->setVariable("QUESTION_POINTS", $data["points"]); $this->totalPoints += $data["points"]; $this->totalWorkingTime = assQuestion::sumTimesInISO8601FormatH_i_s_Extended($this->totalWorkingTime, $data['working_time']); if (isset($this->visibleOptionalColumns['author'])) { $this->tpl->setVariable("QUESTION_AUTHOR", $data["author"]); } if (isset($this->visibleOptionalColumns['working_time'])) { $this->tpl->setVariable("QUESTION_WORKING_TIME", $data["working_time"]); } if (ilObject::_lookupType($data["orig_obj_fi"]) == 'qpl') { $this->tpl->setVariable("QUESTION_POOL", ilObject::_lookupTitle($data["orig_obj_fi"])); } else { $this->tpl->setVariable("QUESTION_POOL", $this->lng->txt('tst_question_not_from_pool_info')); } $this->position += 10; $field = "<input type=\"text\" name=\"order[q_" . $data["question_id"] . "]\" value=\"" . $this->position . "\" maxlength=\"3\" style=\"width:30px\" />"; $this->tpl->setVariable("QUESTION_POSITION", $field); }