/** * 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("ilpageobjectgui", "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("ilpageobjectgui", "edit")); $this->tpl->parseCurrentBlock(); } if ($data["complete"] == 0) { $this->tpl->setCurrentBlock("qpl_warning"); $this->tpl->setVariable("IMAGE_WARNING", ilUtil::getImagePath("warning.png")); $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->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(); } } $this->tpl->setCurrentBlock('preview'); $this->tpl->setVariable("TXT_PREVIEW", $this->lng->txt("preview")); $this->tpl->setVariable("LINK_PREVIEW", $this->ctrl->getLinkTargetByClass("ilpageobjectgui", "preview")); $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"]); }