ILIAS  release_8 Revision v8.24
class.ilContainerObjectiveGUI.php
Go to the documentation of this file.
1<?php
2
26{
27 public const MATERIALS_TESTS = 1;
28 public const MATERIALS_OTHER = 2;
29
31 protected ilTabsGUI $tabs;
32 protected array $objective_map = [];
34 protected int $force_details = 0;
36 protected array $rendered_items = [];
38 private string $output_html = '';
40 protected \ILIAS\Style\Content\Object\ObjectFacade $content_style_domain;
41
42 public function __construct(ilContainerGUI $a_container_gui)
43 {
44 global $DIC;
45
46 $this->tabs = $DIC->tabs();
47 $this->access = $DIC->access();
48 $this->user = $DIC->user();
49 $this->settings = $DIC->settings();
50 $this->ctrl = $DIC->ctrl();
51 $this->toolbar = $DIC->toolbar();
52 $lng = $DIC->language();
53 $this->logger = $DIC->logger()->crs();
54
55 $this->lng = $lng;
56 parent::__construct($a_container_gui);
57
58 $this->initTestAssignments();
59
60 // ak: note, also in ILIAS <= 7 this page did not
61 // use the container style, it could however, but this would be a conceptual change
62 $this->content_style_domain = $DIC
63 ->contentStyle()
64 ->domain()
65 ->styleForObjId(0);
66 }
67
69 {
71 }
72
73 public function getSettings(): ilLOSettings
74 {
76 }
77
78 protected function getDetailsLevel(int $a_item_id): int
79 {
80 // no details anymore
81 return self::DETAILS_ALL;
82 }
83
84 public function getMainContent(): string
85 {
87 $ilAccess = $this->access;
89 $ilCtrl = $this->ctrl;
90 $has_results = false;
91
92 $tpl = new ilTemplate("tpl.container_page.html", true, true, "Services/Container");
93
94 if ($ilAccess->checkAccess('write', '', $this->getContainerObject()->getRefId())) {
95 // check for results
97 $ilToolbar = new ilToolbarGUI();
98 $ilToolbar->addButton(
99 $lng->txt('crs_reset_results'),
100 $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI()), 'reset')
101 );
102 }
103 }
104
105 // Feedback
106 // @todo
107 // $this->__showFeedBack();
108
109 $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
110
111 $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
112 $is_order = $this->getContainerGUI()->isActiveOrdering();
113
114 $this->loc_settings = ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId());
115
116 $this->initRenderer();
117
118 if (!$is_manage) {
119 $this->showObjectives($is_order);
120
121 // check for results
122 $has_results = ilLOUserResults::hasResults($this->getContainerObject()->getId(), $ilUser->getId());
123
124 $tst_obj_id = ilObject::_lookupObjId($this->loc_settings->getInitialTest());
125
126 if (
127 $this->loc_settings->getInitialTest() &&
128 $this->loc_settings->isGeneralInitialTestVisible() &&
129 !$this->loc_settings->isInitialTestStart() &&
131 ) {
132 $this->output_html .= $this->renderTest($this->loc_settings->getInitialTest(), 0, true);
133 } elseif (
134 $this->loc_settings->getQualifiedTest() &&
135 $this->loc_settings->isGeneralQualifiedTestVisible()
136 ) {
137 $this->output_html .= $this->renderTest($this->loc_settings->getQualifiedTest(), 0, false);
138 }
139
140 $this->showMaterials(self::MATERIALS_OTHER, false, !$is_order);
141 } else {
142 $this->showMaterials(null, true);
143 }
144
145 // reset results by setting or for admins
146 if (
147 ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId())->isResetResultsEnabled() ||
148 $ilAccess->checkAccess('write', '', $this->getContainerObject()->getRefId())
149 ) {
150 if ($has_results && !$is_manage && !$is_order) {
151 $this->showButton('askReset', $lng->txt('crs_reset_results'));
152 }
153 }
154
155 $tpl->setVariable('CONTAINER_PAGE_CONTENT', $this->output_html);
156
157 return $tpl->get();
158 }
159
163 public function showStatus(): void
164 {
167
168 $status = ilCourseObjectiveResultCache::getStatus($ilUser->getId(), $this->getContainerObject()->getId());
170 return;
171 }
172 $info_tpl = new ilTemplate('tpl.crs_objectives_view_info_table.html', true, true, 'Modules/Course');
173 $info_tpl->setVariable("INFO_STRING", $lng->txt('crs_objectives_info_' . $status));
174
175 $this->output_html .= $info_tpl->get();
176 }
177
178 public function showObjectives(bool $a_is_order = false): void
179 {
183
185
186 // get embedded blocks
187 $has_container_page = false;
188 if (!$a_is_order) {
189 $output_html = $this->getContainerGUI()->getContainerPageHTML();
190 if ($output_html !== "") {
191 $has_container_page = true;
192 $this->output_html .= $this->insertPageEmbeddedBlocks($output_html);
193 }
194 unset($output_html);
195 }
196
197 // All objectives
198 if (!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
199 return;
200 }
201
202 $this->objective_list_gui = new ilCourseObjectiveListGUI();
203 $this->objective_list_gui->setContainerObject($this->getContainerGUI());
204 if ($ilSetting->get("icon_position_in_lists") === "item_rows") {
205 $this->objective_list_gui->enableIcon(true);
206 }
207
208 $acc = null;
209 if (!$a_is_order) {
210 $acc = new ilAccordionGUI();
211 $acc->setUseSessionStorage(true);
212 $acc->setAllowMultiOpened(true);
213 $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
214 $acc->setId("crsobjtv_" . $this->container_obj->getId());
215 } else {
216 $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives'));
217 }
218
219 $lur_data = $this->parseLOUserResults();
220
221 $has_initial = ilLOSettings::getInstanceByObjId($this->container_obj->getId())->worksWithInitialTest();
222
223 $has_lo_page = false;
224 $obj_cnt = 0;
225 foreach ($objective_ids as $objective_id) {
226 if (
227 $has_initial &&
228 (
229 !isset($lur_data[$objective_id]) ||
231 $this->container_obj->getId(),
232 ilLOSettings::getInstanceByObjId($this->container_obj->getId())->getInitialTest(),
233 $objective_id
234 )
235 )
236 ) {
237 $lur_data[$objective_id] = ["type" => ilLOSettings::TYPE_TEST_INITIAL];
238 }
239
240 if ($html = $this->renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id] ?? null)) {
241 $this->renderer->addItemToBlock('lobj', 'lobj', $objective_id, $html);
242 }
243 $obj_cnt++;
244 }
245
246 // buttons for showing/hiding all objectives
247 if (!$a_is_order && $obj_cnt > 1) {
248 $this->showButton("", $lng->txt("crs_show_all_obj"), "", "crs_show_all_obj_btn");
249 $this->showButton("", $lng->txt("crs_hide_all_obj"), "", "crs_hide_all_obj_btn");
250 $acc->setShowAllElement("crs_show_all_obj_btn");
251 $acc->setHideAllElement("crs_hide_all_obj_btn");
252 }
253
254 if (!$has_container_page && $has_lo_page) {
255 // add core co page css
257 "LOCATION_CONTENT_STYLESHEET",
259 );
260 $tpl->setCurrentBlock("SyntaxStyle");
262 "LOCATION_SYNTAX_STYLESHEET",
264 );
266 }
267
268 // order/block
269 if ($a_is_order) {
270 $this->output_html .= $this->renderer->getHTML();
271
272 $this->renderer->resetDetails();
273 }
274 // view/accordion
275 else {
276 $this->output_html .= "<div class='ilCrsObjAcc'>" . $acc->getHTML() . "</div>";
277 }
278 }
279
280 protected function renderTest(
281 int $a_test_ref_id,
282 int $a_objective_id,
283 bool $a_is_initial = false
284 ): string {
285 global $DIC;
286
287 $tree = $DIC->repositoryTree();
288
289 $node_data = [];
290 if ($a_test_ref_id) {
291 $node_data = $tree->getNodeData($a_test_ref_id);
292 }
293 if (!($node_data['child'] ?? false)) {
294 return '';
295 }
296
297 // update ti
298 if ($a_objective_id) {
299 if ($a_is_initial) {
300 $title = sprintf($this->lng->txt('crs_loc_itst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
301 } else {
302 $title = sprintf($this->lng->txt('crs_loc_qtst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
303 }
304 $node_data['objective_id'] = $a_objective_id;
305 $node_data['objective_status'] = false;
306 } else {
307 $obj_id = ilObject::_lookupObjId($a_test_ref_id);
308 $title = ilObject::_lookupTitle($obj_id);
309
310 $title .= (
311 ' (' .
312 (
313 $a_is_initial
314 ? $this->lng->txt('crs_loc_itest_info')
315 : $this->lng->txt('crs_loc_qtest_info')
316 ) .
317 ')'
318 );
319 $node_data['objective_id'] = 0;
320 }
321
322 $node_data['title'] = $title;
323
324 return "<div class='ilContObjectivesViewTestItem'>" . $this->renderItem($node_data) . "</div>";
325 }
326
327 // Show all other (no assigned tests, no assigned materials) materials
328 protected function showMaterials(
329 int $a_mode = null,
330 bool $a_is_manage = false,
331 bool $a_as_accordion = false
332 ): void {
333 $lng = $this->lng;
334
335 $this->clearAdminCommandsDetermination();
336
337 if (is_array($this->items["_all"] ?? false)) {
338 $this->objective_map = $this->buildObjectiveMap();
339 // all rows
340 $item_r = [];
341 $position = 1;
342 foreach ($this->items["_all"] as $k => $item_data) {
343 if ($a_mode === self::MATERIALS_TESTS && $item_data['type'] !== 'tst') {
344 continue;
345 }
346 if ($item_data['type'] === 'itgr') {
347 continue;
348 }
349 if (!$a_is_manage) {
350 // if test object is qualified or initial do not show here
351 $assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
352 if ($assignments->getTypeByTest($item_data['child']) !== ilLOSettings::TYPE_TEST_UNDEFINED) {
353 continue;
354 }
355 }
356
357 if (($this->rendered_items[$item_data["child"]] ?? false) !== true &&
358 !$this->renderer->hasItem($item_data["child"] ?? 0)) {
359 $this->rendered_items[$item_data['child']] = true;
360
361 // TODO: Position (DONE ?)
362 $html = $this->renderItem($item_data, $position++, !($a_mode === self::MATERIALS_TESTS));
363 if ($html != "") {
364 $item_r[] = ["html" => $html, "id" => $item_data["child"], "type" => $item_data["type"]];
365 }
366 }
367 }
368
369 // if we have at least one item, output the block
370 if (count($item_r) > 0) {
371 if (!$a_as_accordion) {
372 $pos = 0;
373
374 switch ($a_mode) {
375 case self::MATERIALS_TESTS:
376 $block_id = "tst";
377 $this->renderer->addTypeBlock($block_id);
378 break;
379
380 case self::MATERIALS_OTHER:
381 $block_id = "oth";
382 $this->renderer->addCustomBlock($block_id, $lng->txt('crs_other_resources'));
383 break;
384
385 // manage
386 default:
387 $block_id = "all";
388 $this->renderer->addCustomBlock($block_id, $lng->txt('content'));
389 break;
390 }
391
392 // :TODO:
393 if ($a_mode !== self::MATERIALS_TESTS) {
394 $pos = $this->getItemGroupsHTML();
395 }
396
397 foreach ($item_r as $h) {
398 if (!$this->renderer->hasItem($h["id"])) {
399 $this->renderer->addItemToBlock($block_id, $h["type"], $h["id"], $h["html"]);
400 }
401 }
402
403 $this->output_html .= $this->renderer->getHTML();
404 } else {
405 $txt = "";
406 switch ($a_mode) {
407 case self::MATERIALS_TESTS:
408 $txt = $lng->txt('objs_tst');
409 break;
410
411 case self::MATERIALS_OTHER:
412 $txt = $lng->txt('crs_other_resources');
413 break;
414 }
415
416 $acc = new ilAccordionGUI();
417 $acc->setId("crsobjtvmat" . $a_mode . "_" . $this->container_obj->getId());
418
419 $acc_content = [];
420 foreach ($item_r as $h) {
421 $acc_content[] = $h["html"];
422 }
423 $acc->addItem($txt, $this->buildAccordionContent($acc_content));
424
425 $this->output_html .= $acc->getHTML();
426 }
427 }
428 }
429 }
430
431 protected function buildObjectiveMap(): array
432 {
433 $objective_map = [];
434 // begin-patch lok
435 if (count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
436 // end-patch lok
437 foreach ($objective_ids as $objective_id) {
438 foreach (ilCourseObjectiveMaterials::_getAssignedMaterials($objective_id) as $mat_ref_id) {
439 $objective_map["material"][$mat_ref_id][] = $objective_id;
440
441 if (!isset($objective_map["names"][$objective_id])) {
442 $objective = new ilCourseObjective($this->getContainerObject(), $objective_id);
443 $objective_map["names"][$objective_id] = $objective->getTitle();
444 }
445 }
446 }
447
448 // initial/qualifying test
449 $tst = $this->loc_settings->getInitialTest();
450 if ($tst) {
451 $objective_map["test_i"] = $tst;
452 }
453 $tst = $this->loc_settings->getQualifiedTest();
454 if ($tst) {
455 $objective_map["test_q"] = $tst;
456 }
457
458 // objective test assignments
459 $ass_test = new ilLOTestAssignments($this->getContainerObject()->getId());
460 foreach ($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_INITIAL) as $ass) {
461 $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
462 $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
463 }
464 foreach ($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_QUALIFIED) as $ass) {
465 $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
466 $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
467 }
468 }
469
470 return $objective_map;
471 }
472
473 protected function addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item): void
474 {
476 $ilCtrl = $this->ctrl;
477 $ilUser = $this->user;
478
479 $item_ref_id = $a_item["ref_id"];
480
481 if (is_array($this->objective_map)) {
482 $details = [];
483 if (isset($this->objective_map["material"][$item_ref_id])) {
484 // #12965
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', '');
489
490 $details[] = [
491 'desc' => $lng->txt('crs_loc_tab_materials') . ': ',
492 'target' => '_top',
493 'link' => $url,
494 'name' => $this->objective_map["names"][$objective_id]
495 ];
496 }
497 }
498 if (($this->objective_map["test_i"] ?? 0) == $item_ref_id) {
499 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
500 $details[] = [
501 'desc' => '',
502 'target' => '_top',
503 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
504 'name' => $lng->txt('crs_loc_tab_itest')
505 ];
506 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
507 }
508 if (($this->objective_map["test_q"] ?? 0) == $item_ref_id) {
509 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
510 $details[] = [
511 'desc' => '',
512 'target' => '_top',
513 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
514 'name' => $lng->txt('crs_loc_tab_qtest')
515 ];
516 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
517 }
518
519 // #15367
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);
525 } else {
526 $caption = $lng->txt('crs_loc_tab_qtest');
527 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
528 }
529 foreach ($items as $objtv_title) {
530 $details[] = [
531 'desc' => '',
532 'target' => '_top',
533 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testsOverview'),
534 'name' => $caption . " (" . $this->lng->txt("crs_loc_learning_objective") . ": " . $objtv_title . ")"
535 ];
536 }
537 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
538 }
539 }
540
541 if (count($details)) {
542 $a_item_list_gui->enableItemDetailLinks(true);
543 $a_item_list_gui->setItemDetailLinks($details, $lng->txt('crs_loc_settings_tbl') . ': ');
544 } else {
545 $a_item_list_gui->enableItemDetailLinks(false);
546 }
547 }
548
549 // order
550 if ($this->getContainerGUI()->isActiveOrdering()) {
551 $a_item_list_gui->enableCommands(true, true);
552 $a_item_list_gui->enableProperties(false);
553 }
554 // view
555 elseif (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
556 $a_item_list_gui->enableCommands(true, true);
557 $a_item_list_gui->enableProperties(false);
558 }
559
560 if ($a_item['objective_id'] ?? false) {
561 $a_item_list_gui->setDefaultCommandParameters(['objective_id' => $a_item['objective_id']]);
562
563
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');
566 // check conditions of target
567 $fullfilled = ilConditionHandler::_checkAllConditionsOfTarget($this->getContainerObject()->getRefId(), (int) $a_item['objective_id'], 'lobj');
568 if (!$fullfilled || $a_item['objective_status']) {
569 $a_item_list_gui->disableTitleLink(true);
570 }
571 }
573 $this->getContainerObject()->getId(),
574 $ilUser->getId(),
575 $a_item['objective_id'],
577 );
578
579 $res = $this->updateResult($res, $a_item['ref_id'], $a_item['objective_id'], $ilUser->getId());
580
581 if ($res['is_final'] ?? false) {
582 $a_item_list_gui->disableTitleLink(true);
583 $a_item_list_gui->enableProperties(true);
584 $a_item_list_gui->addCustomProperty(
585 $this->lng->txt('crs_loc_passes_reached'),
586 '',
587 true
588 );
589 } elseif ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) {
590 $poss_pass = ilCourseObjective::lookupMaxPasses($a_item['objective_id']);
591
592 if ($poss_pass) {
593 $a_item_list_gui->enableProperties(true);
594 $a_item_list_gui->addCustomProperty(
595 $this->lng->txt('crs_loc_passes_left'),
596 (($poss_pass - $res['tries']) > 0) ? ($poss_pass - $res['tries']) : 1,
597 false
598 );
599 }
600 }
601 }
602 }
603
604 protected function updateResult(
605 array $a_res,
606 int $a_item_ref_id,
607 int $a_objective_id,
608 int $a_user_id
609 ): array {
610 if ($this->loc_settings->getQualifiedTest() === $a_item_ref_id) {
611 // Check for existing test run, and decrease tries, reset final if run exists
613 $a_item_ref_id,
614 $a_user_id
615 );
616
618 ilObject::_lookupObjId($a_item_ref_id),
619 $a_objective_id,
620 $a_user_id
621 )) {
622 if ($a_res['tries'] > 0) {
623 --$a_res['tries'];
624 }
625 $a_res['is_final'] = 0;
626 }
627 }
628 return $a_res;
629 }
630
639 protected function renderObjective(
640 int $a_objective_id,
641 bool &$a_has_lo_page,
642 ilAccordionGUI $a_accordion = null,
643 array $a_lo_result = null
644 ): string {
645 $ilUser = $this->user;
647
648 $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id);
649
650 $items = ilObjectActivation::getItemsByObjective($a_objective_id);
651
652 // sorting is handled by ilCourseObjectiveMaterials
653 // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
654
655 $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
656
657 // #13381 - map material assignment to position
658 $sort_map = [];
659 foreach ($objectives_lm_obj->getMaterials() as $item) {
660 $sort_map[$item["lm_ass_id"]] = $item["position"];
661 }
662
663 $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
664 $is_order = $this->getContainerGUI()->isActiveOrdering();
665
666 $sort_content = [];
667
668 foreach ($items as $item) {
669 if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
670 continue;
671 }
672
673 $item_list_gui2 = $this->getItemGUI($item);
674 $item_list_gui2->enableIcon(true);
675
676 if ($is_order || $a_accordion) {
677 $item_list_gui2->enableCommands(true, true);
678 $item_list_gui2->enableProperties(false);
679 }
680
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']) {
686 continue;
687 }
688 $has_sections = true;
689
690 $title = $item['title'] .
691 " &rsaquo; " . ilLMObject::_lookupTitle($chapter['obj_id']) .
692 " (" . $lng->txt('obj_' . $chapter['type']) . ")";
693
694 $item_list_gui2->setDefaultCommandParameters([
695 "obj_id" => $chapter['obj_id'],
696 "focus_id" => $chapter['obj_id'],
697 "focus_return" => $this->container_obj->getRefId()
698 ]);
699
700 if ($is_order) {
701 $item_list_gui2->setPositionInputField(
702 "[lobj][" . $a_objective_id . "][" . $chapter['lm_ass_id'] . "]",
703 sprintf('%d', $chapter['position'] * 10)
704 );
705 }
706
707 $sub_item_html = $item_list_gui2->getListItemHTML(
708 $item['ref_id'],
709 $item['obj_id'],
710 $title,
711 $item['description']
712 );
713
714 // #13381 - use materials order
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;
717 }
718 }
719
720 $this->rendered_items[$item['child']] = true;
721
722 if ($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true)) {
723 if ($is_order) {
724 $item_list_gui2->setPositionInputField(
725 "[lobj][" . $a_objective_id . "][" . $lm_ass_id . "]",
726 sprintf('%d', $sort_map[$lm_ass_id] * 10)
727 );
728 }
729
730 $sub_item_html = $item_list_gui2->getListItemHTML(
731 $item['ref_id'],
732 $item['obj_id'],
733 $item['title'],
734 $item['description'] ?? ''
735 );
736
737 // #13381 - use materials order
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;
740 }
741 }
742
743 if ($this->getDetailsLevel($a_objective_id) === self::DETAILS_ALL) {
744 $this->objective_list_gui->enableCommands(false);
745 } else {
746 $this->objective_list_gui->enableCommands(true);
747 }
748
749 if ($is_order) {
750 $this->objective_list_gui->setPositionInputField(
751 "[lobj][" . $a_objective_id . "][0]",
752 (string) ($objective->__getPosition() * 10)
753 );
754 }
755
756 ksort($sort_content);
757
758 if (!$a_accordion) {
759 foreach ($sort_content as $sub_item_html) {
760 $this->objective_list_gui->addSubItemHTML($sub_item_html);
761 }
762
763 return $this->objective_list_gui->getObjectiveListItemHTML(
764 0,
765 $a_objective_id,
766 $objective->getTitle(),
767 $objective->getDescription(),
768 ($is_manage || $is_order)
769 );
770 }
771
772 $acc_content = $sort_content;
773
774 $initial_shown = false;
775 $initial_test_ref_id = $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL);
776 $initial_test_obj_id = ilObject::_lookupObjId($initial_test_ref_id);
777
778 if (
779 $initial_test_obj_id &&
780 $this->getSettings()->hasSeparateInitialTests() &&
782 ) {
783 $acc_content[] = $this->renderTest(
784 $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL),
785 $a_objective_id,
786 true
787 );
788 $initial_shown = true;
789 } elseif ($this->getSettings()->hasSeparateQualifiedTests()) {
790 $acc_content[] = $this->renderTest(
791 $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED),
792 $a_objective_id,
793 false
794 );
795 }
796
797 $co_page = null;
798 if (ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId())) {
799 $a_has_lo_page = true;
800
801 $page_gui = new ilLOPageGUI($objective->getObjectiveId());
802
803 $page_gui->setStyleId(
804 $this->content_style_domain->getEffectiveStyleId()
805 );
806 $page_gui->setPresentationTitle("");
807 $page_gui->setTemplateOutput(false);
808 $page_gui->setHeader("");
809
810 $co_page = "<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . "</div>";
811 }
812
813 $a_accordion->addItem(
814 $this->buildAccordionTitle($objective, $a_lo_result),
815 $co_page . $this->buildAccordionContent($acc_content),
816 ($this->request->getObjectiveId() === $objective->getObjectiveId())
817 );
818
819 return "";
820 }
821
822 protected function initTestAssignments(): void
823 {
824 $this->test_assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
825 }
826
827 // Parse learning objective results.
828 protected function parseLOUserResults(): array
829 {
830 $ilUser = $this->user;
831 $initial_status = null;
832
833 $res = [];
834
835 $lo_ass = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
836
837 $lur = new ilLOUserResults($this->getContainerObject()->getId(), $ilUser->getId());
838 foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
839 // show either initial or qualified for objective
840 if (isset($types[ilLOUserResults::TYPE_INITIAL])) {
841 $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
842 }
843
844 // qualified test has priority
845 if (isset($types[ilLOUserResults::TYPE_QUALIFIED])) {
846 $result = $types[ilLOUserResults::TYPE_QUALIFIED];
847 $result["type"] = ilLOUserResults::TYPE_QUALIFIED;
848 $result["initial"] = $types[ilLOUserResults::TYPE_INITIAL] ?? null;
849 } else {
850 $result = $types[ilLOUserResults::TYPE_INITIAL];
851 $result["type"] = ilLOUserResults::TYPE_INITIAL;
852 }
853
854 $result["initial_status"] = $initial_status;
855
856 $result["itest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
857 $result["qtest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
858
859 $res[$objective_id] = $result;
860 }
861
862 return $res;
863 }
864
879 public static function renderProgressBar(
880 int $a_perc_result = null,
881 int $a_perc_limit = null,
882 string $a_css = null,
883 string $a_caption = null,
884 string $a_url = null,
885 string $a_tt_id = null,
886 string $a_tt_txt = null,
887 string $a_next_step = null,
888 bool $a_sub = false,
889 int $a_sub_style = 30
890 ): string {
891 global $DIC;
892
893 $tpl = new ilTemplate("tpl.objective_progressbar.html", true, true, "Services/Container");
894
895 if ($a_perc_result !== null) {
896 $tpl->setCurrentBlock("statusbar_bl");
897 $tpl->setVariable("PERC_STATUS", $a_perc_result);
898 $tpl->setVariable("PERC_WIDTH", $a_perc_result);
899 $tpl->setVariable("PERC_COLOR", $a_css);
900 if ($a_perc_limit) {
901 // :TODO: magic?
902 $limit_pos = (99 - $a_perc_limit) * -1;
903 $tpl->setVariable("LIMIT_POS", $limit_pos);
904 }
905 if ($a_tt_txt &&
906 $a_tt_id) {
907 $tpl->setVariable("TT_ID", $a_tt_id);
908 }
909 $tpl->parseCurrentBlock();
910 }
911
912 if ($a_caption) {
913 if ($a_url) {
914 $button = ilLinkButton::getInstance();
915 $button->setCaption($a_caption, false);
916 $button->setUrl($a_url);
917
918 $tpl->setCurrentBlock("statustxt_bl");
919 $tpl->setVariable("TXT_PROGRESS_STATUS", $button->render());
920 } else {
921 $tpl->setCurrentBlock("statustxt_no_link_bl");
922 $tpl->setVariable("TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
923 }
924 $tpl->parseCurrentBlock();
925 }
926
927 if ($a_next_step) {
928 #$tpl->setCurrentBlock("nstep_bl");
929 $tpl->setVariable("TXT_NEXT_STEP", $a_next_step);
930 #$tpl->parseCurrentBlock();
931 }
932
933 if ($a_tt_id &&
934 $a_tt_txt) {
935 ilTooltipGUI::addTooltip($a_tt_id, $a_tt_txt);
936 }
937
938 if ($a_sub) {
939 $tpl->setVariable("SUB_STYLE", ' style="padding-left: ' . $a_sub_style . 'px;"');
940 $tpl->setVariable("SUB_INIT", $a_sub);
941 }
942
943 return $tpl->get();
944 }
945
962 public static function renderProgressMeter(
963 ?int $a_perc_result = null,
964 ?int $a_perc_limit = null,
965 ?int $a_compare_value = null,
966 string $a_caption = null,
967 string $a_url = null,
968 string $a_tt_id = null,
969 string $a_tt_txt = null,
970 string $a_next_step = null,
971 bool $a_sub = false,
972 int $a_sub_style = 30,
973 string $a_main_text = '',
974 string $a_required_text = ''
975 ): string {
976 global $DIC;
977
978 $tpl = new ilTemplate("tpl.objective_progressmeter.html", true, true, "Services/Container");
979
980 $lng = $DIC->language();
981 $lng->loadLanguageModule('crs');
982
983
984
985 if (is_numeric($a_perc_result)) {
986 $uiFactory = $DIC->ui()->factory();
987 $uiRenderer = $DIC->ui()->renderer();
988
989 $pMeter = $uiFactory->chart()->progressMeter()->standard(
990 100,
991 (int) $a_perc_result,
992 (int) $a_perc_limit,
993 (int) $a_compare_value
994 );
995 $tpl->setVariable('PROGRESS_METER', $uiRenderer->render($pMeter));
996 }
997
998 if ($a_caption) {
999 if ($a_url) {
1000 $button = ilLinkButton::getInstance();
1001 $button->setCaption($a_caption, false);
1002 $button->setUrl($a_url);
1003
1004 $tpl->setCurrentBlock("statustxt_bl");
1005 $tpl->setVariable("TXT_PROGRESS_STATUS", $button->render());
1006 } else {
1007 $tpl->setCurrentBlock("statustxt_no_link_bl");
1008 $tpl->setVariable("TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
1009 }
1010 $tpl->parseCurrentBlock();
1011 }
1012
1013 if ($a_next_step) {
1014 //$tpl->setCurrentBlock("nstep_bl");
1015 $tpl->setVariable("TXT_NEXT_STEP", $a_next_step);
1016 //$tpl->parseCurrentBlock();
1017 }
1018
1019 if ($a_tt_id &&
1020 $a_tt_txt) {
1021 ilTooltipGUI::addTooltip($a_tt_id, $a_tt_txt);
1022 }
1023
1024 if ($a_sub) {
1025 $tpl->setVariable("SUB_STYLE", ' style="padding-left: ' . $a_sub_style . 'px;"');
1026 $tpl->setVariable("SUB_INIT", $a_sub);
1027 }
1028
1029 return $tpl->get();
1030 }
1031
1035 public static function getObjectiveResultSummary(
1036 bool $a_has_initial_test,
1037 int $a_objective_id,
1038 ?array $a_lo_result
1039 ): string {
1040 global $DIC;
1041
1042 if ($a_lo_result === null) {
1043 $a_lo_result["type"] = null;
1044 }
1045
1046 $lng = $DIC->language();
1047 $lng->loadLanguageModule('crs');
1048
1049 $is_qualified =
1050 ($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED);
1051 $is_qualified_initial =
1052 (
1053 $a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1054 ilLOSettings::getInstanceByObjId($a_lo_result['course_id'] ?? 0)->isInitialTestQualifying()
1055 );
1056 $has_completed =
1057 (($a_lo_result["status"] ?? 0) == ilLOUserResults::STATUS_COMPLETED);
1058
1059 $next_step = '';
1060
1061 if (
1062 $is_qualified ||
1063 $is_qualified_initial) {
1064 if ($has_completed) {
1065 $next_step = $lng->txt("crs_loc_progress_objective_complete");
1066 } else {
1067 $next_step = $lng->txt("crs_loc_progress_do_qualifying_again");
1068 }
1069 } // initial test
1070 elseif ($a_lo_result["status"] ?? false) {
1071 $next_step =
1072 $has_completed ?
1073 $lng->txt("crs_loc_progress_do_qualifying") :
1074 $lng->txt("crs_loc_suggested");
1075 } else {
1076 $next_step = $a_has_initial_test ?
1077 $lng->txt("crs_loc_progress_no_result_do_initial") :
1078 $lng->txt("crs_loc_progress_no_result_no_initial");
1079 }
1080 return $next_step;
1081 }
1082
1086 public static function buildObjectiveProgressBar(
1087 bool $a_has_initial_test,
1088 int $a_objective_id,
1089 array $a_lo_result,
1090 bool $a_list_mode = false,
1091 bool $a_sub = false,
1092 string $a_tt_suffix = null
1093 ): string {
1094 global $DIC;
1095
1096 $lng = $DIC->language();
1097 $lng->loadLanguageModule('crs');
1098
1099 // tooltip (has to be unique!)
1100
1101 $tooltip_id = "crsobjtvusr_" . $a_objective_id . "_" . $a_lo_result["type"] . "_" . ((int) $a_sub);
1102 if ($a_tt_suffix !== null) {
1103 $tooltip_id .= "_" . $a_tt_suffix;
1104 }
1105
1106 $tt_txt = sprintf(
1107 $lng->txt("crs_loc_tt_info"),
1108 $a_lo_result["result_perc"] ?? '0',
1109 $a_lo_result["limit_perc"] ?? '0'
1110 );
1111
1112
1113 $is_qualified = ($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED);
1114 $is_qualified_initial = ($a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1115 ilLOSettings::getInstanceByObjId($a_lo_result['course_id'] ?? 0)->isInitialTestQualifying());
1116 $has_completed = (($a_lo_result["status"] ?? 0) == ilLOUserResults::STATUS_COMPLETED);
1117
1118 $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = null;
1119 $compare_value = null;
1120
1121 if ($is_qualified ||
1122 $is_qualified_initial) {
1123 $progress_txt = $lng->txt("crs_loc_progress_result_qtest");
1124 $tt_txt = $lng->txt("crs_loc_tab_qtest") . ": " . $tt_txt;
1125
1126 if ($has_completed) {
1127 $next_step = $lng->txt("crs_loc_progress_objective_complete");
1128 $bar_color = "ilCourseObjectiveProgressBarCompleted";
1129
1130 // render 2nd progressbar if there is also an initial test
1131 if ($is_qualified &&
1132 $a_has_initial_test &&
1133 is_array($a_lo_result["initial"])) {
1134 $a_lo_result["initial"]["itest"] = $a_lo_result["itest"];
1135
1136 // force list mode to get rid of next step
1137 #$initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
1138 $compare_value = $a_lo_result['initial']['result_perc'];
1139 }
1140 } else {
1141 $next_step = $lng->txt("crs_loc_progress_do_qualifying_again");
1142 $bar_color = "ilCourseObjectiveProgressBarFailed";
1143 }
1144 }
1145 // initial test
1146 elseif ($a_lo_result["status"] ?? false) {
1147 $progress_txt = $lng->txt("crs_loc_progress_result_itest");
1148 $tt_txt = $lng->txt("crs_loc_tab_itest") . ": " . $tt_txt;
1149
1150 $bar_color = "ilCourseObjectiveProgressBarNeutral";
1151 $next_step = $has_completed
1152 ? $lng->txt("crs_loc_progress_do_qualifying")
1153 : $lng->txt("crs_loc_suggested");
1154 }
1155 // not attempted: no progress bar
1156 else {
1157 $next_step = $a_has_initial_test
1158 ? $lng->txt("crs_loc_progress_no_result_do_initial")
1159 : $lng->txt("crs_loc_progress_no_result_no_initial");
1160 }
1161
1162 // link to test statistics
1163 $relevant_test_id = ($a_lo_result["qtest"] ?? 0)
1164 ?: ($a_lo_result["itest"] ?? 0);
1165 if ($relevant_test_id) {
1166 $test_url = ilLOUtils::getTestResultLinkForUser($relevant_test_id, $a_lo_result["user_id"] ?? 0);
1167 }
1168
1169 $main_text = $lng->txt('crs_loc_itest_info');
1170 if ($a_lo_result['type'] == ilLOSettings::TYPE_TEST_QUALIFIED) {
1171 $main_text = $lng->txt('crs_loc_qtest_info');
1172 }
1173
1174
1175
1176 return self::renderProgressMeter(
1177 $a_lo_result["result_perc"] ?? null,
1178 $a_lo_result["limit_perc"] ?? null,
1179 $compare_value,
1180 $progress_txt,
1181 $test_url,
1182 $tooltip_id,
1183 $tt_txt,
1184 $a_list_mode
1185 ? null
1186 : $next_step,
1187 (bool) $initial_sub,
1188 $a_list_mode
1189 ? 30
1190 : 10,
1191 $main_text,
1192 $lng->txt('crs_lobj_pm_min_goal')
1193 );
1194 }
1195
1196 protected function buildAccordionTitle(
1197 ilCourseObjective $a_objective,
1198 array $a_lo_result = null
1199 ): string {
1200 global $DIC;
1201
1202 $renderer = $DIC->ui()->renderer();
1203 $ui_factory = $DIC->ui()->factory();
1204
1205 $tpl = new ilTemplate("tpl.objective_accordion_title.html", true, true, "Services/Container");
1206
1207 if ($a_lo_result) {
1208 $tpl->setVariable(
1209 "PROGRESS_BAR",
1210 self::buildObjectiveProgressBar(
1211 $this->loc_settings->worksWithInitialTest(),
1212 $a_objective->getObjectiveId(),
1213 $a_lo_result
1214 )
1215 );
1216 }
1217
1218 $tpl->setVariable("TITLE", $this->lng->txt("crs_loc_learning_objective") . ": " . trim($a_objective->getTitle()));
1219 $tpl->setVariable("DESCRIPTION", nl2br(trim($a_objective->getDescription())));
1220
1221 $initial_res = null;
1222 $initial_lim = null;
1223 if ($this->loc_settings->worksWithInitialTest()) {
1224 if (array_key_exists('initial', $a_lo_result)) {
1225 $initial_res = (int) ($a_lo_result['initial']['result_perc'] ?? 0);
1226 $initial_lim = (int) ($a_lo_result['initial']['limit_perc'] ?? 0);
1227 }
1228 if (
1229 $a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1230 isset($a_lo_result['result_perc'])
1231 ) {
1232 $initial_res = (int) ($a_lo_result['result_perc'] ?? 0);
1233 $initial_lim = (int) ($a_lo_result['limit_perc'] ?? 0);
1234 }
1235 }
1236
1237 if ($initial_res !== null) {
1239 $a_lo_result["itest"],
1240 $a_lo_result["user_id"]
1241 );
1242
1243 if ($link !== '') {
1244 $tpl->setCurrentBlock('i_with_link');
1245 $tpl->setVariable(
1246 'IBTN',
1247 $renderer->render(
1248 $ui_factory->button()->shy(
1249 $this->lng->txt('crs_objective_result_details'),
1250 $link
1251 )
1252 )
1253 );
1254 $tpl->parseCurrentBlock();
1255 }
1256
1257 $tpl->setCurrentBlock('res_initial');
1258 $tpl->setVariable(
1259 'IRESULT',
1260 sprintf(
1261 $this->lng->txt('crs_objective_result_summary_initial'),
1262 $initial_res . '%',
1263 (int) $initial_lim . '%'
1264 )
1265 );
1266 $tpl->parseCurrentBlock();
1267 }
1268
1269 $qual_res = null;
1270 $qual_lim = null;
1271
1272 if (($a_lo_result['type'] ?? null) == ilLOUserResults::TYPE_QUALIFIED) {
1273 $qual_res = (int) $a_lo_result['result_perc'];
1274 $qual_lim = (int) $a_lo_result['limit_perc'];
1275 }
1276
1277 if ($qual_res !== null) {
1279 $a_lo_result["qtest"],
1280 $a_lo_result["user_id"]
1281 );
1282
1283 if ($link !== '') {
1284 $tpl->setCurrentBlock('q_with_link');
1285 $tpl->setVariable(
1286 'QBTN',
1287 $renderer->render(
1288 $ui_factory->button()->shy(
1289 $this->lng->txt('crs_objective_result_details'),
1290 $link
1291 )
1292 )
1293 );
1294 $tpl->parseCurrentBlock();
1295 }
1296 $tpl->setCurrentBlock('res_qualifying');
1297 $tpl->setVariable(
1298 'QRESULT',
1299 sprintf(
1300 $this->lng->txt('crs_objective_result_summary_qualifying'),
1301 $qual_res . '%',
1302 (int) $qual_lim . '%'
1303 )
1304 );
1305 $tpl->parseCurrentBlock();
1306 }
1307
1308 $this->logger->dump($a_lo_result);
1309
1310 $summary = self::getObjectiveResultSummary(
1311 $this->loc_settings->worksWithInitialTest(),
1312 $a_objective->getObjectiveId(),
1313 $a_lo_result
1314 );
1315 if ($summary !== '') {
1316 $tpl->setCurrentBlock('objective_summary');
1317 $tpl->setVariable('SUMMARY_TXT', $summary);
1318 $tpl->parseCurrentBlock();
1319 }
1320
1321 // #15510
1322 $tpl->setVariable("ANCHOR_ID", "objtv_acc_" . $a_objective->getObjectiveId());
1323
1324 return $tpl->get();
1325 }
1326
1327 protected function buildAccordionContent(array $a_items): string
1328 {
1329 $tpl = new ilTemplate("tpl.objective_accordion_content.html", true, true, "Services/Container");
1330 foreach ($a_items as $item) {
1331 $tpl->setCurrentBlock("items_bl");
1332 $tpl->setVariable("ITEM", $item);
1333 $tpl->parseCurrentBlock();
1334 }
1335 return $tpl->get();
1336 }
1337
1338 protected function showButton(
1339 string $a_cmd,
1340 string $a_text,
1341 string $a_target = '',
1342 string $a_id = ""
1343 ): void {
1344 $ilToolbar = $this->toolbar;
1345 $ilCtrl = $this->ctrl;
1346
1347 // #11842
1348 $ilToolbar->addButton(
1349 $a_text,
1350 $ilCtrl->getLinkTarget($this->getContainerGUI(), $a_cmd),
1351 $a_target,
1352 null,
1353 '',
1354 $a_id
1355 );
1356 }
1357}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
initRenderer()
Init container renderer.
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
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...
buildAccordionTitle(ilCourseObjective $a_objective, array $a_lo_result=null)
renderObjective(int $a_objective_id, bool &$a_has_lo_page, ilAccordionGUI $a_accordion=null, array $a_lo_result=null)
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
addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item)
ILIAS Style Content Object ObjectFacade $content_style_domain
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.
showButton(string $a_cmd, string $a_text, string $a_target='', string $a_id="")
renderTest(int $a_test_ref_id, int $a_objective_id, bool $a_is_initial=false)
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
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)
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)
__construct(ilContainerGUI $a_container_gui)
showMaterials(int $a_mode=null, bool $a_is_manage=false, bool $a_as_accordion=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilCourseObjectiveMaterials
static _getAssignedMaterials(int $a_objective_id)
static getStatus(int $a_usr_id, int $a_crs_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Settings for LO courses.
static getInstanceByObjId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
check condition
static isParticipantsLastPassActive($testRefId, $userId)
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)
setItemDetailLinks(array $detail_links, string $intro_txt='')
set items detail links
enableCommands(bool $status, bool $std_only=false)
addCustomProperty(string $property="", string $value="", bool $alert=false, bool $newline=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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static addTooltip(string $a_el_id, string $a_text, string $a_container="", string $a_my="bottom center", string $a_at="top center", bool $a_use_htmlspecialchars=true)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
$txt
Definition: error.php:13
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$res
Definition: ltiservices.php:69
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
array $details
Details for error message relating to last request processed.
Definition: System.php:109
getSettings()
Get an array of all setting values.
Definition: System.php:287
global $ilSetting
Definition: privfeed.php:17
$type
$url
$lng