31 protected \ILIAS\Container\InternalGUIService
$gui;
48 $this->
tabs = $DIC->tabs();
49 $this->
toolbar = $DIC->toolbar();
50 $this->
logger = $DIC->logger()->crs();
56 $this->content_style_domain =
$DIC
60 $this->gui =
$DIC->container()->internal()->gui();
89 if ($ilAccess->checkAccess(
'write',
'', $this->getContainerObject()->getRefId())) {
93 $ilToolbar->addButton(
95 $ilCtrl->getLinkTargetByClass(get_class($this->
getContainerGUI()),
'reset')
100 return parent::getMainContent();
127 $this->loc_settings->getInitialTest() &&
128 $this->loc_settings->isGeneralInitialTestVisible() &&
129 !$this->loc_settings->isInitialTestStart() &&
132 $this->output_html .= $this->
renderTest($this->loc_settings->getInitialTest(), 0,
true);
134 $this->loc_settings->getQualifiedTest() &&
135 $this->loc_settings->isGeneralQualifiedTestVisible()
137 $this->output_html .= $this->
renderTest($this->loc_settings->getQualifiedTest(), 0,
false);
141 $this->
showMaterials(self::MATERIALS_OTHER,
false, !$is_order);
151 $ilAccess->checkAccess(
'write',
'', $this->getContainerObject()->getRefId())
153 if ($has_results && !$is_manage && !$is_order) {
165 parent::initRenderer();
176 return $this->
renderer->renderItemBlockSequence($this->item_presentation->getItemBlockSequence());
185 $has_container_page =
false;
188 if ($output_html !==
"") {
189 $has_container_page =
true;
201 $this->objective_list_gui->setContainerObject($this->
getContainerGUI());
202 if (
$ilSetting->get(
"icon_position_in_lists") ===
"item_rows") {
203 $this->objective_list_gui->enableIcon(
true);
209 $acc->setUseSessionStorage(
true);
210 $acc->setAllowMultiOpened(
true);
212 $acc->setId(
"crsobjtv_" . $this->container_obj->getId());
221 $has_lo_page =
false;
223 foreach ($objective_ids as $objective_id) {
227 !isset($lur_data[$objective_id]) ||
229 $this->container_obj->getId(),
238 if ($html = $this->
renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id] ??
null)) {
239 $this->
renderer->addItemToBlock(
'lobj',
'lobj', $objective_id, $html);
245 if (!$a_is_order && $obj_cnt > 1) {
246 $this->
showButton(
"",
$lng->
txt(
"crs_show_all_obj"),
"",
"crs_show_all_obj_btn");
247 $this->
showButton(
"",
$lng->
txt(
"crs_hide_all_obj"),
"",
"crs_hide_all_obj_btn");
248 $acc->setShowAllElement(
"crs_show_all_obj_btn");
249 $acc->setHideAllElement(
"crs_hide_all_obj_btn");
252 if (!$has_container_page && $has_lo_page) {
255 "LOCATION_CONTENT_STYLESHEET",
260 "LOCATION_SYNTAX_STYLESHEET",
268 $this->output_html .= $this->
renderer->getHTML();
274 $this->output_html .=
"<div class='ilCrsObjAcc'>" . $acc->getHTML() .
"</div>";
281 bool $a_is_initial =
false
285 $tree =
$DIC->repositoryTree();
288 if ($a_test_ref_id) {
289 $node_data = $tree->getNodeData($a_test_ref_id);
291 if (!($node_data[
'child'] ??
false)) {
296 if ($a_objective_id) {
302 $node_data[
'objective_id'] = $a_objective_id;
303 $node_data[
'objective_status'] =
false;
312 ? $this->
lng->txt(
'crs_loc_itest_info')
313 : $this->
lng->txt(
'crs_loc_qtest_info')
317 $node_data[
'objective_id'] = 0;
320 $node_data[
'title'] = $title;
322 return "<div class='ilContObjectivesViewTestItem'>" . $this->
renderItem($node_data) .
"</div>";
328 bool $a_is_manage =
false,
329 bool $a_as_accordion =
false
333 if (is_array($this->items[
"_all"])) {
334 $this->objective_map = $this->buildObjectiveMap();
338 foreach ($this->items[
"_all"] as $k => $item_data) {
339 if ($a_mode === self::MATERIALS_TESTS && $item_data[
'type'] !==
'tst') {
342 if ($item_data[
'type'] ===
'itgr') {
353 if (($this->rendered_items[$item_data[
"child"]] ??
false) !==
true &&
354 !$this->
renderer->hasItem($item_data[
"child"] ?? 0)) {
355 $this->rendered_items[$item_data[
'child']] =
true;
358 $html = $this->renderItem($item_data, $position++, !($a_mode === self::MATERIALS_TESTS));
360 $item_r[] = [
"html" => $html,
"id" => $item_data[
"child"],
"type" => $item_data[
"type"]];
366 if (count($item_r) > 0) {
367 if (!$a_as_accordion) {
371 case self::MATERIALS_TESTS:
373 $this->
renderer->addTypeBlock($block_id);
376 case self::MATERIALS_OTHER:
378 $this->
renderer->addCustomBlock($block_id,
$lng->txt(
'crs_other_resources'));
384 $this->
renderer->addCustomBlock($block_id,
$lng->txt(
'content'));
389 if ($a_mode !== self::MATERIALS_TESTS) {
390 $pos = $this->getItemGroupsHTML();
393 foreach ($item_r as $h) {
394 if (!$this->
renderer->hasItem($h[
"id"])) {
395 $this->
renderer->addItemToBlock($block_id, $h[
"type"], $h[
"id"], $h[
"html"]);
399 $this->output_html .= $this->
renderer->getHTML();
403 case self::MATERIALS_TESTS:
407 case self::MATERIALS_OTHER:
408 $txt =
$lng->txt(
'crs_other_resources');
413 $acc->setId(
"crsobjtvmat" . $a_mode .
"_" . $this->container_obj->getId());
416 foreach ($item_r as $h) {
417 $acc_content[] = $h[
"html"];
419 $acc->addItem(
$txt, $this->buildAccordionContent($acc_content));
421 $this->output_html .= $acc->getHTML();
436 foreach ($objective_ids as $objective_id) {
438 $objective_map[
"material"][$mat_ref_id][] = $objective_id;
440 if (!isset($objective_map[
"names"][$objective_id])) {
442 $objective_map[
"names"][$objective_id] = $objective->getTitle();
448 $tst = $this->loc_settings->getInitialTest();
450 $objective_map[
"test_i"] = $tst;
452 $tst = $this->loc_settings->getQualifiedTest();
454 $objective_map[
"test_q"] = $tst;
461 $objective_map[
"test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
465 $objective_map[
"test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
469 return $objective_map;
478 $ilCtrl = $this->ctrl;
479 $ilUser = $this->user;
480 $item_ref_id = $a_item[
"ref_id"];
481 if (is_array($this->objective_map)) {
483 if (isset($this->objective_map[
"material"][$item_ref_id])) {
485 foreach ($this->objective_map[
"material"][$item_ref_id] as $objective_id) {
486 $ilCtrl->setParameterByClass(
'ilcourseobjectivesgui',
'objective_id', $objective_id);
487 $url = $ilCtrl->getLinkTargetByClass([
'illoeditorgui',
'ilcourseobjectivesgui'],
'edit');
488 $ilCtrl->setParameterByClass(
'ilcourseobjectivesgui',
'objective_id',
'');
491 'desc' =>
$lng->txt(
'crs_loc_tab_materials') .
': ',
494 'name' => $this->objective_map[
"names"][$objective_id]
498 if (($this->objective_map[
"test_i"] ?? 0) == $item_ref_id) {
499 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 1);
503 'link' => $ilCtrl->getLinkTargetByClass(
'illoeditorgui',
'testOverview'),
504 'name' =>
$lng->txt(
'crs_loc_tab_itest')
506 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 0);
508 if (($this->objective_map[
"test_q"] ?? 0) == $item_ref_id) {
509 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 2);
513 'link' => $ilCtrl->getLinkTargetByClass(
'illoeditorgui',
'testOverview'),
514 'name' =>
$lng->txt(
'crs_loc_tab_qtest')
516 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 0);
520 if (is_array($this->objective_map[
"test_ass"][$item_ref_id] ??
false)) {
521 foreach ($this->objective_map[
"test_ass"][$item_ref_id] as $type => $items) {
523 $caption =
$lng->txt(
'crs_loc_tab_itest');
524 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 1);
526 $caption =
$lng->txt(
'crs_loc_tab_qtest');
527 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 2);
529 foreach ($items as $objtv_title) {
533 'link' => $ilCtrl->getLinkTargetByClass(
'illoeditorgui',
'testsOverview'),
534 'name' => $caption .
" (" . $this->
lng->txt(
"crs_loc_learning_objective") .
": " . $objtv_title .
")"
537 $ilCtrl->setParameterByClass(
'illoeditorgui',
'tt', 0);
541 if (count($details)) {
550 if ($this->getContainerGUI()->isActiveOrdering()) {
555 elseif (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
560 if ($a_item[
'objective_id'] ??
false) {
564 if ($this->loc_settings->getQualifiedTest() == $a_item[
'ref_id']) {
565 $a_item_list_gui->
setConditionTarget($this->getContainerObject()->getRefId(), (
int) $a_item[
'objective_id'],
'lobj');
568 if (!$fullfilled || $a_item[
'objective_status']) {
573 $this->getContainerObject()->
getId(),
575 $a_item[
'objective_id'],
579 $res = $this->updateResult(
$res, $a_item[
'ref_id'], $a_item[
'objective_id'], $ilUser->getId());
581 if (
$res[
'is_final'] ??
false) {
585 $this->
lng->txt(
'crs_loc_passes_reached'),
589 } elseif ($this->loc_settings->getQualifiedTest() == $a_item[
'ref_id']) {
595 $this->
lng->txt(
'crs_loc_passes_left'),
596 (($poss_pass -
$res[
'tries']) > 0) ? ($poss_pass -
$res[
'tries']) : 1,
610 if ($this->loc_settings->getQualifiedTest() === $a_item_ref_id) {
622 if ($a_res[
'tries'] > 0) {
625 $a_res[
'is_final'] = 0;
641 bool &$a_has_lo_page,
643 ?array $a_lo_result =
null
645 $ilUser = $this->
user;
648 $objective =
new ilCourseObjective($this->getContainerObject(), $a_objective_id);
659 foreach ($objectives_lm_obj->getMaterials() as $item) {
660 $sort_map[$item[
"lm_ass_id"]] = $item[
"position"];
663 $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
664 $is_order = $this->getContainerGUI()->isActiveOrdering();
668 foreach ($items as $item) {
669 if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
673 $item_list_gui2 = $this->getItemGUI($item);
674 $item_list_gui2->enableIcon(
true);
676 if ($is_order || $a_accordion) {
677 $item_list_gui2->enableCommands(
true,
true);
678 $item_list_gui2->enableProperties(
false);
681 $chapters = $objectives_lm_obj->getChapters();
682 if (count($chapters)) {
683 $has_sections =
false;
684 foreach ($chapters as $chapter) {
685 if ($chapter[
'ref_id'] != $item[
'child']) {
688 $has_sections =
true;
690 $title = $item[
'title'] .
692 " (" .
$lng->txt(
'obj_' . $chapter[
'type']) .
")";
694 $item_list_gui2->setDefaultCommandParameters([
695 "obj_id" => $chapter[
'obj_id'],
696 "focus_id" => $chapter[
'obj_id'],
697 "focus_return" => $this->container_obj->getRefId()
701 $item_list_gui2->setPositionInputField(
702 "[lobj][" . $a_objective_id .
"][" . $chapter[
'lm_ass_id'] .
"]",
703 sprintf(
'%d', $chapter[
'position'] * 10)
707 $sub_item_html = $item_list_gui2->getListItemHTML(
715 $sort_key = str_pad($chapter[
'position'], 5,
'0', STR_PAD_LEFT) .
"_" . strtolower($title) .
"_" . $chapter[
'lm_ass_id'];
716 $sort_content[$sort_key] = $sub_item_html;
720 $this->rendered_items[$item[
'child']] =
true;
722 if ($lm_ass_id = $objectives_lm_obj->isAssigned($item[
'ref_id'],
true)) {
724 $item_list_gui2->setPositionInputField(
725 "[lobj][" . $a_objective_id .
"][" . $lm_ass_id .
"]",
726 sprintf(
'%d', $sort_map[$lm_ass_id] * 10)
730 $sub_item_html = $item_list_gui2->getListItemHTML(
734 $item[
'description'] ??
''
738 $sort_key = str_pad($sort_map[$lm_ass_id], 5,
'0', STR_PAD_LEFT) .
"_" . strtolower($item[
'title']) .
"_" . $lm_ass_id;
739 $sort_content[$sort_key] = $sub_item_html;
743 if ($this->getDetailsLevel($a_objective_id) === self::DETAILS_ALL) {
744 $this->objective_list_gui->enableCommands(
false);
746 $this->objective_list_gui->enableCommands(
true);
750 $this->objective_list_gui->setPositionInputField(
751 "[lobj][" . $a_objective_id .
"][0]",
752 (
string) ($objective->__getPosition() * 10)
756 ksort($sort_content);
759 foreach ($sort_content as $sub_item_html) {
760 $this->objective_list_gui->addSubItemHTML($sub_item_html);
763 return $this->objective_list_gui->getObjectiveListItemHTML(
766 $objective->getTitle(),
767 $objective->getDescription(),
768 ($is_manage || $is_order)
772 $acc_content = $sort_content;
774 $initial_shown =
false;
779 $initial_test_obj_id &&
780 $this->getSettings()->hasSeparateInitialTests() &&
783 $acc_content[] = $this->renderTest(
788 $initial_shown =
true;
789 } elseif ($this->getSettings()->hasSeparateQualifiedTests()) {
790 $acc_content[] = $this->renderTest(
799 $a_has_lo_page =
true;
801 $page_gui =
new ilLOPageGUI($objective->getObjectiveId());
803 $page_gui->setStyleId(
804 $this->content_style_domain->getEffectiveStyleId()
806 $page_gui->setPresentationTitle(
"");
807 $page_gui->setTemplateOutput(
false);
808 $page_gui->setHeader(
"");
810 $co_page =
"<div class='ilContObjectiveIntro'>" . $page_gui->showPage() .
"</div>";
813 $a_accordion->addItem(
814 $this->buildAccordionTitle($objective, $a_lo_result),
815 $co_page . $this->buildAccordionContent($acc_content),
816 ($this->request->getObjectiveId() === $objective->getObjectiveId())
830 $ilUser = $this->user;
831 $initial_status =
null;
838 foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
854 $result[
"initial_status"] = $initial_status;
859 $res[$objective_id] = $result;
881 ?
int $a_perc_result =
null,
882 ?
int $a_perc_limit =
null,
883 ?
string $a_css =
null,
884 ?
string $a_caption =
null,
885 ?
string $a_url =
null,
886 ?
string $a_tt_id =
null,
887 ?
string $a_tt_txt =
null,
888 ?
string $a_next_step =
null,
890 int $a_sub_style = 30
894 $gui =
$DIC->container()->internal()->gui();
896 $tpl =
new ilTemplate(
"tpl.objective_progressbar.html",
true,
true,
"components/ILIAS/Container");
898 if ($a_perc_result !==
null) {
899 $tpl->setCurrentBlock(
"statusbar_bl");
900 $tpl->setVariable(
"PERC_STATUS", $a_perc_result);
901 $tpl->setVariable(
"PERC_WIDTH", $a_perc_result);
902 $tpl->setVariable(
"PERC_COLOR", $a_css);
905 $limit_pos = (99 - $a_perc_limit) * -1;
906 $tpl->setVariable(
"LIMIT_POS", $limit_pos);
910 $tpl->setVariable(
"TT_ID", $a_tt_id);
912 $tpl->parseCurrentBlock();
917 $button = $gui->link(
922 $tpl->setCurrentBlock(
"statustxt_bl");
923 $tpl->setVariable(
"TXT_PROGRESS_STATUS", $button->render());
925 $tpl->setCurrentBlock(
"statustxt_no_link_bl");
926 $tpl->setVariable(
"TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
928 $tpl->parseCurrentBlock();
932 #$tpl->setCurrentBlock("nstep_bl");
933 $tpl->setVariable(
"TXT_NEXT_STEP", $a_next_step);
934 #$tpl->parseCurrentBlock();
938 $tpl->setVariable(
"SUB_STYLE",
' style="padding-left: ' . $a_sub_style .
'px;"');
939 $tpl->setVariable(
"SUB_INIT", $a_sub);
962 ?
int $a_perc_result =
null,
963 ?
int $a_perc_limit =
null,
964 ?
int $a_compare_value =
null,
965 ?
string $a_caption =
null,
966 ?
string $a_url =
null,
967 ?
string $a_tt_id =
null,
968 ?
string $a_tt_txt =
null,
969 ?
string $a_next_step =
null,
971 int $a_sub_style = 30,
972 string $a_main_text =
'',
973 string $a_required_text =
''
977 $tpl =
new ilTemplate(
"tpl.objective_progressmeter.html",
true,
true,
"components/ILIAS/Container");
980 $lng->loadLanguageModule(
'crs');
981 $gui =
$DIC->container()->internal()->gui();
984 if (is_numeric($a_perc_result)) {
985 $uiFactory =
$DIC->ui()->factory();
986 $uiRenderer =
$DIC->ui()->renderer();
988 $pMeter = $uiFactory->chart()->progressMeter()->standard(
990 (
int) $a_perc_result,
992 (
int) $a_compare_value
994 $tpl->setVariable(
'PROGRESS_METER', $uiRenderer->render($pMeter));
999 $button = $gui->link(
1004 $tpl->setCurrentBlock(
"statustxt_bl");
1005 $tpl->setVariable(
"TXT_PROGRESS_STATUS", $button->render());
1007 $tpl->setCurrentBlock(
"statustxt_no_link_bl");
1008 $tpl->setVariable(
"TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
1010 $tpl->parseCurrentBlock();
1015 $tpl->setVariable(
"TXT_NEXT_STEP", $a_next_step);
1020 $tpl->setVariable(
"SUB_STYLE",
' style="padding-left: ' . $a_sub_style .
'px;"');
1021 $tpl->setVariable(
"SUB_INIT", $a_sub);
1031 bool $a_has_initial_test,
1032 int $a_objective_id,
1037 if ($a_lo_result ===
null) {
1038 $a_lo_result[
"type"] =
null;
1042 $lng->loadLanguageModule(
'crs');
1046 $is_qualified_initial =
1058 $is_qualified_initial) {
1059 if ($has_completed) {
1060 $next_step =
$lng->txt(
"crs_loc_progress_objective_complete");
1062 $next_step =
$lng->txt(
"crs_loc_progress_do_qualifying_again");
1065 elseif ($a_lo_result[
"status"] ??
false) {
1068 $lng->txt(
"crs_loc_progress_do_qualifying") :
1069 $lng->txt(
"crs_loc_suggested");
1071 $next_step = $a_has_initial_test ?
1072 $lng->txt(
"crs_loc_progress_no_result_do_initial") :
1073 $lng->txt(
"crs_loc_progress_no_result_no_initial");
1082 bool $a_has_initial_test,
1083 int $a_objective_id,
1085 bool $a_list_mode =
false,
1086 bool $a_sub =
false,
1087 ?
string $a_tt_suffix =
null
1092 $lng->loadLanguageModule(
'crs');
1096 $tooltip_id =
"crsobjtvusr_" . $a_objective_id .
"_" . $a_lo_result[
"type"] .
"_" . ((
int) $a_sub);
1097 if ($a_tt_suffix !==
null) {
1098 $tooltip_id .=
"_" . $a_tt_suffix;
1102 $lng->txt(
"crs_loc_tt_info"),
1103 $a_lo_result[
"result_perc"] ??
'0',
1104 $a_lo_result[
"limit_perc"] ??
'0'
1113 $next_step = $progress_txt = $bar_color = $test_url = $initial_sub =
null;
1114 $compare_value =
null;
1116 if ($is_qualified ||
1117 $is_qualified_initial) {
1118 $progress_txt =
$lng->txt(
"crs_loc_progress_result_qtest");
1119 $tt_txt =
$lng->txt(
"crs_loc_tab_qtest") .
": " . $tt_txt;
1121 if ($has_completed) {
1122 $next_step =
$lng->txt(
"crs_loc_progress_objective_complete");
1123 $bar_color =
"ilCourseObjectiveProgressBarCompleted";
1126 if ($is_qualified &&
1127 $a_has_initial_test &&
1128 is_array($a_lo_result[
"initial"])) {
1129 $a_lo_result[
"initial"][
"itest"] = $a_lo_result[
"itest"];
1132 #$initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
1133 $compare_value = $a_lo_result[
'initial'][
'result_perc'];
1136 $next_step =
$lng->txt(
"crs_loc_progress_do_qualifying_again");
1137 $bar_color =
"ilCourseObjectiveProgressBarFailed";
1141 elseif ($a_lo_result[
"status"] ??
false) {
1142 $progress_txt =
$lng->txt(
"crs_loc_progress_result_itest");
1143 $tt_txt =
$lng->txt(
"crs_loc_tab_itest") .
": " . $tt_txt;
1145 $bar_color =
"ilCourseObjectiveProgressBarNeutral";
1146 $next_step = $has_completed
1147 ?
$lng->txt(
"crs_loc_progress_do_qualifying")
1148 :
$lng->txt(
"crs_loc_suggested");
1152 $next_step = $a_has_initial_test
1153 ?
$lng->txt(
"crs_loc_progress_no_result_do_initial")
1154 :
$lng->txt(
"crs_loc_progress_no_result_no_initial");
1158 $relevant_test_id = ($a_lo_result[
"qtest"] ?? 0)
1159 ?: ($a_lo_result[
"itest"] ?? 0);
1160 if ($relevant_test_id) {
1164 $main_text =
$lng->txt(
'crs_loc_itest_info');
1166 $main_text =
$lng->txt(
'crs_loc_qtest_info');
1171 return self::renderProgressMeter(
1172 $a_lo_result[
"result_perc"] ??
null,
1173 $a_lo_result[
"limit_perc"] ??
null,
1182 (
bool) $initial_sub,
1187 $lng->txt(
'crs_lobj_pm_min_goal')
1193 ?array $a_lo_result =
null
1198 $ui_factory =
$DIC->ui()->factory();
1200 $tpl =
new ilTemplate(
"tpl.objective_accordion_title.html",
true,
true,
"components/ILIAS/Container");
1205 self::buildObjectiveProgressBar(
1206 $this->loc_settings->worksWithInitialTest(),
1213 $tpl->setVariable(
"TITLE", $this->
lng->txt(
"crs_loc_learning_objective") .
": " . trim($a_objective->
getTitle()));
1214 $tpl->setVariable(
"DESCRIPTION", nl2br(trim($a_objective->
getDescription())));
1216 $initial_res =
null;
1217 $initial_lim =
null;
1218 if ($this->loc_settings->worksWithInitialTest()) {
1219 if (array_key_exists(
'initial', $a_lo_result)) {
1220 $initial_res = (
int) ($a_lo_result[
'initial'][
'result_perc'] ?? 0);
1221 $initial_lim = (
int) ($a_lo_result[
'initial'][
'limit_perc'] ?? 0);
1225 isset($a_lo_result[
'result_perc'])
1227 $initial_res = (
int) ($a_lo_result[
'result_perc'] ?? 0);
1228 $initial_lim = (
int) ($a_lo_result[
'limit_perc'] ?? 0);
1232 if ($initial_res !==
null) {
1234 $a_lo_result[
"itest"],
1235 $a_lo_result[
"user_id"]
1239 $tpl->setCurrentBlock(
'i_with_link');
1243 $ui_factory->button()->shy(
1244 $this->lng->txt(
'crs_objective_result_details'),
1249 $tpl->parseCurrentBlock();
1252 $tpl->setCurrentBlock(
'res_initial');
1256 $this->
lng->txt(
'crs_objective_result_summary_initial'),
1258 (
int) $initial_lim .
'%'
1261 $tpl->parseCurrentBlock();
1268 $qual_res = (
int) $a_lo_result[
'result_perc'];
1269 $qual_lim = (
int) $a_lo_result[
'limit_perc'];
1272 if ($qual_res !==
null) {
1274 $a_lo_result[
"qtest"],
1275 $a_lo_result[
"user_id"]
1279 $tpl->setCurrentBlock(
'q_with_link');
1283 $ui_factory->button()->shy(
1284 $this->lng->txt(
'crs_objective_result_details'),
1289 $tpl->parseCurrentBlock();
1291 $tpl->setCurrentBlock(
'res_qualifying');
1295 $this->
lng->txt(
'crs_objective_result_summary_qualifying'),
1297 (
int) $qual_lim .
'%'
1300 $tpl->parseCurrentBlock();
1303 $this->
logger->dump($a_lo_result);
1305 $summary = self::getObjectiveResultSummary(
1306 $this->loc_settings->worksWithInitialTest(),
1310 if ($summary !==
'') {
1311 $tpl->setCurrentBlock(
'objective_summary');
1312 $tpl->setVariable(
'SUMMARY_TXT', $summary);
1313 $tpl->parseCurrentBlock();
1317 $tpl->setVariable(
"ANCHOR_ID",
"objtv_acc_" . $a_objective->
getObjectiveId());
1324 $tpl =
new ilTemplate(
"tpl.objective_accordion_content.html",
true,
true,
"components/ILIAS/Container");
1325 foreach ($a_items as $item) {
1326 $tpl->setCurrentBlock(
"items_bl");
1327 $tpl->setVariable(
"ITEM", $item);
1328 $tpl->parseCurrentBlock();
1336 string $a_target =
'',
1340 $ilCtrl = $this->ctrl;
1343 $ilToolbar->addButton(
1345 $ilCtrl->getLinkTarget($this->getContainerGUI(), $a_cmd),
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const string OPERATOR_FINISHED
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
Parent class of all container content GUIs.
renderItem(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
Render an item.
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
ILIAS Container Content ItemPresentationManager $item_presentation
ilGlobalTemplateInterface $tpl
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Container InternalGUIService $gui
static buildObjectiveProgressBar(bool $a_has_initial_test, int $a_objective_id, array $a_lo_result, bool $a_list_mode=false, bool $a_sub=false, ?string $a_tt_suffix=null)
Render progressbar(s) for given objective and result data.
ilLOSettings $loc_settings
static renderProgressMeter(?int $a_perc_result=null, ?int $a_perc_limit=null, ?int $a_compare_value=null, ?string $a_caption=null, ?string $a_url=null, ?string $a_tt_id=null, ?string $a_tt_txt=null, ?string $a_next_step=null, bool $a_sub=false, int $a_sub_style=30, string $a_main_text='', string $a_required_text='')
Render progress bar(s)
showMaterials(?int $a_mode=null, bool $a_is_manage=false, bool $a_as_accordion=false)
initRenderer()
Init container renderer.
ilLOTestAssignments $test_assignments
updateResult(array $a_res, int $a_item_ref_id, int $a_objective_id, int $a_user_id)
static getObjectiveResultSummary(bool $a_has_initial_test, int $a_objective_id, ?array $a_lo_result)
Get objective result summary.
ilCourseObjectiveListGUI $objective_list_gui
buildObjectiveMap()
Stays in ContainergGUI, needed for addItemDetails.
addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item)
Stays in ContainergGUI, inject in renderer.
ILIAS Style Content Object ObjectFacade $content_style_domain
__construct(ilContainerGUI $container_gui_obj, \ILIAS\Container\Content\ItemPresentationManager $item_presentation)
buildAccordionContent(array $a_items)
buildAccordionTitle(ilCourseObjective $a_objective, ?array $a_lo_result=null)
showButton(string $a_cmd, string $a_text, string $a_target='', string $a_id="")
renderObjective(int $a_objective_id, bool &$a_has_lo_page, ?ilAccordionGUI $a_accordion=null, ?array $a_lo_result=null)
renderTest(int $a_test_ref_id, int $a_objective_id, bool $a_is_initial=false)
getMainContent()
Get content HTML for main column, this one may be overwritten in derived classes.
getDetailsLevel(int $a_item_id)
static renderProgressBar(?int $a_perc_result=null, ?int $a_perc_limit=null, ?string $a_css=null, ?string $a_caption=null, ?string $a_url=null, ?string $a_tt_id=null, ?string $a_tt_txt=null, ?string $a_next_step=null, bool $a_sub=false, int $a_sub_style=30)
Render progress bar(s)
showObjectives(bool $a_is_order=false)
List gui for course objectives.
class ilCourseObjectiveMaterials
static _getAssignedMaterials(int $a_objective_id)
static lookupMaxPasses(int $a_objective_id)
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static _lookupTitle(int $a_obj_id)
(Course) learning objective page GUI class
const TYPE_TEST_QUALIFIED
static getInstanceByObjId(int $a_obj_id)
const TYPE_TEST_UNDEFINED
static getInstance(int $a_container_id)
static lookupRunExistsForObjective(int $a_test_id, int $a_objective_id, int $a_user_id)
static hasResults(int $a_container_id, int $a_user_id)
static lookupResult(int $a_course_obj_id, int $a_user_id, int $a_objective_id, int $a_tst_type)
static hasActiveRun(int $a_container_id, int $a_test_ref_id, int $a_objective_id)
static getTestResultLinkForUser(int $a_test_ref_id, int $a_user_id)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Component logger with individual log levels by component id.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getSyntaxStylePath()
static isParticipantsLastPassActive(int $test_ref_id, int $user_id)
static getItemsByObjective(int $objective_id)
Get objective items.
enableItemDetailLinks(bool $status)
enable item detail links E.g Direct links to chapters or pages
setDefaultCommandParameters(array $params)
setConditionTarget(int $ref_id, int $obj_id, string $target_type)
disableTitleLink(bool $status)
addCustomProperty(string $property='', string $value='', bool $alert=false, bool $newline=false)
setItemDetailLinks(array $detail_links, string $intro_txt='')
set items detail links
enableCommands(bool $status, bool $std_only=false)
enableProperties(bool $status)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
check condition for a specific user and object
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))