ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilContainerObjectiveGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
25 include_once("./Services/Container/classes/class.ilContainerContentGUI.php");
26 
36 {
40  protected $tabs;
41 
45  protected $toolbar;
46 
47  protected $force_details = 0;
48  protected $loc_settings; // [ilLOSettings]
49 
50  const MATERIALS_TESTS = 1;
51  const MATERIALS_OTHER = 2;
52 
53  private $output_html = '';
54 
55  private $test_assignments = null;
56 
64  public function __construct($a_container_gui)
65  {
66  global $DIC;
67 
68  $this->tabs = $DIC->tabs();
69  $this->access = $DIC->access();
70  $this->user = $DIC->user();
71  $this->settings = $DIC->settings();
72  $this->ctrl = $DIC->ctrl();
73  $this->toolbar = $DIC->toolbar();
74  $lng = $DIC->language();
75 
76  $this->lng = $lng;
77  parent::__construct($a_container_gui);
78 
79  $this->initDetails();
80  $this->initTestAssignments();
81  }
82 
87  public function getTestAssignments()
88  {
90  }
91 
95  public function getSettings()
96  {
97  return $this->loc_settings;
98  }
99 
100 
101 
109  public function getDetailsLevel($a_objective_id)
110  {
111  // no details anymore
112  return self::DETAILS_ALL;
113  }
114 
121  public function getMainContent()
122  {
123  $lng = $this->lng;
124  $ilTabs = $this->tabs;
125  $ilAccess = $this->access;
127 
128  // see bug #7452
129  // $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
130 
131 
132  include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
133 
134  $tpl = new ilTemplate("tpl.container_page.html", true, true, "Services/Container");
135 
136  if ($GLOBALS['ilAccess']->checkAccess('write', '', $this->getContainerObject()->getRefId())) {
137  // check for results
138  include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
139  if (ilLOUserResults::hasResults($this->getContainerObject()->getId(), $GLOBALS['ilUser']->getId())) {
140  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
141  $ilToolbar = new ilToolbarGUI();
142  $ilToolbar->addButton(
143  $lng->txt('crs_reset_results'),
144  $GLOBALS['ilCtrl']->getLinkTargetByClass(get_class($this->getContainerGUI()), 'reset')
145  );
146  }
147  }
148 
149  // Feedback
150  // @todo
151  // $this->__showFeedBack();
152 
153  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
154 
155  $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
156  $is_order = $this->getContainerGUI()->isActiveOrdering();
157 
158  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
159  $this->loc_settings = ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId());
160 
161  $this->initRenderer();
162 
163  if (!$is_manage && !$is_order) {
164  // currently inactive
165  // $this->showStatus($tpl);
166  }
167  if (!$is_manage) {
168  $this->showObjectives($tpl, $is_order);
169 
170  // $this->showMaterials($tpl,self::MATERIALS_TESTS, false, !$is_order);
171 
172  // check for results
173  include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
174  $has_results = ilLOUserResults::hasResults($this->getContainerObject()->getId(), $ilUser->getId());
175 
176  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
177  $tst_obj_id = ilObject::_lookupObjId($this->loc_settings->getInitialTest());
178 
179  if (
180  $this->loc_settings->getInitialTest() &&
181  $this->loc_settings->isGeneralInitialTestVisible() &&
182  !$this->loc_settings->isInitialTestStart() &&
184  ) {
185  $this->output_html .= $this->renderTest($this->loc_settings->getInitialTest(), null, true, true);
186  } elseif (
187  $this->loc_settings->getQualifiedTest() &&
188  $this->loc_settings->isGeneralQualifiedTestVisible()
189  ) {
190  $this->output_html .= $this->renderTest($this->loc_settings->getQualifiedTest(), null, false, true);
191  }
192 
193  $this->showMaterials($tpl, self::MATERIALS_OTHER, false, !$is_order);
194  } else {
195  $this->showMaterials($tpl, null, $is_manage);
196  }
197 
198  // reset results by setting or for admins
199  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
200  if (
201  ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId())->isResetResultsEnabled() or
202  $GLOBALS['ilAccess']->checkAccess('write', '', $this->getContainerObject()->getRefId())
203  ) {
204  if ($has_results) {
205  if (!$is_manage && !$is_order) {
206  $this->showButton('askReset', $lng->txt('crs_reset_results'));
207  }
208  }
209  }
210 
211  $tpl->setVariable('CONTAINER_PAGE_CONTENT', $this->output_html);
212 
213  return $tpl->get();
214  }
215 
223  public function showStatus($tpl)
224  {
226  $lng = $this->lng;
227 
228  include_once('./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
229 
230  $status = ilCourseObjectiveResultCache::getStatus($ilUser->getId(), $this->getContainerObject()->getId());
231  if ($status == IL_OBJECTIVE_STATUS_EMPTY) {
232  return;
233  }
234  $info_tpl = new ilTemplate('tpl.crs_objectives_view_info_table.html', true, true, 'Modules/Course');
235  $info_tpl->setVariable("INFO_STRING", $lng->txt('crs_objectives_info_' . $status));
236 
237  $this->output_html .= $info_tpl->get();
238  }
239 
247  public function showObjectives($a_tpl, $a_is_order = false)
248  {
249  $lng = $this->lng;
251 
253 
254  // get embedded blocks
255  $has_container_page = false;
256  if (!$a_is_order) {
257  $output_html = $this->getContainerGUI()->getContainerPageHTML();
258  if ($output_html != "") {
259  $has_container_page = true;
260  $this->output_html .= $this->insertPageEmbeddedBlocks($output_html);
261  }
262  unset($output_html);
263  }
264 
265  // All objectives
266  include_once './Modules/Course/classes/class.ilCourseObjective.php';
267  if (!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
268  return false;
269  }
270 
271  include_once('./Modules/Course/classes/class.ilCourseObjectiveListGUI.php');
272  $this->objective_list_gui = new ilCourseObjectiveListGUI();
273  $this->objective_list_gui->setContainerObject($this->getContainerGUI());
274  if ($ilSetting->get("icon_position_in_lists") == "item_rows") {
275  $this->objective_list_gui->enableIcon(true);
276  }
277 
278  $acc = null;
279  if (!$a_is_order) {
280  include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
281  $acc = new ilAccordionGUI();
282  $acc->setUseSessionStorage(true);
283  $acc->setAllowMultiOpened(true);
284  $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
285  $acc->setId("crsobjtv_" . $this->container_obj->getId());
286  } else {
287  $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives'));
288  }
289 
290  $lur_data = $this->parseLOUserResults();
291 
292  $has_initial = ilLOSettings::getInstanceByObjId($this->container_obj->getId())->worksWithInitialTest();
293 
294  $has_lo_page = false;
295  $obj_cnt = 0;
296  foreach ($objective_ids as $objective_id) {
297  include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
298  if (
299  $has_initial &&
300  (
301  !isset($lur_data[$objective_id]) or
303  $this->container_obj->getId(),
304  ilLOSettings::getInstanceByObjId($this->container_obj->getId())->getInitialTest(),
305  $objective_id
306  )
307  )
308  ) {
309  $lur_data[$objective_id] = array("type"=>ilLOSettings::TYPE_TEST_INITIAL);
310  }
311 
312  if ($html = $this->renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id])) {
313  $this->renderer->addItemToBlock('lobj', 'lobj', $objective_id, $html);
314  }
315  $obj_cnt++;
316  }
317 
318  // buttons for showing/hiding all objectives
319  if (!$a_is_order && $obj_cnt > 1) {
320  $this->showButton("", $lng->txt("crs_show_all_obj"), "", "crs_show_all_obj_btn");
321  $this->showButton("", $lng->txt("crs_hide_all_obj"), "", "crs_hide_all_obj_btn");
322  $acc->setShowAllElement("crs_show_all_obj_btn");
323  $acc->setHideAllElement("crs_hide_all_obj_btn");
324  }
325 
326  if (!$has_container_page && $has_lo_page) {
327  // add core co page css
328  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
329  $GLOBALS["tpl"]->setVariable(
330  "LOCATION_CONTENT_STYLESHEET",
332  );
333  $GLOBALS["tpl"]->setCurrentBlock("SyntaxStyle");
334  $GLOBALS["tpl"]->setVariable(
335  "LOCATION_SYNTAX_STYLESHEET",
337  );
338  $GLOBALS["tpl"]->parseCurrentBlock();
339  }
340 
341  // order/block
342  if ($a_is_order) {
343  $this->addFooterRow();
344 
345  $this->output_html .= $output_html . $this->renderer->getHTML();
346 
347  $this->renderer->resetDetails();
348  }
349  // view/accordion
350  else {
351  $this->output_html .= "<div class='ilCrsObjAcc'>" . $acc->getHTML() . "</div>";
352  }
353  }
354 
362  public function addFooterRow()
363  {
364  // no details
365  return;
366 
367  /*
368  $ilCtrl = $this->ctrl;
369 
370  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getContainerObject()->getRefId());
371  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "1");
372  $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
373  $this->renderer->addDetailsLevel(2, $url, ($this->details_level == self::DETAILS_TITLE));
374 
375  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "2");
376  $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
377  $this->renderer->addDetailsLevel(3, $url, ($this->details_level == self::DETAILS_ALL));
378 
379  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
380  */
381  }
382 
383  protected function renderTest($a_test_ref_id, $a_objective_id, $a_is_initial = false, $a_add_border = false, $a_lo_result = array())
384  {
385  $node_data = [];
386  if ($a_test_ref_id) {
387  $node_data = $GLOBALS['tree']->getNodeData($a_test_ref_id);
388  }
389  if (!$node_data['child']) {
390  return '';
391  }
392 
393  // update ti
394  if ($a_objective_id) {
395  if ($a_is_initial) {
396  $title = sprintf($this->lng->txt('crs_loc_itst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
397  } else {
398  $title = sprintf($this->lng->txt('crs_loc_qtst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
399  }
400  $node_data['objective_id'] = $a_objective_id;
401  $node_data['objective_status'] =
402  (
403  $a_lo_result['status'] == ilLOUserResults::STATUS_COMPLETED ?
404  false :
405  false
406  );
407  } else {
408  $obj_id = ilObject::_lookupObjId($a_test_ref_id);
409  $title = ilObject::_lookupTitle($obj_id);
410 
411  $title .= (
412  ' (' .
413  (
414  $a_is_initial
415  ? $this->lng->txt('crs_loc_itest_info')
416  : $this->lng->txt('crs_loc_qtest_info')
417  ) .
418  ')'
419  );
420  $node_data['objective_id'] = 0;
421  }
422 
423  $node_data['title'] = $title;
424 
425  return "<div class='ilContObjectivesViewTestItem'>" . $this->renderItem($node_data) . "</div>";
426  }
427 
435  public function showMaterials($a_tpl, $a_mode = null, $a_is_manage = false, $a_as_accordion = false)
436  {
437  $ilAccess = $this->access;
438  $lng = $this->lng;
439 
441 
442  if (is_array($this->items["_all"])) {
443  $this->objective_map = $this->buildObjectiveMap();
444 
445  // all rows
446  $item_r = array();
447 
448  $position = 1;
449  foreach ($this->items["_all"] as $k => $item_data) {
450  if ($a_mode == self::MATERIALS_TESTS and $item_data['type'] != 'tst') {
451  continue;
452  }
453  if ($item_data['type'] == 'itgr') {
454  continue;
455  }
456  if (!$a_is_manage) {
457  // if test object is qualified or initial do not show here
458  include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
459  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
460  $assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
461  if ($assignments->getTypeByTest($item_data['child']) != ilLOSettings::TYPE_TEST_UNDEFINED) {
462  continue;
463  }
464  }
465 
466  if ($this->rendered_items[$item_data["child"]] !== true &&
467  !$this->renderer->hasItem($item_data["child"])) {
468  $this->rendered_items[$item_data['child']] = true;
469 
470  // TODO: Position (DONE ?)
471  $html = $this->renderItem($item_data, $position++, $a_mode == self::MATERIALS_TESTS ? false : true);
472  if ($html != "") {
473  $item_r[] = array("html" => $html, "id" => $item_data["child"], "type" => $item_data["type"]);
474  }
475  }
476  }
477 
478  // if we have at least one item, output the block
479  if (count($item_r) > 0) {
480  if (!$a_as_accordion) {
481  $pos = 0;
482 
483  switch ($a_mode) {
484  case self::MATERIALS_TESTS:
485  $block_id = "tst";
486  $this->renderer->addTypeBlock($block_id);
487  break;
488 
489  case self::MATERIALS_OTHER:
490  $block_id = "oth";
491  $this->renderer->addCustomBlock($block_id, $lng->txt('crs_other_resources'));
492  break;
493 
494  // manage
495  default:
496  $block_id = "all";
497  $this->renderer->addCustomBlock($block_id, $lng->txt('content'));
498  break;
499  }
500 
501  // :TODO:
502  if ($a_mode != self::MATERIALS_TESTS) {
503  $pos = $this->getItemGroupsHTML();
504  }
505 
506  foreach ($item_r as $h) {
507  if (!$this->renderer->hasItem($h["id"])) {
508  $this->renderer->addItemToBlock($block_id, $h["type"], $h["id"], $h["html"]);
509  }
510  }
511 
512  $this->output_html .= $this->renderer->getHTML();
513  } else {
514  switch ($a_mode) {
515  case self::MATERIALS_TESTS:
516  $txt = $lng->txt('objs_tst');
517  break;
518 
519  case self::MATERIALS_OTHER:
520  $txt = $lng->txt('crs_other_resources');
521  break;
522  }
523 
524  include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
525  $acc = new ilAccordionGUI();
526  $acc->setId("crsobjtvmat" . $a_mode . "_" . $this->container_obj->getId());
527 
528  $acc_content = array();
529  foreach ($item_r as $h) {
530  $acc_content[] = $h["html"];
531  }
532  $acc->addItem($txt, $this->buildAccordionContent($acc_content));
533 
534  $this->output_html .= $acc->getHTML();
535  }
536  }
537  }
538  }
539 
540  protected function buildObjectiveMap()
541  {
542  $objective_map = array();
543  include_once './Modules/Course/classes/class.ilCourseObjective.php';
544  // begin-patch lok
545  if (count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
546  // end-patch lok
547  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
548  foreach ($objective_ids as $objective_id) {
549  foreach (ilCourseObjectiveMaterials::_getAssignedMaterials($objective_id) as $mat_ref_id) {
550  $objective_map["material"][$mat_ref_id][] = $objective_id;
551 
552  if (!isset($objective_map["names"][$objective_id])) {
553  $objective = new ilCourseObjective($this->getContainerObject(), $objective_id);
554  $objective_map["names"][$objective_id] = $objective->getTitle();
555  }
556  }
557  }
558 
559  // initial/qualifying test
560  $tst = $this->loc_settings->getInitialTest();
561  if ($tst) {
562  $objective_map["test_i"] = $tst;
563  }
564  $tst = $this->loc_settings->getQualifiedTest();
565  if ($tst) {
566  $objective_map["test_q"] = $tst;
567  }
568 
569  // objective test assignments
570  include_once 'Modules/Course/classes/Objectives/class.ilLOSettings.php';
571  include_once 'Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
572  $ass_test = new ilLOTestAssignments($this->getContainerObject()->getId());
573  foreach ($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_INITIAL) as $ass) {
574  $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
575  $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
576  }
577  foreach ($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_QUALIFIED) as $ass) {
578  $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
579  $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
580  }
581  }
582 
583  return $objective_map;
584  }
585 
586  protected function addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item)
587  {
588  $lng = $this->lng;
590 
591  $item_ref_id = $a_item["ref_id"];
592 
593  if (is_array($this->objective_map)) {
594  $details = array();
595  if (isset($this->objective_map["material"][$item_ref_id])) {
596  // #12965
597  foreach ($this->objective_map["material"][$item_ref_id] as $objective_id) {
598  $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $objective_id);
599  $url = $ilCtrl->getLinkTargetByClass(array('illoeditorgui', 'ilcourseobjectivesgui'), 'edit');
600  $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', '');
601 
602  $details[] = array(
603  'desc' => $lng->txt('crs_loc_tab_materials') . ': ',
604  'target' => '_top',
605  'link' => $url,
606  'name' => $this->objective_map["names"][$objective_id]
607  );
608  }
609  }
610  if ($this->objective_map["test_i"] == $item_ref_id) {
611  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
612  $details[] = array(
613  'desc' => '',
614  'target' => '_top',
615  'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
616  'name' => $lng->txt('crs_loc_tab_itest')
617  );
618  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
619  }
620  if ($this->objective_map["test_q"] == $item_ref_id) {
621  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
622  $details[] = array(
623  'desc' => '',
624  'target' => '_top',
625  'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
626  'name' => $lng->txt('crs_loc_tab_qtest')
627  );
628  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
629  }
630 
631  // #15367
632  if (is_array($this->objective_map["test_ass"][$item_ref_id])) {
633  foreach ($this->objective_map["test_ass"][$item_ref_id] as $type => $items) {
635  $caption = $lng->txt('crs_loc_tab_itest');
636  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
637  } else {
638  $caption = $lng->txt('crs_loc_tab_qtest');
639  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
640  }
641  foreach ($items as $objtv_title) {
642  $details[] = array(
643  'desc' => '',
644  'target' => '_top',
645  'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testsOverview'),
646  'name' => $caption . " (" . $this->lng->txt("crs_loc_learning_objective") . ": " . $objtv_title . ")"
647  );
648  }
649  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
650  }
651  }
652 
653  if (sizeof($details)) {
654  $a_item_list_gui->enableItemDetailLinks(true);
655  $a_item_list_gui->setItemDetailLinks($details, $lng->txt('crs_loc_settings_tbl') . ': ');
656  } else {
657  $a_item_list_gui->enableItemDetailLinks(false);
658  }
659  }
660 
661  // order
662  if ($this->getContainerGUI()->isActiveOrdering()) {
663  $a_item_list_gui->enableCommands(true, true);
664  $a_item_list_gui->enableProperties(false);
665  }
666  // view
667  elseif (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
668  $a_item_list_gui->enableCommands(true, true);
669  $a_item_list_gui->enableProperties(false);
670  }
671 
672  if ($a_item['objective_id']) {
673  $a_item_list_gui->setDefaultCommandParameters(array('objective_id' => $a_item['objective_id']));
674 
675 
676  if ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) {
677  $a_item_list_gui->setConditionTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj');
678  // check conditions of target
679  include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
680  $fullfilled = ilConditionHandler::_checkAllConditionsOfTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj');
681  if (!$fullfilled || $a_item['objective_status']) {
682  $a_item_list_gui->disableTitleLink(true);
683  }
684  }
685  include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
687  $this->getContainerObject()->getId(),
688  $GLOBALS['ilUser']->getId(),
689  $a_item['objective_id'],
691  );
692 
693  $res = $this->updateResult($res, $a_item['ref_id'], $a_item['objective_id'], $GLOBALS['ilUser']->getId());
694 
695  if ($res['is_final']) {
696  $a_item_list_gui->disableTitleLink(true);
697  $a_item_list_gui->enableProperties(true);
698  $a_item_list_gui->addCustomProperty(
699  $this->lng->txt('crs_loc_passes_reached'),
700  '',
701  true
702  );
703  } elseif ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) {
704  include_once './Modules/Course/classes/class.ilCourseObjective.php';
705  $poss_pass = ilCourseObjective::lookupMaxPasses($a_item['objective_id']);
706 
707  if ($poss_pass) {
708  $a_item_list_gui->enableProperties(true);
709  $a_item_list_gui->addCustomProperty(
710  $this->lng->txt('crs_loc_passes_left'),
711  (($poss_pass - $res['tries']) > 0) ? ($poss_pass - $res['tries']) : 1,
712  false
713  );
714  }
715  }
716  }
717  }
718 
719  protected function updateResult($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
720  {
721  if ($this->loc_settings->getQualifiedTest() == $a_item_ref_id) {
722  // Check for existing test run, and decrease tries, reset final if run exists
723  include_once './Modules/Test/classes/class.ilObjTest.php';
724  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
726  $a_item_ref_id,
727  $a_user_id
728  );
729 
730  if ($active) {
731  include_once './Modules/Course/classes/Objectives/class.ilLOTestRun.php';
733  ilObject::_lookupObjId($a_item_ref_id),
734  $a_objective_id,
735  $a_user_id
736  )) {
737  ($a_res['tries'] > 0) ? --$a_res['tries'] : 0;
738  $a_res['is_final'] = 0;
739  }
740  }
741  }
742  return $a_res;
743  }
744 
755  protected function renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion = null, array $a_lo_result = null)
756  {
758  $lng = $this->lng;
759 
760  include_once('./Modules/Course/classes/class.ilCourseObjective.php');
761  $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id);
762 
763  include_once('./Services/Container/classes/class.ilContainerSorting.php');
764  include_once('./Services/Object/classes/class.ilObjectActivation.php');
765  $items = ilObjectActivation::getItemsByObjective($a_objective_id);
766 
767  // sorting is handled by ilCourseObjectiveMaterials
768  // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
769 
770  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
771  $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
772 
773  // #13381 - map material assignment to position
774  $sort_map = array();
775  foreach ($objectives_lm_obj->getMaterials() as $item) {
776  $sort_map[$item["lm_ass_id"]] = $item["position"];
777  }
778 
779  $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
780  $is_order = $this->getContainerGUI()->isActiveOrdering();
781 
782  $sort_content = array();
783 
784  foreach ($items as $item) {
785  if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
786  continue;
787  }
788 
789  $item_list_gui2 = $this->getItemGUI($item);
790  $item_list_gui2->enableIcon(true);
791 
792  if ($is_order || $a_accordion) {
793  $item_list_gui2->enableCommands(true, true);
794  $item_list_gui2->enableProperties(false);
795  }
796 
797  $chapters = $objectives_lm_obj->getChapters();
798  if (count($chapters)) {
799  $has_sections = false;
800  foreach ($chapters as $chapter) {
801  if ($chapter['ref_id'] != $item['child']) {
802  continue;
803  }
804  $has_sections = true;
805 
806  include_once './Modules/LearningModule/classes/class.ilLMObject.php';
807  $title = $item['title'] .
808  " &rsaquo; " . ilLMObject::_lookupTitle($chapter['obj_id']) .
809  " (" . $lng->txt('obj_' . $chapter['type']) . ")";
810 
811  $item_list_gui2->setDefaultCommandParameters(array(
812  "obj_id" => $chapter['obj_id'],
813  "focus_id" => $chapter['obj_id'],
814  "focus_return" => $this->container_obj->getRefId()));
815 
816  if ($is_order) {
817  $item_list_gui2->setPositionInputField(
818  "[lobj][" . $a_objective_id . "][" . $chapter['lm_ass_id'] . "]",
819  sprintf('%d', $chapter['position']*10)
820  );
821  }
822 
823  $sub_item_html = $item_list_gui2->getListItemHTML(
824  $item['ref_id'],
825  $item['obj_id'],
826  $title,
827  $item['description']
828  );
829 
830  // #13381 - use materials order
831  $sort_key = str_pad($chapter['position'], 5, 0, STR_PAD_LEFT) . "_" . strtolower($title) . "_" . $chapter['lm_ass_id'];
832  $sort_content[$sort_key] = $sub_item_html;
833  }
834  }
835 
836  $this->rendered_items[$item['child']] = true;
837 
838  if ($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true)) {
839  if ($is_order) {
840  $item_list_gui2->setPositionInputField(
841  "[lobj][" . $a_objective_id . "][" . $lm_ass_id . "]",
842  sprintf('%d', $sort_map[$lm_ass_id]*10)
843  );
844  }
845 
846  $sub_item_html = $item_list_gui2->getListItemHTML(
847  $item['ref_id'],
848  $item['obj_id'],
849  $item['title'],
850  $item['description']
851  );
852 
853  // #13381 - use materials order
854  $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . "_" . strtolower($item['title']) . "_" . $lm_ass_id;
855  $sort_content[$sort_key] = $sub_item_html;
856  }
857  }
858 
859  if ($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL) {
860  $this->objective_list_gui->enableCommands(false);
861  } else {
862  $this->objective_list_gui->enableCommands(true);
863  }
864 
865  if ($is_order) {
866  $this->objective_list_gui->setPositionInputField(
867  "[lobj][" . $a_objective_id . "][0]",
868  $objective->__getPosition()*10
869  );
870  }
871 
872  ksort($sort_content);
873 
874  if (!$a_accordion) {
875  foreach ($sort_content as $sub_item_html) {
876  $this->objective_list_gui->addSubItemHTML($sub_item_html);
877  }
878 
879  return $this->objective_list_gui->getObjectiveListItemHTML(
880  0,
881  $a_objective_id,
882  $objective->getTitle(),
883  $objective->getDescription(),
884  ($is_manage || $is_order)
885  );
886  } else {
887  $acc_content = $sort_content;
888 
889  $initial_shown = false;
890  $initial_test_ref_id = $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL);
891  $initial_test_obj_id = ilObject::_lookupObjId($initial_test_ref_id);
892  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
893 
894  if (
895  $initial_test_obj_id &&
896  $this->getSettings()->hasSeparateInitialTests() &&
898  ) {
899  $acc_content[] = $this->renderTest(
900  $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL),
901  $a_objective_id,
902  true,
903  false,
904  $a_lo_result
905  );
906  $initial_shown = true;
907  } elseif ($this->getSettings()->hasSeparateQualifiedTests()) {
908  $acc_content[] = $this->renderTest(
909  $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED),
910  $a_objective_id,
911  false,
912  false,
913  $a_lo_result
914  );
915  }
916 
917 
918  /*
919  if($this->loc_settings->getInitialTest() &&
920  $this->loc_settings->getType() == ilLOSettings::LOC_INITIAL_SEL &&
921  !$a_lo_risult["initial_status"])
922  {
923  $acc_content[] = $this->renderTest($this->loc_settings->getInitialTest(), $a_objective_id, true, false, $a_lo_result);
924  $initial_shown = true;
925  }
926  if(!$initial_shown &&
927  $this->loc_settings->getQualifiedTest() &&
928  $this->loc_settings->isQualifiedTestPerObjectiveVisible())
929  {
930  $acc_content[] = $this->renderTest($this->loc_settings->getQualifiedTest(), $a_objective_id, false, false, $a_lo_result);
931  }
932  */
933 
934  $co_page = null;
935  include_once("./Services/COPage/classes/class.ilPageUtil.php");
936  if (ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId())) {
937  $a_has_lo_page = true;
938 
939  include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
940  $page_gui = new ilLOPageGUI($objective->getObjectiveId());
941 
942  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
943  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
944  $page_gui->setPresentationTitle("");
945  $page_gui->setTemplateOutput(false);
946  $page_gui->setHeader("");
947 
948  $co_page = "<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . "</div>";
949  }
950 
951  $a_accordion->addItem(
952  $this->buildAccordionTitle($objective, $a_lo_result),
953  $co_page .
954  $this->buildAccordionContent($acc_content),
955  (isset($_GET["oobj"]) && (int) $_GET["oobj"] == $objective->getObjectiveId())
956  );
957  }
958  }
959 
967  protected function initDetails()
968  {
970 
971  // no details
972  return;
973  }
974 
975  protected function initTestAssignments()
976  {
977  include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
978  $this->test_assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
979  }
980 
986  protected function parseLOUserResults()
987  {
989 
990  $res = array();
991 
992  include_once "Modules/Course/classes/Objectives/class.ilLOTestAssignments.php";
993  $lo_ass = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
994 
995  include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
996  $lur = new ilLOUserResults($this->getContainerObject()->getId(), $ilUser->getId());
997  foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
998  // show either initial or qualified for objective
999  if (isset($types[ilLOUserResults::TYPE_INITIAL])) {
1000  $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
1001  }
1002 
1003  // qualified test has priority
1004  if (isset($types[ilLOUserResults::TYPE_QUALIFIED])) {
1007  $result["initial"] = $types[ilLOUserResults::TYPE_INITIAL];
1008  } else {
1011  }
1012 
1013  $result["initial_status"] = $initial_status;
1014 
1015  $result["itest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
1016  $result["qtest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
1017 
1018  $res[$objective_id] = $result;
1019  }
1020 
1021  return $res;
1022  }
1023 
1039  public static function 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)
1040  {
1041  $tpl = new ilTemplate("tpl.objective_progressbar.html", true, true, "Services/Container");
1042 
1043  if ($a_perc_result !== null) {
1044  $tpl->setCurrentBlock("statusbar_bl");
1045  $tpl->setVariable("PERC_STATUS", $a_perc_result);
1046  $tpl->setVariable("PERC_WIDTH", $a_perc_result);
1047  $tpl->setVariable("PERC_COLOR", $a_css);
1048  if ($a_perc_limit) {
1049  // :TODO: magic?
1050  $limit_pos = (99-(int) $a_perc_limit)*-1;
1051  $tpl->setVariable("LIMIT_POS", $limit_pos);
1052  }
1053  if ($a_tt_txt &&
1054  $a_tt_id) {
1055  $tpl->setVariable("TT_ID", $a_tt_id);
1056  }
1057  $tpl->parseCurrentBlock();
1058  }
1059 
1060  if ($a_caption) {
1061  if ($a_url) {
1062  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1063  $button = ilLinkButton::getInstance();
1064  $button->setCaption($a_caption, false);
1065  $button->setUrl($a_url);
1066 
1067  $tpl->setCurrentBlock("statustxt_bl");
1068  $tpl->setVariable("TXT_PROGRESS_STATUS", $button->render());
1069  $tpl->parseCurrentBlock();
1070  } else {
1071  $tpl->setCurrentBlock("statustxt_no_link_bl");
1072  $tpl->setVariable("TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
1073  $tpl->parseCurrentBlock();
1074  }
1075  }
1076 
1077  if ($a_next_step) {
1078  $tpl->setCurrentBlock("nstep_bl");
1079  $tpl->setVariable("TXT_NEXT_STEP", $a_next_step);
1080  $tpl->parseCurrentBlock();
1081  }
1082 
1083  if ($a_tt_id &&
1084  $a_tt_txt) {
1085  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1086  ilTooltipGUI::addTooltip($a_tt_id, $a_tt_txt);
1087  }
1088 
1089  if ($a_sub) {
1090  $tpl->setVariable("SUB_STYLE", ' style="padding-left: ' . $a_sub_style . 'px;"');
1091  $tpl->setVariable("SUB_INIT", $a_sub);
1092  }
1093 
1094  return $tpl->get();
1095  }
1096 
1108  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)
1109  {
1110  global $DIC;
1111 
1112  $lng = $DIC->language();
1113 
1114  // tooltip (has to be unique!)
1115 
1116  $tooltip_id = "crsobjtvusr_" . $a_objective_id . "_" . $a_lo_result["type"] . "_" . ((int) $a_sub);
1117  if ($a_tt_suffix !== null) {
1118  $tooltip_id .= "_" . $a_tt_suffix;
1119  }
1120 
1121  $tt_txt = sprintf(
1122  $lng->txt("crs_loc_tt_info"),
1123  $a_lo_result["result_perc"],
1124  $a_lo_result["limit_perc"]
1125  );
1126 
1127 
1128  include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
1129  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
1130 
1131  $is_qualified = ($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED);
1132  $is_qualified_initial = ($a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1133  ilLOSettings::getInstanceByObjId($a_lo_result['course_id'])->isInitialTestQualifying());
1134  $has_completed = ($a_lo_result["status"] == ilLOUserResults::STATUS_COMPLETED);
1135 
1136  $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = null;
1137 
1138  if ($is_qualified ||
1139  $is_qualified_initial) {
1140  $progress_txt = $lng->txt("crs_loc_progress_result_qtest");
1141  $tt_txt = $lng->txt("crs_loc_tab_qtest") . ": " . $tt_txt;
1142 
1143  if ($has_completed) {
1144  $next_step = $lng->txt("crs_loc_progress_objective_complete");
1145  $bar_color = "ilCourseObjectiveProgressBarCompleted";
1146 
1147  // render 2nd progressbar if there is also an initial test
1148  if ($is_qualified &&
1149  $a_has_initial_test &&
1150  is_array($a_lo_result["initial"])) {
1151  $a_lo_result["initial"]["itest"] = $a_lo_result["itest"];
1152 
1153  // force list mode to get rid of next step
1154  $initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
1155  }
1156  } else {
1157  $next_step = $lng->txt("crs_loc_progress_do_qualifying_again");
1158  $bar_color = "ilCourseObjectiveProgressBarFailed";
1159  }
1160  }
1161  // initial test
1162  else {
1163  if ($a_lo_result["status"]) {
1164  $progress_txt = $lng->txt("crs_loc_progress_result_itest");
1165  $tt_txt = $lng->txt("crs_loc_tab_itest") . ": " . $tt_txt;
1166 
1167  $bar_color = "ilCourseObjectiveProgressBarNeutral";
1168  $next_step = $has_completed
1169  ? $lng->txt("crs_loc_progress_do_qualifying")
1170  : $lng->txt("crs_loc_suggested");
1171  }
1172  // not attempted: no progress bar
1173  else {
1174  $next_step = (bool) $a_has_initial_test
1175  ? $lng->txt("crs_loc_progress_no_result_do_initial")
1176  : $lng->txt("crs_loc_progress_no_result_no_initial");
1177  }
1178  }
1179 
1180  // link to test results
1181  // - first try to fetch a link for qualifying test results
1182  if ($a_lo_result["qtest"]) {
1183  $test_url = ilLOUtils::getTestResultLinkForUser($a_lo_result["qtest"], $a_lo_result["user_id"]);
1184  }
1185  // - when no qualifiying test results link was fetched, try for initial test
1186  if (!$test_url && $a_lo_result["itest"]) {
1187  $test_url = ilLOUtils::getTestResultLinkForUser($a_lo_result["itest"], $a_lo_result["user_id"]);
1188  }
1189 
1190  return self::renderProgressBar(
1191  $a_lo_result["result_perc"],
1192  $a_lo_result["limit_perc"],
1193  $bar_color,
1194  $progress_txt,
1195  $test_url,
1196  $tooltip_id,
1197  $tt_txt,
1198  $a_list_mode
1199  ? null
1200  : $next_step,
1201  $initial_sub,
1202  $a_list_mode
1203  ? 30
1204  : 10
1205  );
1206  }
1207 
1208  protected function buildAccordionTitle(ilCourseObjective $a_objective, array $a_lo_result = null)
1209  {
1210  $tpl = new ilTemplate("tpl.objective_accordion_title.html", true, true, "Services/Container");
1211 
1212  if ($a_lo_result) {
1213  $tpl->setVariable(
1214  "PROGRESS_BAR",
1215  self::buildObjectiveProgressBar(
1216  (bool) $this->loc_settings->worksWithInitialTest(),
1217  $a_objective->getObjectiveId(),
1218  $a_lo_result
1219  )
1220  );
1221  }
1222 
1223  // $tpl->setVariable("ICON_SRC", ilObject::_getIcon($a_objective->getObjectiveId(), "small", "lobj"));
1224  // $tpl->setVariable("ICON_TXT", $this->lng->txt("icon")." ".$this->lng->txt("crs_objectives"));
1225  $tpl->setVariable("TITLE", $this->lng->txt("crs_loc_learning_objective") . ": " . trim($a_objective->getTitle()));
1226  $tpl->setVariable("DESCRIPTION", nl2br(trim($a_objective->getDescription())));
1227 
1228  // #15510
1229  $tpl->setVariable("ANCHOR_ID", "objtv_acc_" . $a_objective->getObjectiveId());
1230 
1231  return $tpl->get();
1232  }
1233 
1234  protected function buildAccordionContent(array $a_items)
1235  {
1236  $tpl = new ilTemplate("tpl.objective_accordion_content.html", true, true, "Services/Container");
1237  foreach ($a_items as $item) {
1238  $tpl->setCurrentBlock("items_bl");
1239  $tpl->setVariable("ITEM", $item);
1240  $tpl->parseCurrentBlock();
1241  }
1242  return $tpl->get();
1243  }
1244 
1252  protected function showButton($a_cmd, $a_text, $a_target = '', $a_id = "")
1253  {
1254  $ilToolbar = $this->toolbar;
1255  $ilCtrl = $this->ctrl;
1256 
1257  // #11842
1258  $ilToolbar->addButton(
1259  $a_text,
1260  $ilCtrl->getLinkTarget($this->getContainerGUI(), $a_cmd),
1261  $a_target,
1262  "",
1263  '',
1264  $a_id
1265  );
1266  }
1267 }
static getInstanceByObjId($a_obj_id)
get singleton instance
static addTooltip( $a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
Adds a tooltip to an HTML element.
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
static getInstance($a_container_id)
Get instance by container id.
getMainContent()
Impementation of abstract method getMainContent.
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item)
const IL_OBJECTIVE_STATUS_EMPTY
$result
showObjectives($a_tpl, $a_is_order=false)
show objectives
static lookupMaxPasses($a_objective_id)
$type
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$h
static lookupRunExistsForObjective($a_test_id, $a_objective_id, $a_user_id)
type $ilDB
enableProperties($a_status)
En/disable properties.
Settings for LO courses.
static lookupResult($a_course_obj_id, $a_user_id, $a_objective_id, $a_tst_type)
Lookup user result.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
static hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
static _getObjectiveIds($course_id, $a_activated_only=false)
__construct($a_container_gui)
Constructor.
static _lookupTitle($a_id)
lookup object title
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
initRenderer()
Init container renderer.
static _lookupTitle($a_obj_id)
Lookup title.
user()
Definition: user.php:4
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
buildAccordionTitle(ilCourseObjective $a_objective, array $a_lo_result=null)
Parent class of all container content GUIs.
global $ilCtrl
Definition: ilias.php:18
addCustomProperty( $a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
class ilCourseObjectiveMaterials
parseLOUserResults()
Parse learning objective results.
foreach($_POST as $key=> $value) $res
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
getContainerGUI()
Get container GUI object.
class ilcourseobjective
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
Class ilObjectListGUI.
getContainerObject()
Get container object.
static getStatus($a_usr_id, $a_crs_id)
get status of user
$ilUser
Definition: imgupload.php:18
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
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
$txt
Definition: error.php:11
enableCommands($a_status, $a_std_only=false)
En/disable commands.
(Course) learning objective page GUI class
Create styles array
The data for the language used.
static _getAssignedMaterials($a_objective_id)
get assigned materials
clearAdminCommandsDetermination()
cleaer administration commands determination
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.
renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion=null, array $a_lo_result=null)
render objective
showButton($a_cmd, $a_text, $a_target='', $a_id="")
show action button
setDefaultCommandParameters(array $a_params)
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
settings()
Definition: settings.php:2
renderTest($a_test_ref_id, $a_objective_id, $a_is_initial=false, $a_add_border=false, $a_lo_result=array())
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
static getTestResultLinkForUser($a_test_ref_id, $a_user_id)
static getItemsByObjective($a_objective_id)
Get objective items.
global $ilSetting
Definition: privfeed.php:17
List gui for course objectives.
$url
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)
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static isParticipantsLastPassActive($testRefId, $userId)
Accordion user interface class.
getTestAssignments()
Get test assignments object.
$html
Definition: example_001.php:87
static hasResults($a_container_id, $a_user_id)
getDetailsLevel($a_objective_id)
get details level
GUI class for course objective view.
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.