function __showTests() { global $ilias, $rbacsystem, $ilObjDataCache, $ilUser; include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php'; if (!count($tests = $this->__getAllTests())) { return false; } $this->tpl->addBlockfile('TEST_BLOCK', 'test_block', 'tpl.crs_objectives_view_tst_table.html', 'Modules/Course'); $this->tpl->setVariable("TBL_TITLE_TST", $this->lng->txt('tests')); $this->__showHideLinks('tst'); if (isset($_SESSION['crs_hide_tst'])) { return true; } $this->tpl->setVariable("TBL_HEADER_WIDTH_TST_1", "75%"); $this->tpl->setVariable("TBL_HEADER_NAME_TST_1", $this->lng->txt('description')); $this->tpl->setVariable("TBL_HEADER_WIDTH_TST", "5%"); $this->tpl->setVariable("TBL_HEADER_NAME_TST", $this->lng->txt('crs_nr')); $this->tpl->setVariable("TBL_HEADER_WIDTH_TST_2", "20%"); $this->tpl->setVariable("TBL_HEADER_NAME_TST_2", ''); $counter = 1; foreach ($tests as $tst_id) { $obj_id = $ilObjDataCache->lookupObjId($tst_id); $obj_type = $ilObjDataCache->lookupType($obj_id); $conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($tst_id, $obj_id); $obj_link = ilRepositoryExplorer::buildLinkTarget($tst_id, $obj_type); $obj_link = "ilias.php?baseClass=ilObjTestGUI&ref_id=" . $tst_id . "&cmd=infoScreen"; $obj_frame = ''; if (ilRepositoryExplorer::isClickable($obj_type, $tst_id, $obj_id)) { $this->tpl->setCurrentBlock("tst_read"); $this->tpl->setVariable("READ_TITLE_TST", $ilObjDataCache->lookupTitle($obj_id)); $this->tpl->setVariable("READ_TARGET_TST", $obj_frame); $this->tpl->setVariable("READ_LINK_TST", $obj_link . '&crs_show_result=' . $this->course_obj->getRefId()); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock("tst_visible"); $this->tpl->setVariable("VISIBLE_LINK_TST", $ilObjDataCache->lookupTitle($obj_id)); $this->tpl->parseCurrentBlock(); } // add to desktop link if (!$ilUser->isDesktopItem($tst_id, $obj_type) and $this->course_obj->getAboStatus() == $this->course_obj->ABO_ENABLED) { if ($rbacsystem->checkAccess('read', $tst_id)) { $this->tpl->setCurrentBlock("tst_desklink"); $this->ctrl->setParameterByClass(get_class($this->container_gui), 'item_ref_id', $tst_id); $this->ctrl->setParameterByClass(get_class($this->container_gui), 'item_id', $tst_id); $this->ctrl->setParameterByClass(get_class($this->container_gui), 'type', $obj_type); $this->tpl->setVariable("DESK_LINK_TST", $this->ctrl->getLinkTarget($this->container_gui, 'addToDesk')); $this->tpl->setVariable("TXT_DESK_TST", $this->lng->txt("to_desktop")); $this->tpl->parseCurrentBlock(); } } $this->tpl->setCurrentBlock("tst_row"); $this->tpl->setVariable("OBJ_TITLE_TST", $ilObjDataCache->lookupTitle($obj_id)); $this->tpl->setVariable("OBJ_NR_TST", $counter . '.'); // Check if test is assigned to objective include_once 'Modules/Course/classes/class.ilCourseObjectiveQuestion.php'; if ($this->details_id and ilCourseObjectiveQuestion::_isTestAssignedToObjective($tst_id, $this->details_id)) { $this->tpl->setVariable("OBJ_CLASS_CENTER_TST", 'option_value_center_details'); $this->tpl->setVariable("OBJ_CLASS_TST", 'option_value_details'); } else { $this->tpl->setVariable("OBJ_CLASS_CENTER_TST", 'option_value_center'); $this->tpl->setVariable("OBJ_CLASS_TST", 'option_value'); } $this->tpl->parseCurrentBlock(); ++$counter; } }