57        $this->tabs = 
$DIC->tabs();
 
   58        $this->access = 
$DIC->access();
 
   59        $this->
user = $DIC->user();
 
   61        $this->ctrl = 
$DIC->ctrl();
 
   62        $this->toolbar = 
$DIC->toolbar();
 
   65        $this->logger = 
$DIC->logger()->crs();
 
   68        parent::__construct($a_container_gui);
 
  124        include_once 
'Services/Object/classes/class.ilObjectListGUIFactory.php';
 
  126        $tpl = 
new ilTemplate(
"tpl.container_page.html", 
true, 
true, 
"Services/Container");
 
  128        if ($ilAccess->checkAccess(
'write', 
'', $this->getContainerObject()->getRefId())) {
 
  130            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
 
  132                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  134                $ilToolbar->addButton(
 
  135                    $lng->txt(
'crs_reset_results'),
 
  150        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  155        if (!$is_manage && !$is_order) {
 
  165            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
 
  168            include_once 
'./Modules/Test/classes/class.ilObjTestAccess.php';
 
  172                $this->loc_settings->getInitialTest() &&
 
  173                $this->loc_settings->isGeneralInitialTestVisible() &&
 
  174                !$this->loc_settings->isInitialTestStart() &&
 
  177                $this->output_html .= $this->
renderTest($this->loc_settings->getInitialTest(), 
null, 
true, 
true);
 
  179                $this->loc_settings->getQualifiedTest() &&
 
  180                $this->loc_settings->isGeneralQualifiedTestVisible()
 
  182                $this->output_html .= $this->
renderTest($this->loc_settings->getQualifiedTest(), 
null, 
false, 
true);
 
  191        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  194            $ilAccess->checkAccess(
'write', 
'', $this->getContainerObject()->getRefId())
 
  197                if (!$is_manage && !$is_order) {
 
  203        $tpl->setVariable(
'CONTAINER_PAGE_CONTENT', $this->output_html);
 
  220        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
 
  226        $info_tpl = 
new ilTemplate(
'tpl.crs_objectives_view_info_table.html', 
true, 
true, 
'Modules/Course');
 
  227        $info_tpl->setVariable(
"INFO_STRING", 
$lng->txt(
'crs_objectives_info_' . $status));
 
  229        $this->output_html .= $info_tpl->get();
 
  248        $has_container_page = 
false;
 
  252                $has_container_page = 
true;
 
  259        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
  264        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveListGUI.php');
 
  266        $this->objective_list_gui->setContainerObject($this->
getContainerGUI());
 
  267        if (
$ilSetting->get(
"icon_position_in_lists") == 
"item_rows") {
 
  268            $this->objective_list_gui->enableIcon(
true);
 
  273            include_once 
"Services/Accordion/classes/class.ilAccordionGUI.php";
 
  275            $acc->setUseSessionStorage(
true);
 
  276            $acc->setAllowMultiOpened(
true);
 
  278            $acc->setId(
"crsobjtv_" . $this->container_obj->getId());
 
  280            $this->renderer->addCustomBlock(
'lobj', 
$lng->txt(
'crs_objectives'));
 
  287        $has_lo_page = 
false;
 
  289        foreach ($objective_ids as $objective_id) {
 
  290            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
 
  294                    !isset($lur_data[$objective_id]) or
 
  296                        $this->container_obj->getId(),
 
  305            if (
$html = $this->
renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id])) {
 
  306                $this->renderer->addItemToBlock(
'lobj', 
'lobj', $objective_id, 
$html);
 
  312        if (!$a_is_order && $obj_cnt > 1) {
 
  313            $this->
showButton(
"", 
$lng->txt(
"crs_show_all_obj"), 
"", 
"crs_show_all_obj_btn");
 
  314            $this->
showButton(
"", 
$lng->txt(
"crs_hide_all_obj"), 
"", 
"crs_hide_all_obj_btn");
 
  315            $acc->setShowAllElement(
"crs_show_all_obj_btn");
 
  316            $acc->setHideAllElement(
"crs_hide_all_obj_btn");
 
  319        if (!$has_container_page && $has_lo_page) {
 
  321            include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  323                "LOCATION_CONTENT_STYLESHEET",
 
  326            $tpl->setCurrentBlock(
"SyntaxStyle");
 
  328                "LOCATION_SYNTAX_STYLESHEET",
 
  331            $tpl->parseCurrentBlock();
 
  338            $this->output_html .= 
$output_html . $this->renderer->getHTML();
 
  340            $this->renderer->resetDetails();
 
  344            $this->output_html .= 
"<div class='ilCrsObjAcc'>" . $acc->getHTML() . 
"</div>";
 
  376    protected function renderTest($a_test_ref_id, $a_objective_id, $a_is_initial = 
false, $a_add_border = 
false, $a_lo_result = array())
 
  383        if ($a_test_ref_id) {
 
  384            $node_data = 
$tree->getNodeData($a_test_ref_id);
 
  386        if (!$node_data[
'child']) {
 
  391        if ($a_objective_id) {
 
  397            $node_data[
'objective_id'] = $a_objective_id;
 
  398            $node_data[
'objective_status'] =
 
  412                            ? $this->lng->txt(
'crs_loc_itest_info')
 
  413                            : $this->lng->txt(
'crs_loc_qtest_info')
 
  417            $node_data[
'objective_id'] = 0;
 
  420        $node_data[
'title'] = 
$title;
 
  422        return "<div class='ilContObjectivesViewTestItem'>" . $this->
renderItem($node_data) . 
"</div>";
 
  432    public function showMaterials($a_tpl, $a_mode = 
null, $a_is_manage = 
false, $a_as_accordion = 
false)
 
  439        if (is_array($this->items[
"_all"])) {
 
  446            foreach ($this->items[
"_all"] as $k => $item_data) {
 
  447                if ($a_mode == self::MATERIALS_TESTS and $item_data[
'type'] != 
'tst') {
 
  450                if ($item_data[
'type'] == 
'itgr') {
 
  455                    include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  456                    include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  463                if ($this->rendered_items[$item_data[
"child"]] !== 
true &&
 
  464                    !$this->renderer->hasItem($item_data[
"child"])) {
 
  465                    $this->rendered_items[$item_data[
'child']] = 
true;
 
  468                    $html = $this->
renderItem($item_data, $position++, $a_mode == self::MATERIALS_TESTS ? 
false : 
true);
 
  470                        $item_r[] = array(
"html" => 
$html, 
"id" => $item_data[
"child"], 
"type" => $item_data[
"type"]);
 
  476            if (count($item_r) > 0) {
 
  477                if (!$a_as_accordion) {
 
  483                            $this->renderer->addTypeBlock($block_id);
 
  488                            $this->renderer->addCustomBlock($block_id, 
$lng->txt(
'crs_other_resources'));
 
  494                            $this->renderer->addCustomBlock($block_id, 
$lng->txt(
'content'));
 
  499                    if ($a_mode != self::MATERIALS_TESTS) {
 
  503                    foreach ($item_r as 
$h) {
 
  504                        if (!$this->renderer->hasItem(
$h[
"id"])) {
 
  505                            $this->renderer->addItemToBlock($block_id, 
$h[
"type"], 
$h[
"id"], 
$h[
"html"]);
 
  509                    $this->output_html .= $this->renderer->getHTML();
 
  517                            $txt = 
$lng->txt(
'crs_other_resources');
 
  521                    include_once 
"Services/Accordion/classes/class.ilAccordionGUI.php";
 
  523                    $acc->setId(
"crsobjtvmat" . $a_mode . 
"_" . $this->container_obj->getId());
 
  525                    $acc_content = array();
 
  526                    foreach ($item_r as 
$h) {
 
  527                        $acc_content[] = 
$h[
"html"];
 
  531                    $this->output_html .= $acc->getHTML();
 
  539        $objective_map = array();
 
  540        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
  544            include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  545            foreach ($objective_ids as $objective_id) {
 
  547                    $objective_map[
"material"][$mat_ref_id][] = $objective_id;
 
  549                    if (!isset($objective_map[
"names"][$objective_id])) {
 
  551                        $objective_map[
"names"][$objective_id] = $objective->getTitle();
 
  557            $tst = $this->loc_settings->getInitialTest();
 
  559                $objective_map[
"test_i"] = $tst;
 
  561            $tst = $this->loc_settings->getQualifiedTest();
 
  563                $objective_map[
"test_q"] = $tst;
 
  567            include_once 
'Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  568            include_once 
'Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  572                $objective_map[
"test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = 
$title;
 
  576                $objective_map[
"test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = 
$title;
 
  580        return $objective_map;
 
  589        $item_ref_id = $a_item[
"ref_id"];
 
  591        if (is_array($this->objective_map)) {
 
  593            if (isset($this->objective_map[
"material"][$item_ref_id])) {
 
  595                foreach ($this->objective_map[
"material"][$item_ref_id] as $objective_id) {
 
  596                    $ilCtrl->setParameterByClass(
'ilcourseobjectivesgui', 
'objective_id', $objective_id);
 
  597                    $url = 
$ilCtrl->getLinkTargetByClass(array(
'illoeditorgui', 
'ilcourseobjectivesgui'), 
'edit');
 
  598                    $ilCtrl->setParameterByClass(
'ilcourseobjectivesgui', 
'objective_id', 
'');
 
  601                        'desc' => 
$lng->txt(
'crs_loc_tab_materials') . 
': ',
 
  604                        'name' => $this->objective_map[
"names"][$objective_id]
 
  608            if ($this->objective_map[
"test_i"] == $item_ref_id) {
 
  609                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 1);
 
  613                    'link' => 
$ilCtrl->getLinkTargetByClass(
'illoeditorgui', 
'testOverview'),
 
  614                    'name' => 
$lng->txt(
'crs_loc_tab_itest')
 
  616                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 0);
 
  618            if ($this->objective_map[
"test_q"] == $item_ref_id) {
 
  619                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 2);
 
  623                    'link' => 
$ilCtrl->getLinkTargetByClass(
'illoeditorgui', 
'testOverview'),
 
  624                    'name' => 
$lng->txt(
'crs_loc_tab_qtest')
 
  626                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 0);
 
  630            if (is_array($this->objective_map[
"test_ass"][$item_ref_id])) {
 
  631                foreach ($this->objective_map[
"test_ass"][$item_ref_id] as 
$type => $items) {
 
  633                        $caption = 
$lng->txt(
'crs_loc_tab_itest');
 
  634                        $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 1);
 
  636                        $caption = 
$lng->txt(
'crs_loc_tab_qtest');
 
  637                        $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 2);
 
  639                    foreach ($items as $objtv_title) {
 
  643                            'link' => 
$ilCtrl->getLinkTargetByClass(
'illoeditorgui', 
'testsOverview'),
 
  644                            'name' => $caption . 
" (" . $this->lng->txt(
"crs_loc_learning_objective") . 
": " . $objtv_title . 
")" 
  647                    $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 0);
 
  651            if (
sizeof($details)) {
 
  670        if ($a_item[
'objective_id']) {
 
  674            if ($this->loc_settings->getQualifiedTest() == $a_item[
'ref_id']) {
 
  677                include_once 
'./Services/Conditions/classes/class.ilConditionHandler.php';
 
  679                if (!$fullfilled || $a_item[
'objective_status']) {
 
  683            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
 
  687                $a_item[
'objective_id'],
 
  693            if (
$res[
'is_final']) {
 
  697                    $this->lng->txt(
'crs_loc_passes_reached'),
 
  701            } elseif ($this->loc_settings->getQualifiedTest() == $a_item[
'ref_id']) {
 
  702                include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
  708                        $this->lng->txt(
'crs_loc_passes_left'),
 
  709                        (($poss_pass - 
$res[
'tries']) > 0) ? ($poss_pass - 
$res[
'tries']) : 1,
 
  717    protected function updateResult($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
 
  719        if ($this->loc_settings->getQualifiedTest() == $a_item_ref_id) {
 
  721            include_once 
'./Modules/Test/classes/class.ilObjTest.php';
 
  722            include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  729                include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
 
  735                    ($a_res[
'tries'] > 0) ? --$a_res[
'tries'] : 0;
 
  736                    $a_res[
'is_final'] = 0;
 
  758        include_once(
'./Modules/Course/classes/class.ilCourseObjective.php');
 
  761        include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
 
  762        include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
 
  768        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  773        foreach ($objectives_lm_obj->getMaterials() as $item) {
 
  774            $sort_map[$item[
"lm_ass_id"]] = $item[
"position"];
 
  780        $sort_content = array();
 
  782        foreach ($items as $item) {
 
  788            $item_list_gui2->enableIcon(
true);
 
  790            if ($is_order || $a_accordion) {
 
  791                $item_list_gui2->enableCommands(
true, 
true);
 
  792                $item_list_gui2->enableProperties(
false);
 
  795            $chapters = $objectives_lm_obj->getChapters();
 
  796            if (count($chapters)) {
 
  797                $has_sections = 
false;
 
  798                foreach ($chapters as $chapter) {
 
  799                    if ($chapter[
'ref_id'] != $item[
'child']) {
 
  802                    $has_sections = 
true;
 
  804                    include_once 
'./Modules/LearningModule/classes/class.ilLMObject.php';
 
  807                        " (" . 
$lng->txt(
'obj_' . $chapter[
'type']) . 
")";
 
  809                    $item_list_gui2->setDefaultCommandParameters(array(
 
  810                        "obj_id" => $chapter[
'obj_id'],
 
  811                        "focus_id" => $chapter[
'obj_id'],
 
  812                        "focus_return" => $this->container_obj->getRefId()));
 
  815                        $item_list_gui2->setPositionInputField(
 
  816                            "[lobj][" . $a_objective_id . 
"][" . $chapter[
'lm_ass_id'] . 
"]",
 
  817                            sprintf(
'%d', $chapter[
'position'] * 10)
 
  821                    $sub_item_html = $item_list_gui2->getListItemHTML(
 
  829                    $sort_key = str_pad($chapter[
'position'], 5, 0, STR_PAD_LEFT) . 
"_" . strtolower(
$title) . 
"_" . $chapter[
'lm_ass_id'];
 
  830                    $sort_content[$sort_key] = $sub_item_html;
 
  834            $this->rendered_items[$item[
'child']] = 
true;
 
  836            if ($lm_ass_id = $objectives_lm_obj->isAssigned($item[
'ref_id'], 
true)) {
 
  838                    $item_list_gui2->setPositionInputField(
 
  839                        "[lobj][" . $a_objective_id . 
"][" . $lm_ass_id . 
"]",
 
  840                        sprintf(
'%d', $sort_map[$lm_ass_id] * 10)
 
  844                $sub_item_html = $item_list_gui2->getListItemHTML(
 
  852                $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . 
"_" . strtolower($item[
'title']) . 
"_" . $lm_ass_id;
 
  853                $sort_content[$sort_key] = $sub_item_html;
 
  858            $this->objective_list_gui->enableCommands(
false);
 
  860            $this->objective_list_gui->enableCommands(
true);
 
  864            $this->objective_list_gui->setPositionInputField(
 
  865                "[lobj][" . $a_objective_id . 
"][0]",
 
  866                $objective->__getPosition() * 10
 
  870        ksort($sort_content);
 
  873            foreach ($sort_content as $sub_item_html) {
 
  874                $this->objective_list_gui->addSubItemHTML($sub_item_html);
 
  877            return $this->objective_list_gui->getObjectiveListItemHTML(
 
  880                $objective->getTitle(),
 
  881                $objective->getDescription(),
 
  882                ($is_manage || $is_order)
 
  885            $acc_content = $sort_content;
 
  887            $initial_shown = 
false;
 
  890            include_once 
'./Modules/Test/classes/class.ilObjTestAccess.php';
 
  893                $initial_test_obj_id &&
 
  904                $initial_shown = 
true;
 
  905            } elseif ($this->
getSettings()->hasSeparateQualifiedTests()) {
 
  933            include_once(
"./Services/COPage/classes/class.ilPageUtil.php");
 
  935                $a_has_lo_page = 
true;
 
  937                include_once 
'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
 
  938                $page_gui = 
new ilLOPageGUI($objective->getObjectiveId());
 
  940                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  942                $page_gui->setPresentationTitle(
"");
 
  943                $page_gui->setTemplateOutput(
false);
 
  944                $page_gui->setHeader(
"");
 
  946                $co_page = 
"<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . 
"</div>";
 
  949            $a_accordion->addItem(
 
  953                (isset(
$_GET[
"oobj"]) && (
int) 
$_GET[
"oobj"] == $objective->getObjectiveId())
 
  975        include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  989        include_once 
"Modules/Course/classes/Objectives/class.ilLOTestAssignments.php";
 
  992        include_once 
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
 
  994        foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
 
 1010            $result[
"initial_status"] = $initial_status;
 
 1037        $a_perc_result = 
null,
 
 1038        $a_perc_limit = 
null,
 
 1044        $a_next_step = 
null,
 
 1050        $tpl = 
new ilTemplate(
"tpl.objective_progressbar.html", 
true, 
true, 
"Services/Container");
 
 1052        if ($a_perc_result !== 
null) {
 
 1053            $tpl->setCurrentBlock(
"statusbar_bl");
 
 1054            $tpl->setVariable(
"PERC_STATUS", $a_perc_result);
 
 1055            $tpl->setVariable(
"PERC_WIDTH", $a_perc_result);
 
 1056            $tpl->setVariable(
"PERC_COLOR", $a_css);
 
 1057            if ($a_perc_limit) {
 
 1059                $limit_pos = (99 - (int) $a_perc_limit) * -1;
 
 1060                $tpl->setVariable(
"LIMIT_POS", $limit_pos);
 
 1064                $tpl->setVariable(
"TT_ID", $a_tt_id);
 
 1066            $tpl->parseCurrentBlock();
 
 1071                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1073                $button->setCaption($a_caption, 
false);
 
 1074                $button->setUrl($a_url);
 
 1076                $tpl->setCurrentBlock(
"statustxt_bl");
 
 1077                $tpl->setVariable(
"TXT_PROGRESS_STATUS", $button->render());
 
 1078                $tpl->parseCurrentBlock();
 
 1080                $tpl->setCurrentBlock(
"statustxt_no_link_bl");
 
 1081                $tpl->setVariable(
"TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
 
 1082                $tpl->parseCurrentBlock();
 
 1088            $tpl->setCurrentBlock(
"nstep_bl");
 
 1089            $tpl->setVariable(
"TXT_NEXT_STEP", $a_next_step);
 
 1090            $tpl->parseCurrentBlock();
 
 1095            include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
 
 1100            $tpl->setVariable(
"SUB_STYLE", 
' style="padding-left: ' . $a_sub_style . 
'px;"');
 
 1101            $tpl->setVariable(
"SUB_INIT", $a_sub);
 
 1125        $a_perc_result = 
null,
 
 1126        $a_perc_limit = 
null,
 
 1127        $a_compare_value = 
null,
 
 1132        $a_next_step = 
null,
 
 1136        $a_required_text = 
'' 
 1140        $tpl = 
new ilTemplate(
"tpl.objective_progressmeter.html", 
true, 
true, 
"Services/Container");
 
 1143        $lng->loadLanguageModule(
'crs');
 
 1147        if (is_numeric($a_perc_result)) {
 
 1148            $uiFactory = 
$DIC->ui()->factory();
 
 1149            $uiRenderer = 
$DIC->ui()->renderer();
 
 1159            $pMeter = $uiFactory->chart()->progressMeter()->standard(
 
 1161                (
int) $a_perc_result,
 
 1162                (
int) $a_perc_limit,
 
 1163                (
int) $a_compare_value
 
 1166            if (strlen($a_main_text)) {
 
 1167                #$pMeter = $pMeter->withMainText($a_main_text); 
 1169            if (strlen($a_required_text)) {
 
 1170                #$pMeter = $pMeter->withRequiredText($a_required_text); 
 1172            $tpl->setVariable(
'PROGRESS_METER', $uiRenderer->render($pMeter));
 
 1200            include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
 
 1205            $tpl->setVariable(
"SUB_STYLE", 
' style="padding-left: ' . $a_sub_style . 
'px;"');
 
 1206            $tpl->setVariable(
"SUB_INIT", $a_sub);
 
 1225        $lng->loadLanguageModule(
'crs');
 
 1229        $is_qualified_initial =
 
 1237        $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = 
null;
 
 1241            $is_qualified_initial) {
 
 1242            if ($has_completed) {
 
 1243                $next_step = 
$lng->txt(
"crs_loc_progress_objective_complete");
 
 1245                $next_step = 
$lng->txt(
"crs_loc_progress_do_qualifying_again");
 
 1250            if ($a_lo_result[
"status"]) {
 
 1253                        $lng->txt(
"crs_loc_progress_do_qualifying") :
 
 1254                        $lng->txt(
"crs_loc_suggested");
 
 1256                $next_step = (bool) $a_has_initial_test ?
 
 1257                    $lng->txt(
"crs_loc_progress_no_result_do_initial") :
 
 1258                    $lng->txt(
"crs_loc_progress_no_result_no_initial");
 
 1275    public static function buildObjectiveProgressBar($a_has_initial_test, $a_objective_id, array $a_lo_result, $a_list_mode = 
false, $a_sub = 
false, $a_tt_suffix = 
null)
 
 1280        $lng->loadLanguageModule(
'crs');
 
 1284        $tooltip_id = 
"crsobjtvusr_" . $a_objective_id . 
"_" . $a_lo_result[
"type"] . 
"_" . ((int) $a_sub);
 
 1285        if ($a_tt_suffix !== 
null) {
 
 1286            $tooltip_id .= 
"_" . $a_tt_suffix;
 
 1290            $lng->txt(
"crs_loc_tt_info"),
 
 1291            $a_lo_result[
"result_perc"],
 
 1292            $a_lo_result[
"limit_perc"]
 
 1296        include_once 
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
 
 1297        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
 1304        $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = 
null;
 
 1306        $compare_value = 
null;
 
 1308        if ($is_qualified ||
 
 1309            $is_qualified_initial) {
 
 1310            $progress_txt = 
$lng->txt(
"crs_loc_progress_result_qtest");
 
 1311            $tt_txt = 
$lng->txt(
"crs_loc_tab_qtest") . 
": " . $tt_txt;
 
 1313            if ($has_completed) {
 
 1314                $next_step = 
$lng->txt(
"crs_loc_progress_objective_complete");
 
 1315                $bar_color = 
"ilCourseObjectiveProgressBarCompleted";
 
 1318                if ($is_qualified &&
 
 1319                    $a_has_initial_test &&
 
 1320                    is_array($a_lo_result[
"initial"])) {
 
 1321                    $a_lo_result[
"initial"][
"itest"] = $a_lo_result[
"itest"];
 
 1324                    #$initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
 
 1325                    $compare_value = $a_lo_result[
'initial'][
'result_perc'];
 
 1328                $next_step = 
$lng->txt(
"crs_loc_progress_do_qualifying_again");
 
 1329                $bar_color = 
"ilCourseObjectiveProgressBarFailed";
 
 1334            if ($a_lo_result[
"status"]) {
 
 1335                $progress_txt = 
$lng->txt(
"crs_loc_progress_result_itest");
 
 1336                $tt_txt = 
$lng->txt(
"crs_loc_tab_itest") . 
": " . $tt_txt;
 
 1338                $bar_color = 
"ilCourseObjectiveProgressBarNeutral";
 
 1339                $next_step = $has_completed
 
 1340                    ? 
$lng->txt(
"crs_loc_progress_do_qualifying")
 
 1341                    : 
$lng->txt(
"crs_loc_suggested");
 
 1345                $next_step = (bool) $a_has_initial_test
 
 1346                    ? 
$lng->txt(
"crs_loc_progress_no_result_do_initial")
 
 1347                    : 
$lng->txt(
"crs_loc_progress_no_result_no_initial");
 
 1353        if ($a_lo_result[
"qtest"]) {
 
 1357        if (!$test_url && $a_lo_result[
"itest"]) {
 
 1361        $main_text = 
$lng->txt(
'crs_loc_itest_info');
 
 1363            $main_text = 
$lng->txt(
'crs_loc_qtest_info');
 
 1369            $a_lo_result[
"result_perc"],
 
 1370            $a_lo_result[
"limit_perc"],
 
 1384            $lng->txt(
'crs_lobj_pm_min_goal')
 
 1399        $ui_factory = 
$DIC->ui()->factory();
 
 1401        $tpl = 
new ilTemplate(
"tpl.objective_accordion_title.html", 
true, 
true, 
"Services/Container");
 
 1406                self::buildObjectiveProgressBar(
 
 1407                    (
bool) $this->loc_settings->worksWithInitialTest(),
 
 1414        $tpl->setVariable(
"TITLE", $this->lng->txt(
"crs_loc_learning_objective") . 
": " . trim($a_objective->
getTitle()));
 
 1417        $this->logger->dump($a_lo_result);
 
 1419        $initial_res = 
null;
 
 1420        $initial_lim = 
null;
 
 1421        if ($this->loc_settings->worksWithInitialTest()) {
 
 1422            if (array_key_exists(
'initial', $a_lo_result)) {
 
 1423                $initial_res = (int) $a_lo_result[
'initial'][
'result_perc'];
 
 1424                $initial_lim = (int) $a_lo_result[
'initial'][
'limit_perc'];
 
 1428                isset($a_lo_result[
'result_perc'])
 
 1430                $initial_res = (int) $a_lo_result[
'result_perc'];
 
 1431                $initial_lim = (int) $a_lo_result[
'limit_perc'];
 
 1435        if ($initial_res !== 
null) {
 
 1437                $a_lo_result[
"itest"],
 
 1438                $a_lo_result[
"user_id"]
 
 1441            if (strlen($link)) {
 
 1442                $tpl->setCurrentBlock(
'i_with_link');
 
 1446                        $ui_factory->button()->shy(
 
 1447                            $this->lng->txt(
'crs_objective_result_details'),
 
 1452                $tpl->parseCurrentBlock();
 
 1456            $tpl->setCurrentBlock(
'res_initial');
 
 1460                    $this->lng->txt(
'crs_objective_result_summary_initial'),
 
 1461                    (
int) $initial_res . 
'%',
 
 1462                    (
int) $initial_lim . 
'%' 
 1465            $tpl->parseCurrentBlock();
 
 1472            $qual_res = (int) $a_lo_result[
'result_perc'];
 
 1473            $qual_lim = (int) $a_lo_result[
'limit_perc'];
 
 1476        if ($qual_res !== 
null) {
 
 1478                $a_lo_result[
"qtest"],
 
 1479                $a_lo_result[
"user_id"]
 
 1482            if (strlen($link)) {
 
 1483                $tpl->setCurrentBlock(
'q_with_link');
 
 1487                        $ui_factory->button()->shy(
 
 1488                            $this->lng->txt(
'crs_objective_result_details'),
 
 1493                $tpl->parseCurrentBlock();
 
 1495            $tpl->setCurrentBlock(
'res_qualifying');
 
 1499                    $this->lng->txt(
'crs_objective_result_summary_qualifying'),
 
 1500                    (
int) $qual_res . 
'%',
 
 1501                    (
int) $qual_lim . 
'%' 
 1504            $tpl->parseCurrentBlock();
 
 1507        $this->logger->dump($a_lo_result);
 
 1511            (
bool) $this->loc_settings->worksWithInitialTest(),
 
 1516            $tpl->setCurrentBlock(
'objective_summary');
 
 1518            $tpl->parseCurrentBlock();
 
 1529        $tpl = 
new ilTemplate(
"tpl.objective_accordion_content.html", 
true, 
true, 
"Services/Container");
 
 1530        foreach ($a_items as $item) {
 
 1531            $tpl->setCurrentBlock(
"items_bl");
 
 1532            $tpl->setVariable(
"ITEM", $item);
 
 1533            $tpl->parseCurrentBlock();
 
 1545    protected function showButton($a_cmd, $a_text, $a_target = 
'', $a_id = 
"")
 
 1551        $ilToolbar->addButton(
 
 1553            $ilCtrl->getLinkTarget($this->getContainerGUI(), $a_cmd),
 
An exception for terminatinating execution or to throw for unit testing.
const IL_OBJECTIVE_STATUS_EMPTY
Accordion user interface class.
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
Parent class of all container content GUIs.
initRenderer()
Init container renderer.
getContainerObject()
Get container object.
getContainerGUI()
Get container GUI object.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
clearAdminCommandsDetermination()
cleaer administration commands determination
GUI class for course objective view.
renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion=null, array $a_lo_result=null)
render objective
parseLOUserResults()
Parse learning objective results.
static renderProgressMeter( $a_perc_result=null, $a_perc_limit=null, $a_compare_value=null, $a_caption=null, $a_url=null, $a_tt_id=null, $a_tt_txt=null, $a_next_step=null, $a_sub=false, $a_sub_style=30, $a_main_text='', $a_required_text='')
Render progress bar(s)
buildAccordionTitle(ilCourseObjective $a_objective, array $a_lo_result=null)
showButton($a_cmd, $a_text, $a_target='', $a_id="")
show action button
static buildObjectiveProgressBar($a_has_initial_test, $a_objective_id, array $a_lo_result, $a_list_mode=false, $a_sub=false, $a_tt_suffix=null)
Render progressbar(s) for given objective and result data.
addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item)
addFooterRow()
add footer row
static renderProgressBar( $a_perc_result=null, $a_perc_limit=null, $a_css=null, $a_caption=null, $a_url=null, $a_tt_id=null, $a_tt_txt=null, $a_next_step=null, $a_sub=false, $a_sub_style=30)
Render progress bar(s)
buildAccordionContent(array $a_items)
__construct($a_container_gui)
Constructor.
getDetailsLevel($a_objective_id)
get details level
updateResult($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
showMaterials($a_tpl, $a_mode=null, $a_is_manage=false, $a_as_accordion=false)
Show all other (no assigned tests, no assigned materials) materials.
renderTest($a_test_ref_id, $a_objective_id, $a_is_initial=false, $a_add_border=false, $a_lo_result=array())
showObjectives($a_tpl, $a_is_order=false)
show objectives
getMainContent()
Impementation of abstract method getMainContent.
showStatus($tpl)
show status
static getObjectiveResultSummary($a_has_initial_test, $a_objective_id, $a_lo_result)
Get objective result summary.
initDetails()
init details
getTestAssignments()
Get test assignments object.
List gui for course objectives.
class ilCourseObjectiveMaterials
static _getAssignedMaterials($a_objective_id)
get assigned materials
static getStatus($a_usr_id, $a_crs_id)
get status of user
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
static lookupMaxPasses($a_objective_id)
static _getObjectiveIds($course_id, $a_activated_only=false)
static _lookupTitle($a_obj_id)
Lookup title.
(Course) learning objective page GUI class
const TYPE_TEST_QUALIFIED
const TYPE_TEST_UNDEFINED
static getInstanceByObjId($a_obj_id)
get singleton instance
static getInstance($a_container_id)
Get instance by container id.
static lookupRunExistsForObjective($a_test_id, $a_objective_id, $a_user_id)
@global type $ilDB
static hasResults($a_container_id, $a_user_id)
static lookupResult($a_course_obj_id, $a_user_id, $a_objective_id, $a_tst_type)
Lookup user result.
static hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
static getTestResultLinkForUser($a_test_ref_id, $a_user_id)
static getSyntaxStylePath()
get syntax style path
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static isParticipantsLastPassActive($testRefId, $userId)
static getItemsByObjective($a_objective_id)
Get objective items.
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
enableCommands($a_status, $a_std_only=false)
En/disable commands.
setDefaultCommandParameters(array $a_params)
enableProperties($a_status)
En/disable properties.
disableTitleLink($a_status)
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
addCustomProperty( $a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
special template class to simplify handling of ITX/PEAR
foreach($_POST as $key=> $value) $res