56        $this->tabs = 
$DIC->tabs();
 
   57        $this->access = 
$DIC->access();
 
   58        $this->
user = $DIC->user();
 
   60        $this->ctrl = 
$DIC->ctrl();
 
   61        $this->toolbar = 
$DIC->toolbar();
 
   63        $this->logger = 
$DIC->logger()->crs();
 
  122        include_once 
'Services/Object/classes/class.ilObjectListGUIFactory.php';
 
  124        $tpl = 
new ilTemplate(
"tpl.container_page.html", 
true, 
true, 
"Services/Container");
 
  126        if ($ilAccess->checkAccess(
'write', 
'', $this->getContainerObject()->getRefId())) {
 
  128            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
 
  130                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  132                $ilToolbar->addButton(
 
  133                    $lng->txt(
'crs_reset_results'),
 
  134                    $ilCtrl->getLinkTargetByClass(get_class($this->
getContainerGUI()), 
'reset')
 
  148        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  153        if (!$is_manage && !$is_order) {
 
  163            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
 
  166            include_once 
'./Modules/Test/classes/class.ilObjTestAccess.php';
 
  170                $this->loc_settings->getInitialTest() &&
 
  171                $this->loc_settings->isGeneralInitialTestVisible() &&
 
  172                !$this->loc_settings->isInitialTestStart() &&
 
  175                $this->output_html .= $this->
renderTest($this->loc_settings->getInitialTest(), 
null, 
true, 
true);
 
  177                $this->loc_settings->getQualifiedTest() &&
 
  178                $this->loc_settings->isGeneralQualifiedTestVisible()
 
  180                $this->output_html .= $this->
renderTest($this->loc_settings->getQualifiedTest(), 
null, 
false, 
true);
 
  189        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  192            $ilAccess->checkAccess(
'write', 
'', $this->getContainerObject()->getRefId())
 
  195                if (!$is_manage && !$is_order) {
 
  201        $tpl->setVariable(
'CONTAINER_PAGE_CONTENT', $this->output_html);
 
  218        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
 
  224        $info_tpl = 
new ilTemplate(
'tpl.crs_objectives_view_info_table.html', 
true, 
true, 
'Modules/Course');
 
  225        $info_tpl->setVariable(
"INFO_STRING", 
$lng->txt(
'crs_objectives_info_' . $status));
 
  227        $this->output_html .= $info_tpl->get();
 
  246        $has_container_page = 
false;
 
  250                $has_container_page = 
true;
 
  257        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
  262        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveListGUI.php');
 
  264        $this->objective_list_gui->setContainerObject($this->
getContainerGUI());
 
  265        if (
$ilSetting->get(
"icon_position_in_lists") == 
"item_rows") {
 
  266            $this->objective_list_gui->enableIcon(
true);
 
  271            include_once 
"Services/Accordion/classes/class.ilAccordionGUI.php";
 
  273            $acc->setUseSessionStorage(
true);
 
  274            $acc->setAllowMultiOpened(
true);
 
  276            $acc->setId(
"crsobjtv_" . $this->container_obj->getId());
 
  278            $this->renderer->addCustomBlock(
'lobj', 
$lng->txt(
'crs_objectives'));
 
  285        $has_lo_page = 
false;
 
  287        foreach ($objective_ids as $objective_id) {
 
  288            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
 
  292                    !isset($lur_data[$objective_id]) or
 
  294                        $this->container_obj->getId(),
 
  303            if ($html = $this->
renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id])) {
 
  304                $this->renderer->addItemToBlock(
'lobj', 
'lobj', $objective_id, $html);
 
  310        if (!$a_is_order && $obj_cnt > 1) {
 
  311            $this->
showButton(
"", 
$lng->txt(
"crs_show_all_obj"), 
"", 
"crs_show_all_obj_btn");
 
  312            $this->
showButton(
"", 
$lng->txt(
"crs_hide_all_obj"), 
"", 
"crs_hide_all_obj_btn");
 
  313            $acc->setShowAllElement(
"crs_show_all_obj_btn");
 
  314            $acc->setHideAllElement(
"crs_hide_all_obj_btn");
 
  317        if (!$has_container_page && $has_lo_page) {
 
  319            include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  321                "LOCATION_CONTENT_STYLESHEET",
 
  324            $tpl->setCurrentBlock(
"SyntaxStyle");
 
  326                "LOCATION_SYNTAX_STYLESHEET",
 
  329            $tpl->parseCurrentBlock();
 
  336            $this->output_html .= 
$output_html . $this->renderer->getHTML();
 
  338            $this->renderer->resetDetails();
 
  342            $this->output_html .= 
"<div class='ilCrsObjAcc'>" . $acc->getHTML() . 
"</div>";
 
  374    protected function renderTest($a_test_ref_id, $a_objective_id, $a_is_initial = 
false, $a_add_border = 
false, $a_lo_result = array())
 
  378        $tree = 
$DIC->repositoryTree();
 
  381        if ($a_test_ref_id) {
 
  382            $node_data = $tree->getNodeData($a_test_ref_id);
 
  384        if (!$node_data[
'child']) {
 
  389        if ($a_objective_id) {
 
  395            $node_data[
'objective_id'] = $a_objective_id;
 
  396            $node_data[
'objective_status'] =
 
  410                            ? $this->lng->txt(
'crs_loc_itest_info')
 
  411                            : $this->lng->txt(
'crs_loc_qtest_info')
 
  415            $node_data[
'objective_id'] = 0;
 
  418        $node_data[
'title'] = $title;
 
  420        return "<div class='ilContObjectivesViewTestItem'>" . $this->
renderItem($node_data) . 
"</div>";
 
  430    public function showMaterials($a_tpl, $a_mode = 
null, $a_is_manage = 
false, $a_as_accordion = 
false)
 
  437        if (is_array($this->items[
"_all"])) {
 
  444            foreach ($this->items[
"_all"] as $k => $item_data) {
 
  445                if ($a_mode == self::MATERIALS_TESTS and $item_data[
'type'] != 
'tst') {
 
  448                if ($item_data[
'type'] == 
'itgr') {
 
  453                    include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  454                    include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  461                if ($this->rendered_items[$item_data[
"child"]] !== 
true &&
 
  462                    !$this->renderer->hasItem($item_data[
"child"])) {
 
  463                    $this->rendered_items[$item_data[
'child']] = 
true;
 
  466                    $html = $this->
renderItem($item_data, $position++, $a_mode == self::MATERIALS_TESTS ? 
false : 
true);
 
  468                        $item_r[] = array(
"html" => $html, 
"id" => $item_data[
"child"], 
"type" => $item_data[
"type"]);
 
  474            if (count($item_r) > 0) {
 
  475                if (!$a_as_accordion) {
 
  481                            $this->renderer->addTypeBlock($block_id);
 
  486                            $this->renderer->addCustomBlock($block_id, 
$lng->txt(
'crs_other_resources'));
 
  492                            $this->renderer->addCustomBlock($block_id, 
$lng->txt(
'content'));
 
  497                    if ($a_mode != self::MATERIALS_TESTS) {
 
  501                    foreach ($item_r as $h) {
 
  502                        if (!$this->renderer->hasItem($h[
"id"])) {
 
  503                            $this->renderer->addItemToBlock($block_id, $h[
"type"], $h[
"id"], $h[
"html"]);
 
  507                    $this->output_html .= $this->renderer->getHTML();
 
  515                            $txt = 
$lng->txt(
'crs_other_resources');
 
  519                    include_once 
"Services/Accordion/classes/class.ilAccordionGUI.php";
 
  521                    $acc->setId(
"crsobjtvmat" . $a_mode . 
"_" . $this->container_obj->getId());
 
  523                    $acc_content = array();
 
  524                    foreach ($item_r as $h) {
 
  525                        $acc_content[] = $h[
"html"];
 
  529                    $this->output_html .= $acc->getHTML();
 
  537        $objective_map = array();
 
  538        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
  542            include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  543            foreach ($objective_ids as $objective_id) {
 
  545                    $objective_map[
"material"][$mat_ref_id][] = $objective_id;
 
  547                    if (!isset($objective_map[
"names"][$objective_id])) {
 
  549                        $objective_map[
"names"][$objective_id] = $objective->getTitle();
 
  555            $tst = $this->loc_settings->getInitialTest();
 
  557                $objective_map[
"test_i"] = $tst;
 
  559            $tst = $this->loc_settings->getQualifiedTest();
 
  561                $objective_map[
"test_q"] = $tst;
 
  565            include_once 
'Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  566            include_once 
'Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  570                $objective_map[
"test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
 
  574                $objective_map[
"test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
 
  578        return $objective_map;
 
  587        $item_ref_id = $a_item[
"ref_id"];
 
  589        if (is_array($this->objective_map)) {
 
  591            if (isset($this->objective_map[
"material"][$item_ref_id])) {
 
  593                foreach ($this->objective_map[
"material"][$item_ref_id] as $objective_id) {
 
  594                    $ilCtrl->setParameterByClass(
'ilcourseobjectivesgui', 
'objective_id', $objective_id);
 
  595                    $url = $ilCtrl->getLinkTargetByClass(array(
'illoeditorgui', 
'ilcourseobjectivesgui'), 
'edit');
 
  596                    $ilCtrl->setParameterByClass(
'ilcourseobjectivesgui', 
'objective_id', 
'');
 
  599                        'desc' => 
$lng->txt(
'crs_loc_tab_materials') . 
': ',
 
  602                        'name' => $this->objective_map[
"names"][$objective_id]
 
  606            if ($this->objective_map[
"test_i"] == $item_ref_id) {
 
  607                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 1);
 
  611                    'link' => $ilCtrl->getLinkTargetByClass(
'illoeditorgui', 
'testOverview'),
 
  612                    'name' => 
$lng->txt(
'crs_loc_tab_itest')
 
  614                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 0);
 
  616            if ($this->objective_map[
"test_q"] == $item_ref_id) {
 
  617                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 2);
 
  621                    'link' => $ilCtrl->getLinkTargetByClass(
'illoeditorgui', 
'testOverview'),
 
  622                    'name' => 
$lng->txt(
'crs_loc_tab_qtest')
 
  624                $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 0);
 
  628            if (is_array($this->objective_map[
"test_ass"][$item_ref_id])) {
 
  629                foreach ($this->objective_map[
"test_ass"][$item_ref_id] as 
$type => $items) {
 
  631                        $caption = 
$lng->txt(
'crs_loc_tab_itest');
 
  632                        $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 1);
 
  634                        $caption = 
$lng->txt(
'crs_loc_tab_qtest');
 
  635                        $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 2);
 
  637                    foreach ($items as $objtv_title) {
 
  641                            'link' => $ilCtrl->getLinkTargetByClass(
'illoeditorgui', 
'testsOverview'),
 
  642                            'name' => $caption . 
" (" . $this->lng->txt(
"crs_loc_learning_objective") . 
": " . $objtv_title . 
")" 
  645                    $ilCtrl->setParameterByClass(
'illoeditorgui', 
'tt', 0);
 
  649            if (
sizeof($details)) {
 
  668        if ($a_item[
'objective_id']) {
 
  672            if ($this->loc_settings->getQualifiedTest() == $a_item[
'ref_id']) {
 
  675                include_once 
'./Services/Conditions/classes/class.ilConditionHandler.php';
 
  677                if (!$fullfilled || $a_item[
'objective_status']) {
 
  681            include_once 
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
 
  685                $a_item[
'objective_id'],
 
  691            if (
$res[
'is_final']) {
 
  695                    $this->lng->txt(
'crs_loc_passes_reached'),
 
  699            } elseif ($this->loc_settings->getQualifiedTest() == $a_item[
'ref_id']) {
 
  700                include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
  706                        $this->lng->txt(
'crs_loc_passes_left'),
 
  707                        (($poss_pass - 
$res[
'tries']) > 0) ? ($poss_pass - 
$res[
'tries']) : 1,
 
  715    protected function updateResult($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
 
  717        if ($this->loc_settings->getQualifiedTest() == $a_item_ref_id) {
 
  719            include_once 
'./Modules/Test/classes/class.ilObjTest.php';
 
  720            include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
  727                include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
 
  733                    ($a_res[
'tries'] > 0) ? --$a_res[
'tries'] : 0;
 
  734                    $a_res[
'is_final'] = 0;
 
  756        include_once(
'./Modules/Course/classes/class.ilCourseObjective.php');
 
  759        include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
 
  760        include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
 
  766        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  771        foreach ($objectives_lm_obj->getMaterials() as $item) {
 
  772            $sort_map[$item[
"lm_ass_id"]] = $item[
"position"];
 
  778        $sort_content = array();
 
  780        foreach ($items as $item) {
 
  786            $item_list_gui2->enableIcon(
true);
 
  788            if ($is_order || $a_accordion) {
 
  789                $item_list_gui2->enableCommands(
true, 
true);
 
  790                $item_list_gui2->enableProperties(
false);
 
  793            $chapters = $objectives_lm_obj->getChapters();
 
  794            if (count($chapters)) {
 
  795                $has_sections = 
false;
 
  796                foreach ($chapters as $chapter) {
 
  797                    if ($chapter[
'ref_id'] != $item[
'child']) {
 
  800                    $has_sections = 
true;
 
  802                    include_once 
'./Modules/LearningModule/classes/class.ilLMObject.php';
 
  803                    $title = $item[
'title'] .
 
  805                        " (" . 
$lng->txt(
'obj_' . $chapter[
'type']) . 
")";
 
  807                    $item_list_gui2->setDefaultCommandParameters(array(
 
  808                        "obj_id" => $chapter[
'obj_id'],
 
  809                        "focus_id" => $chapter[
'obj_id'],
 
  810                        "focus_return" => $this->container_obj->getRefId()));
 
  813                        $item_list_gui2->setPositionInputField(
 
  814                            "[lobj][" . $a_objective_id . 
"][" . $chapter[
'lm_ass_id'] . 
"]",
 
  815                            sprintf(
'%d', $chapter[
'position'] * 10)
 
  819                    $sub_item_html = $item_list_gui2->getListItemHTML(
 
  827                    $sort_key = str_pad($chapter[
'position'], 5, 0, STR_PAD_LEFT) . 
"_" . strtolower($title) . 
"_" . $chapter[
'lm_ass_id'];
 
  828                    $sort_content[$sort_key] = $sub_item_html;
 
  832            $this->rendered_items[$item[
'child']] = 
true;
 
  834            if ($lm_ass_id = $objectives_lm_obj->isAssigned($item[
'ref_id'], 
true)) {
 
  836                    $item_list_gui2->setPositionInputField(
 
  837                        "[lobj][" . $a_objective_id . 
"][" . $lm_ass_id . 
"]",
 
  838                        sprintf(
'%d', $sort_map[$lm_ass_id] * 10)
 
  842                $sub_item_html = $item_list_gui2->getListItemHTML(
 
  850                $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . 
"_" . strtolower($item[
'title']) . 
"_" . $lm_ass_id;
 
  851                $sort_content[$sort_key] = $sub_item_html;
 
  856            $this->objective_list_gui->enableCommands(
false);
 
  858            $this->objective_list_gui->enableCommands(
true);
 
  862            $this->objective_list_gui->setPositionInputField(
 
  863                "[lobj][" . $a_objective_id . 
"][0]",
 
  864                $objective->__getPosition() * 10
 
  868        ksort($sort_content);
 
  871            foreach ($sort_content as $sub_item_html) {
 
  872                $this->objective_list_gui->addSubItemHTML($sub_item_html);
 
  875            return $this->objective_list_gui->getObjectiveListItemHTML(
 
  878                $objective->getTitle(),
 
  879                $objective->getDescription(),
 
  880                ($is_manage || $is_order)
 
  883            $acc_content = $sort_content;
 
  885            $initial_shown = 
false;
 
  888            include_once 
'./Modules/Test/classes/class.ilObjTestAccess.php';
 
  891                $initial_test_obj_id &&
 
  902                $initial_shown = 
true;
 
  903            } elseif ($this->
getSettings()->hasSeparateQualifiedTests()) {
 
  931            include_once(
"./Services/COPage/classes/class.ilPageUtil.php");
 
  933                $a_has_lo_page = 
true;
 
  935                include_once 
'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
 
  936                $page_gui = 
new ilLOPageGUI($objective->getObjectiveId());
 
  938                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  940                $page_gui->setPresentationTitle(
"");
 
  941                $page_gui->setTemplateOutput(
false);
 
  942                $page_gui->setHeader(
"");
 
  944                $co_page = 
"<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . 
"</div>";
 
  947            $a_accordion->addItem(
 
  951                (isset(
$_GET[
"oobj"]) && (
int) 
$_GET[
"oobj"] == $objective->getObjectiveId())
 
  973        include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  987        include_once 
"Modules/Course/classes/Objectives/class.ilLOTestAssignments.php";
 
  990        include_once 
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
 
  992        foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
 
 1008            $result[
"initial_status"] = $initial_status;
 
 1035        $a_perc_result = 
null,
 
 1036        $a_perc_limit = 
null,
 
 1042        $a_next_step = 
null,
 
 1048        $tpl = 
new ilTemplate(
"tpl.objective_progressbar.html", 
true, 
true, 
"Services/Container");
 
 1050        if ($a_perc_result !== 
null) {
 
 1051            $tpl->setCurrentBlock(
"statusbar_bl");
 
 1052            $tpl->setVariable(
"PERC_STATUS", $a_perc_result);
 
 1053            $tpl->setVariable(
"PERC_WIDTH", $a_perc_result);
 
 1054            $tpl->setVariable(
"PERC_COLOR", $a_css);
 
 1055            if ($a_perc_limit) {
 
 1057                $limit_pos = (99 - (int) $a_perc_limit) * -1;
 
 1058                $tpl->setVariable(
"LIMIT_POS", $limit_pos);
 
 1062                $tpl->setVariable(
"TT_ID", $a_tt_id);
 
 1064            $tpl->parseCurrentBlock();
 
 1069                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1071                $button->setCaption($a_caption, 
false);
 
 1072                $button->setUrl($a_url);
 
 1074                $tpl->setCurrentBlock(
"statustxt_bl");
 
 1075                $tpl->setVariable(
"TXT_PROGRESS_STATUS", $button->render());
 
 1076                $tpl->parseCurrentBlock();
 
 1078                $tpl->setCurrentBlock(
"statustxt_no_link_bl");
 
 1079                $tpl->setVariable(
"TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
 
 1080                $tpl->parseCurrentBlock();
 
 1085            #$tpl->setCurrentBlock("nstep_bl");
 
 1086            $tpl->setVariable(
"TXT_NEXT_STEP", $a_next_step);
 
 1087            #$tpl->parseCurrentBlock(); 
 1092            include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
 
 1097            $tpl->setVariable(
"SUB_STYLE", 
' style="padding-left: ' . $a_sub_style . 
'px;"');
 
 1098            $tpl->setVariable(
"SUB_INIT", $a_sub);
 
 1122        $a_perc_result = 
null,
 
 1123        $a_perc_limit = 
null,
 
 1124        $a_compare_value = 
null,
 
 1129        $a_next_step = 
null,
 
 1133        $a_required_text = 
'' 
 1137        $tpl = 
new ilTemplate(
"tpl.objective_progressmeter.html", 
true, 
true, 
"Services/Container");
 
 1140        $lng->loadLanguageModule(
'crs');
 
 1144        if (is_numeric($a_perc_result)) {
 
 1145            $uiFactory = 
$DIC->ui()->factory();
 
 1146            $uiRenderer = 
$DIC->ui()->renderer();
 
 1148            $pMeter = $uiFactory->chart()->progressMeter()->standard(
 
 1150                (
int) $a_perc_result,
 
 1151                (
int) $a_perc_limit,
 
 1152                (
int) $a_compare_value
 
 1154            if (strlen($a_main_text)) {
 
 1155                #$pMeter = $pMeter->withMainText($a_main_text); 
 1157                        if (strlen($a_required_text)) {
 
 1158                            #$pMeter = $pMeter->withRequiredText($a_required_text); 
 1160            $tpl->setVariable(
'PROGRESS_METER', $uiRenderer->render($pMeter));
 
 1166            $tpl->setVariable(
"TXT_NEXT_STEP", $a_next_step);
 
 1172            include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
 
 1177            $tpl->setVariable(
"SUB_STYLE", 
' style="padding-left: ' . $a_sub_style . 
'px;"');
 
 1178            $tpl->setVariable(
"SUB_INIT", $a_sub);
 
 1196        $lng->loadLanguageModule(
'crs');
 
 1200        $is_qualified_initial =
 
 1208        $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = 
null;
 
 1212            $is_qualified_initial) {
 
 1213            if ($has_completed) {
 
 1214                $next_step = 
$lng->txt(
"crs_loc_progress_objective_complete");
 
 1216                $next_step = 
$lng->txt(
"crs_loc_progress_do_qualifying_again");
 
 1220            if ($a_lo_result[
"status"]) {
 
 1223                        $lng->txt(
"crs_loc_progress_do_qualifying") :
 
 1224                        $lng->txt(
"crs_loc_suggested");
 
 1226                $next_step = (bool) $a_has_initial_test ?
 
 1227                    $lng->txt(
"crs_loc_progress_no_result_do_initial") :
 
 1228                    $lng->txt(
"crs_loc_progress_no_result_no_initial");
 
 1245    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)
 
 1250        $lng->loadLanguageModule(
'crs');
 
 1254        $tooltip_id = 
"crsobjtvusr_" . $a_objective_id . 
"_" . $a_lo_result[
"type"] . 
"_" . ((int) $a_sub);
 
 1255        if ($a_tt_suffix !== 
null) {
 
 1256            $tooltip_id .= 
"_" . $a_tt_suffix;
 
 1260            $lng->txt(
"crs_loc_tt_info"),
 
 1261            $a_lo_result[
"result_perc"],
 
 1262            $a_lo_result[
"limit_perc"]
 
 1266        include_once 
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
 
 1267        include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
 1274        $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = 
null;
 
 1275        $compare_value = 
null;
 
 1277        if ($is_qualified ||
 
 1278            $is_qualified_initial) {
 
 1279            $progress_txt = 
$lng->txt(
"crs_loc_progress_result_qtest");
 
 1280            $tt_txt = 
$lng->txt(
"crs_loc_tab_qtest") . 
": " . $tt_txt;
 
 1282            if ($has_completed) {
 
 1283                $next_step = 
$lng->txt(
"crs_loc_progress_objective_complete");
 
 1284                $bar_color = 
"ilCourseObjectiveProgressBarCompleted";
 
 1287                if ($is_qualified &&
 
 1288                    $a_has_initial_test &&
 
 1289                    is_array($a_lo_result[
"initial"])) {
 
 1290                    $a_lo_result[
"initial"][
"itest"] = $a_lo_result[
"itest"];
 
 1293                    #$initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
 
 1294                    $compare_value = $a_lo_result[
'initial'][
'result_perc'];
 
 1297                $next_step = 
$lng->txt(
"crs_loc_progress_do_qualifying_again");
 
 1298                $bar_color = 
"ilCourseObjectiveProgressBarFailed";
 
 1303            if ($a_lo_result[
"status"]) {
 
 1304                $progress_txt = 
$lng->txt(
"crs_loc_progress_result_itest");
 
 1305                $tt_txt = 
$lng->txt(
"crs_loc_tab_itest") . 
": " . $tt_txt;
 
 1307                $bar_color = 
"ilCourseObjectiveProgressBarNeutral";
 
 1308                $next_step = $has_completed
 
 1309                    ? 
$lng->txt(
"crs_loc_progress_do_qualifying")
 
 1310                    : 
$lng->txt(
"crs_loc_suggested");
 
 1314                $next_step = (bool) $a_has_initial_test
 
 1315                    ? 
$lng->txt(
"crs_loc_progress_no_result_do_initial")
 
 1316                    : 
$lng->txt(
"crs_loc_progress_no_result_no_initial");
 
 1321        $relevant_test_id = $a_lo_result[
"qtest"]
 
 1322            ? $a_lo_result[
"qtest"]
 
 1323            : $a_lo_result[
"itest"];
 
 1324        if ($relevant_test_id) {
 
 1328        $main_text = 
$lng->txt(
'crs_loc_itest_info');
 
 1330            $main_text = 
$lng->txt(
'crs_loc_qtest_info');
 
 1336            $a_lo_result[
"result_perc"],
 
 1337            $a_lo_result[
"limit_perc"],
 
 1351            $lng->txt(
'crs_lobj_pm_min_goal')
 
 1366        $ui_factory = 
$DIC->ui()->factory();
 
 1368        $tpl = 
new ilTemplate(
"tpl.objective_accordion_title.html", 
true, 
true, 
"Services/Container");
 
 1373                self::buildObjectiveProgressBar(
 
 1374                    (
bool) $this->loc_settings->worksWithInitialTest(),
 
 1381        $tpl->setVariable(
"TITLE", $this->lng->txt(
"crs_loc_learning_objective") . 
": " . trim($a_objective->
getTitle()));
 
 1384        $initial_res = 
null;
 
 1385        $initial_lim = 
null;
 
 1386        if ($this->loc_settings->worksWithInitialTest()) {
 
 1387            if (array_key_exists(
'initial', $a_lo_result)) {
 
 1388                $initial_res = (int) $a_lo_result[
'initial'][
'result_perc'];
 
 1389                $initial_lim = (int) $a_lo_result[
'initial'][
'limit_perc'];
 
 1393                isset($a_lo_result[
'result_perc'])
 
 1395                $initial_res = (int) $a_lo_result[
'result_perc'];
 
 1396                $initial_lim = (int) $a_lo_result[
'limit_perc'];
 
 1400        if ($initial_res !== 
null) {
 
 1403                $a_lo_result[
"itest"],
 
 1404                $a_lo_result[
"user_id"]
 
 1407            if (strlen($link)) {
 
 1408                $tpl->setCurrentBlock(
'i_with_link');
 
 1412                        $ui_factory->button()->shy(
 
 1413                            $this->lng->txt(
'crs_objective_result_details'),
 
 1418                $tpl->parseCurrentBlock();
 
 1421            $tpl->setCurrentBlock(
'res_initial');
 
 1425                    $this->lng->txt(
'crs_objective_result_summary_initial'),
 
 1426                    (
int) $initial_res . 
'%',
 
 1427                    (
int) $initial_lim . 
'%' 
 1430            $tpl->parseCurrentBlock();
 
 1438            $qual_res = (int) $a_lo_result[
'result_perc'];
 
 1439            $qual_lim = (int) $a_lo_result[
'limit_perc'];
 
 1442        if ($qual_res !== 
null) {
 
 1445                $a_lo_result[
"qtest"],
 
 1446                $a_lo_result[
"user_id"]
 
 1449            if (strlen($link)) {
 
 1450                $tpl->setCurrentBlock(
'q_with_link');
 
 1454                        $ui_factory->button()->shy(
 
 1455                            $this->lng->txt(
'crs_objective_result_details'),
 
 1460                $tpl->parseCurrentBlock();
 
 1462            $tpl->setCurrentBlock(
'res_qualifying');
 
 1466                    $this->lng->txt(
'crs_objective_result_summary_qualifying'),
 
 1467                    (
int) $qual_res . 
'%',
 
 1468                    (
int) $qual_lim . 
'%' 
 1471            $tpl->parseCurrentBlock();
 
 1474        $this->logger->dump($a_lo_result);
 
 1477            (
bool) $this->loc_settings->worksWithInitialTest(),
 
 1481        if (strlen($summary)) {
 
 1482            $tpl->setCurrentBlock(
'objective_summary');
 
 1483            $tpl->setVariable(
'SUMMARY_TXT', $summary);
 
 1484            $tpl->parseCurrentBlock();
 
 1495        $tpl = 
new ilTemplate(
"tpl.objective_accordion_content.html", 
true, 
true, 
"Services/Container");
 
 1496        foreach ($a_items as $item) {
 
 1497            $tpl->setCurrentBlock(
"items_bl");
 
 1498            $tpl->setVariable(
"ITEM", $item);
 
 1499            $tpl->parseCurrentBlock();
 
 1511    protected function showButton($a_cmd, $a_text, $a_target = 
'', $a_id = 
"")
 
 1517        $ilToolbar->addButton(
 
 1519            $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, $add_token=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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res