ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContainerObjectiveGUI Class Reference

GUI class for course objective view. More...

+ Inheritance diagram for ilContainerObjectiveGUI:
+ Collaboration diagram for ilContainerObjectiveGUI:

Public Member Functions

 __construct ($a_container_gui)
 Constructor. More...
 
 getTestAssignments ()
 Get test assignments object. More...
 
 getSettings ()
 
 getDetailsLevel ($a_objective_id)
 get details level More...
 
 getMainContent ()
 Impementation of abstract method getMainContent. More...
 
 showStatus ($tpl)
 show status More...
 
 showObjectives ($a_tpl, $a_is_order=false)
 show objectives More...
 
 addFooterRow ()
 add footer row More...
 
 showMaterials ($a_tpl, $a_mode=null, $a_is_manage=false, $a_as_accordion=false)
 Show all other (no assigned tests, no assigned materials) materials. More...
 
- Public Member Functions inherited from ilContainerContentGUI
 __construct (&$container_gui_obj)
 Constructor. More...
 
 getContainerObject ()
 Get container object. More...
 
 getContainerGUI ()
 Get container GUI object. More...
 
 setOutput ()
 Sets view output into column layout. More...
 
 getMainContent ()
 Get content HTML for main column, this one must be overwritten in derived classes. More...
 
 determinePageEmbeddedBlocks ($a_container_page_html)
 Determine all blocks that are embedded in the container page. More...
 
 addEmbeddedBlock ($block_type, $block_parameter)
 Add embedded block. More...
 
 getEmbeddedBlocks ()
 Get page embedded blocks. More...
 
 renderPageEmbeddedBlocks ()
 Render Page Embedded Blocks. More...
 
 renderItem ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render an item. More...
 
 renderCard ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render card. More...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. More...
 
 getSingleTypeBlockAsynch ($type)
 Render single block. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 getIntroduction ()
 Get introduction. More...
 
 getItemGroupsHTML ($a_pos=0)
 Get item groups HTML. More...
 
 renderItemGroup ($a_itgr)
 Render item group. More...
 

Static Public Member Functions

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) More...
 
static renderProgressMeter ( $a_perc_result=null, $a_perc_limit=null, $a_compare_value=null, $a_caption=null, $a_url=null, $a_tt_id=null, $a_tt_txt=null, $a_next_step=null, $a_sub=false, $a_sub_style=30, $a_main_text='', $a_required_text='')
 Render progress bar(s) More...
 
static getObjectiveResultSummary ($a_has_initial_test, $a_objective_id, $a_lo_result)
 Get objective result summary. More...
 
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. More...
 

Data Fields

const MATERIALS_TESTS = 1
 
const MATERIALS_OTHER = 2
 
- Data Fields inherited from ilContainerContentGUI
const DETAILS_DEACTIVATED = 0
 
const DETAILS_TITLE = 1
 
const DETAILS_ALL = 2
 
const VIEW_MODE_LIST = 0
 
const VIEW_MODE_TILE = 1
 
 $container_gui
 
 $container_obj
 

Protected Member Functions

 renderTest ($a_test_ref_id, $a_objective_id, $a_is_initial=false, $a_add_border=false, $a_lo_result=array())
 
 buildObjectiveMap ()
 
 addItemDetails (ilObjectListGUI $a_item_list_gui, array $a_item)
 
 updateResult ($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
 
 renderObjective ($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion=null, array $a_lo_result=null)
 render objective More...
 
 initDetails ()
 init details More...
 
 initTestAssignments ()
 
 parseLOUserResults ()
 Parse learning objective results. More...
 
 buildAccordionTitle (ilCourseObjective $a_objective, array $a_lo_result=null)
 
 buildAccordionContent (array $a_items)
 
 showButton ($a_cmd, $a_text, $a_target='', $a_id="")
 show action button More...
 
- Protected Member Functions inherited from ilContainerContentGUI
 getViewMode ()
 Get view mode. More...
 
 getDetailsLevel ($a_item_id)
 get details level More...
 
 getRightColumnHTML ()
 Get HTML for right column. More...
 
 getCenterColumnHTML ()
 Get HTML for center column. More...
 
 initRenderer ()
 Init container renderer. More...
 
 clearAdminCommandsDetermination ()
 cleaer administration commands determination More...
 
 determineAdminCommands ($a_ref_id, $a_admin_com_included_in_list=false)
 determin admin commands More...
 
 getItemGUI ($item_data, $a_show_path=false)
 Get ListGUI object for item. More...
 

Protected Attributes

 $tabs
 
 $toolbar
 
 $force_details = 0
 
 $loc_settings
 
- Protected Attributes inherited from ilContainerContentGUI
 $tpl
 
 $ctrl
 
 $user
 
 $lng
 
 $access
 
 $plugin_admin
 
 $db
 
 $rbacsystem
 
 $settings
 
 $obj_definition
 
 $details_level = self::DETAILS_DEACTIVATED
 
 $renderer
 
 $log
 
 $view_mode
 

Private Attributes

 $logger = null
 
 $output_html = ''
 
 $test_assignments = null
 

Detailed Description

GUI class for course objective view.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilContainerObjectiveGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerObjectiveGUI::__construct (   $a_container_gui)

Constructor.

public

Parameters
objectcontainer gui object
Returns

Definition at line 52 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilContainerContentGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), initDetails(), initTestAssignments(), settings(), and user().

53  {
54  global $DIC;
55 
56  $this->tabs = $DIC->tabs();
57  $this->access = $DIC->access();
58  $this->user = $DIC->user();
59  $this->settings = $DIC->settings();
60  $this->ctrl = $DIC->ctrl();
61  $this->toolbar = $DIC->toolbar();
62  $lng = $DIC->language();
63  $this->logger = $DIC->logger()->crs();
64 
65  $this->lng = $lng;
66  parent::__construct($a_container_gui);
67 
68  $this->initDetails();
69  $this->initTestAssignments();
70  }
settings()
Definition: settings.php:2
user()
Definition: user.php:4
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addFooterRow()

ilContainerObjectiveGUI::addFooterRow ( )

add footer row

public

Parameters

Definition at line 353 of file class.ilContainerObjectiveGUI.php.

Referenced by showObjectives().

354  {
355  // no details
356  return;
357 
358  /*
359  $ilCtrl = $this->ctrl;
360 
361  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getContainerObject()->getRefId());
362  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "1");
363  $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
364  $this->renderer->addDetailsLevel(2, $url, ($this->details_level == self::DETAILS_TITLE));
365 
366  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "2");
367  $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
368  $this->renderer->addDetailsLevel(3, $url, ($this->details_level == self::DETAILS_ALL));
369 
370  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
371  */
372  }
+ Here is the caller graph for this function:

◆ addItemDetails()

ilContainerObjectiveGUI::addItemDetails ( ilObjectListGUI  $a_item_list_gui,
array  $a_item 
)
protected

Definition at line 581 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\$ctrl, $ilCtrl, $ilUser, ilContainerContentGUI\$lng, $res, $type, $url, ilContainerContentGUI\$user, ilConditionHandler\_checkAllConditionsOfTarget(), ilObjectListGUI\addCustomProperty(), ilObjectListGUI\disableTitleLink(), ilObjectListGUI\enableCommands(), ilObjectListGUI\enableItemDetailLinks(), ilObjectListGUI\enableProperties(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilCourseObjective\lookupMaxPasses(), ilLOUserResults\lookupResult(), ilObjectListGUI\setConditionTarget(), ilObjectListGUI\setDefaultCommandParameters(), ilObjectListGUI\setItemDetailLinks(), ilLOUserResults\TYPE_QUALIFIED, ilLOSettings\TYPE_TEST_INITIAL, and updateResult().

582  {
583  $lng = $this->lng;
586 
587  $item_ref_id = $a_item["ref_id"];
588 
589  if (is_array($this->objective_map)) {
590  $details = array();
591  if (isset($this->objective_map["material"][$item_ref_id])) {
592  // #12965
593  foreach ($this->objective_map["material"][$item_ref_id] as $objective_id) {
594  $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $objective_id);
595  $url = $ilCtrl->getLinkTargetByClass(array('illoeditorgui', 'ilcourseobjectivesgui'), 'edit');
596  $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', '');
597 
598  $details[] = array(
599  'desc' => $lng->txt('crs_loc_tab_materials') . ': ',
600  'target' => '_top',
601  'link' => $url,
602  'name' => $this->objective_map["names"][$objective_id]
603  );
604  }
605  }
606  if ($this->objective_map["test_i"] == $item_ref_id) {
607  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
608  $details[] = array(
609  'desc' => '',
610  'target' => '_top',
611  'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
612  'name' => $lng->txt('crs_loc_tab_itest')
613  );
614  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
615  }
616  if ($this->objective_map["test_q"] == $item_ref_id) {
617  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
618  $details[] = array(
619  'desc' => '',
620  'target' => '_top',
621  'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
622  'name' => $lng->txt('crs_loc_tab_qtest')
623  );
624  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
625  }
626 
627  // #15367
628  if (is_array($this->objective_map["test_ass"][$item_ref_id])) {
629  foreach ($this->objective_map["test_ass"][$item_ref_id] as $type => $items) {
631  $caption = $lng->txt('crs_loc_tab_itest');
632  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
633  } else {
634  $caption = $lng->txt('crs_loc_tab_qtest');
635  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
636  }
637  foreach ($items as $objtv_title) {
638  $details[] = array(
639  'desc' => '',
640  'target' => '_top',
641  'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testsOverview'),
642  'name' => $caption . " (" . $this->lng->txt("crs_loc_learning_objective") . ": " . $objtv_title . ")"
643  );
644  }
645  $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
646  }
647  }
648 
649  if (sizeof($details)) {
650  $a_item_list_gui->enableItemDetailLinks(true);
651  $a_item_list_gui->setItemDetailLinks($details, $lng->txt('crs_loc_settings_tbl') . ': ');
652  } else {
653  $a_item_list_gui->enableItemDetailLinks(false);
654  }
655  }
656 
657  // order
658  if ($this->getContainerGUI()->isActiveOrdering()) {
659  $a_item_list_gui->enableCommands(true, true);
660  $a_item_list_gui->enableProperties(false);
661  }
662  // view
663  elseif (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
664  $a_item_list_gui->enableCommands(true, true);
665  $a_item_list_gui->enableProperties(false);
666  }
667 
668  if ($a_item['objective_id']) {
669  $a_item_list_gui->setDefaultCommandParameters(array('objective_id' => $a_item['objective_id']));
670 
671 
672  if ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) {
673  $a_item_list_gui->setConditionTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj');
674  // check conditions of target
675  include_once './Services/Conditions/classes/class.ilConditionHandler.php';
676  $fullfilled = ilConditionHandler::_checkAllConditionsOfTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj');
677  if (!$fullfilled || $a_item['objective_status']) {
678  $a_item_list_gui->disableTitleLink(true);
679  }
680  }
681  include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
683  $this->getContainerObject()->getId(),
684  $ilUser->getId(),
685  $a_item['objective_id'],
687  );
688 
689  $res = $this->updateResult($res, $a_item['ref_id'], $a_item['objective_id'], $ilUser->getId());
690 
691  if ($res['is_final']) {
692  $a_item_list_gui->disableTitleLink(true);
693  $a_item_list_gui->enableProperties(true);
694  $a_item_list_gui->addCustomProperty(
695  $this->lng->txt('crs_loc_passes_reached'),
696  '',
697  true
698  );
699  } elseif ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) {
700  include_once './Modules/Course/classes/class.ilCourseObjective.php';
701  $poss_pass = ilCourseObjective::lookupMaxPasses($a_item['objective_id']);
702 
703  if ($poss_pass) {
704  $a_item_list_gui->enableProperties(true);
705  $a_item_list_gui->addCustomProperty(
706  $this->lng->txt('crs_loc_passes_left'),
707  (($poss_pass - $res['tries']) > 0) ? ($poss_pass - $res['tries']) : 1,
708  false
709  );
710  }
711  }
712  }
713  }
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
static lookupMaxPasses($a_objective_id)
$type
enableProperties($a_status)
En/disable properties.
static lookupResult($a_course_obj_id, $a_user_id, $a_objective_id, $a_tst_type)
Lookup user result.
global $ilCtrl
Definition: ilias.php:18
addCustomProperty( $a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
foreach($_POST as $key=> $value) $res
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container object.
$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
enableCommands($a_status, $a_std_only=false)
En/disable commands.
setDefaultCommandParameters(array $a_params)
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
$url
updateResult($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
+ Here is the call graph for this function:

◆ buildAccordionContent()

ilContainerObjectiveGUI::buildAccordionContent ( array  $a_items)
protected

Definition at line 1493 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\$tpl.

Referenced by renderObjective(), and showMaterials().

1494  {
1495  $tpl = new ilTemplate("tpl.objective_accordion_content.html", true, true, "Services/Container");
1496  foreach ($a_items as $item) {
1497  $tpl->setCurrentBlock("items_bl");
1498  $tpl->setVariable("ITEM", $item);
1499  $tpl->parseCurrentBlock();
1500  }
1501  return $tpl->get();
1502  }
+ Here is the caller graph for this function:

◆ buildAccordionTitle()

ilContainerObjectiveGUI::buildAccordionTitle ( ilCourseObjective  $a_objective,
array  $a_lo_result = null 
)
protected
Parameters
\ilCourseObjective$a_objective
array | null$a_lo_result
Returns
string
Exceptions

Definition at line 1361 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilContainerContentGUI\$renderer, ilContainerContentGUI\$tpl, ilCourseObjective\getDescription(), ilCourseObjective\getObjectiveId(), ilLOUtils\getTestResultLinkForUser(), ilCourseObjective\getTitle(), ilLOUserResults\TYPE_INITIAL, and ilLOUserResults\TYPE_QUALIFIED.

Referenced by renderObjective().

1362  {
1363  global $DIC;
1364 
1365  $renderer = $DIC->ui()->renderer();
1366  $ui_factory = $DIC->ui()->factory();
1367 
1368  $tpl = new ilTemplate("tpl.objective_accordion_title.html", true, true, "Services/Container");
1369 
1370  if ($a_lo_result) {
1371  $tpl->setVariable(
1372  "PROGRESS_BAR",
1373  self::buildObjectiveProgressBar(
1374  (bool) $this->loc_settings->worksWithInitialTest(),
1375  $a_objective->getObjectiveId(),
1376  $a_lo_result
1377  )
1378  );
1379  }
1380 
1381  $tpl->setVariable("TITLE", $this->lng->txt("crs_loc_learning_objective") . ": " . trim($a_objective->getTitle()));
1382  $tpl->setVariable("DESCRIPTION", nl2br(trim($a_objective->getDescription())));
1383 
1384  $initial_res = null;
1385  $initial_lim = null;
1386  if ($this->loc_settings->worksWithInitialTest()) {
1387  if (array_key_exists('initial', $a_lo_result)) {
1388  $initial_res = (int) $a_lo_result['initial']['result_perc'];
1389  $initial_lim = (int) $a_lo_result['initial']['limit_perc'];
1390  }
1391  if (
1392  $a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1393  isset($a_lo_result['result_perc'])
1394  ) {
1395  $initial_res = (int) $a_lo_result['result_perc'];
1396  $initial_lim = (int) $a_lo_result['limit_perc'];
1397  }
1398  }
1399 
1400  if ($initial_res !== null) {
1401 
1403  $a_lo_result["itest"],
1404  $a_lo_result["user_id"]
1405  );
1406 
1407  if (strlen($link)) {
1408  $tpl->setCurrentBlock('i_with_link');
1409  $tpl->setVariable(
1410  'IBTN',
1411  $renderer->render(
1412  $ui_factory->button()->shy(
1413  $this->lng->txt('crs_objective_result_details'),
1414  $link
1415  )
1416  )
1417  );
1418  $tpl->parseCurrentBlock();
1419  }
1420 
1421  $tpl->setCurrentBlock('res_initial');
1422  $tpl->setVariable(
1423  'IRESULT',
1424  sprintf(
1425  $this->lng->txt('crs_objective_result_summary_initial'),
1426  (int) $initial_res . '%',
1427  (int) $initial_lim . '%'
1428  )
1429  );
1430  $tpl->parseCurrentBlock();
1431  }
1432 
1433  $qual_res = null;
1434  $qual_lim = null;
1435 
1436  if ($a_lo_result['type'] == ilLOUserResults::TYPE_QUALIFIED) {
1437 
1438  $qual_res = (int) $a_lo_result['result_perc'];
1439  $qual_lim = (int) $a_lo_result['limit_perc'];
1440  }
1441 
1442  if ($qual_res !== null) {
1443 
1445  $a_lo_result["qtest"],
1446  $a_lo_result["user_id"]
1447  );
1448 
1449  if (strlen($link)) {
1450  $tpl->setCurrentBlock('q_with_link');
1451  $tpl->setVariable(
1452  'QBTN',
1453  $renderer->render(
1454  $ui_factory->button()->shy(
1455  $this->lng->txt('crs_objective_result_details'),
1456  $link
1457  )
1458  )
1459  );
1460  $tpl->parseCurrentBlock();
1461  }
1462  $tpl->setCurrentBlock('res_qualifying');
1463  $tpl->setVariable(
1464  'QRESULT',
1465  sprintf(
1466  $this->lng->txt('crs_objective_result_summary_qualifying'),
1467  (int) $qual_res . '%',
1468  (int) $qual_lim . '%'
1469  )
1470  );
1471  $tpl->parseCurrentBlock();
1472  }
1473 
1474  $this->logger->dump($a_lo_result);
1475 
1476  $summary = self::getObjectiveResultSummary(
1477  (bool) $this->loc_settings->worksWithInitialTest(),
1478  $a_objective->getObjectiveId(),
1479  $a_lo_result
1480  );
1481  if (strlen($summary)) {
1482  $tpl->setCurrentBlock('objective_summary');
1483  $tpl->setVariable('SUMMARY_TXT', $summary);
1484  $tpl->parseCurrentBlock();
1485  }
1486 
1487  // #15510
1488  $tpl->setVariable("ANCHOR_ID", "objtv_acc_" . $a_objective->getObjectiveId());
1489 
1490  return $tpl->get();
1491  }
static getTestResultLinkForUser($a_test_ref_id, $a_user_id)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildObjectiveMap()

ilContainerObjectiveGUI::buildObjectiveMap ( )
protected

Definition at line 535 of file class.ilContainerObjectiveGUI.php.

References ilCourseObjectiveMaterials\_getAssignedMaterials(), ilCourseObjective\_getObjectiveIds(), ilContainerContentGUI\getContainerObject(), ilCourseObjective\lookupObjectiveTitle(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by showMaterials().

536  {
537  $objective_map = array();
538  include_once './Modules/Course/classes/class.ilCourseObjective.php';
539  // begin-patch lok
540  if (count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
541  // end-patch lok
542  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
543  foreach ($objective_ids as $objective_id) {
544  foreach (ilCourseObjectiveMaterials::_getAssignedMaterials($objective_id) as $mat_ref_id) {
545  $objective_map["material"][$mat_ref_id][] = $objective_id;
546 
547  if (!isset($objective_map["names"][$objective_id])) {
548  $objective = new ilCourseObjective($this->getContainerObject(), $objective_id);
549  $objective_map["names"][$objective_id] = $objective->getTitle();
550  }
551  }
552  }
553 
554  // initial/qualifying test
555  $tst = $this->loc_settings->getInitialTest();
556  if ($tst) {
557  $objective_map["test_i"] = $tst;
558  }
559  $tst = $this->loc_settings->getQualifiedTest();
560  if ($tst) {
561  $objective_map["test_q"] = $tst;
562  }
563 
564  // objective test assignments
565  include_once 'Modules/Course/classes/Objectives/class.ilLOSettings.php';
566  include_once 'Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
567  $ass_test = new ilLOTestAssignments($this->getContainerObject()->getId());
568  foreach ($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_INITIAL) as $ass) {
569  $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
570  $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
571  }
572  foreach ($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_QUALIFIED) as $ass) {
573  $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
574  $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
575  }
576  }
577 
578  return $objective_map;
579  }
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
Settings for LO courses.
static _getObjectiveIds($course_id, $a_activated_only=false)
class ilcourseobjective
getContainerObject()
Get container object.
static _getAssignedMaterials($a_objective_id)
get assigned materials
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildObjectiveProgressBar()

static ilContainerObjectiveGUI::buildObjectiveProgressBar (   $a_has_initial_test,
  $a_objective_id,
array  $a_lo_result,
  $a_list_mode = false,
  $a_sub = false,
  $a_tt_suffix = null 
)
static

Render progressbar(s) for given objective and result data.

Parameters
bool$a_has_initial_test
int$a_objective_id
bool$a_lo_result
bool$a_list_mode
bool$a_sub
mixed$a_tt_suffix
Returns
string

Definition at line 1245 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilContainerContentGUI\$lng, ilLOSettings\getInstanceByObjId(), ilLOUtils\getTestResultLinkForUser(), ilLOUserResults\STATUS_COMPLETED, ilLOUserResults\TYPE_INITIAL, ilLOUserResults\TYPE_QUALIFIED, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by ilPortfolioPageGUI\renderMyCourses(), and ilTestLearningObjectivesStatusGUI\renderStatus().

1246  {
1247  global $DIC;
1248 
1249  $lng = $DIC->language();
1250  $lng->loadLanguageModule('crs');
1251 
1252  // tooltip (has to be unique!)
1253 
1254  $tooltip_id = "crsobjtvusr_" . $a_objective_id . "_" . $a_lo_result["type"] . "_" . ((int) $a_sub);
1255  if ($a_tt_suffix !== null) {
1256  $tooltip_id .= "_" . $a_tt_suffix;
1257  }
1258 
1259  $tt_txt = sprintf(
1260  $lng->txt("crs_loc_tt_info"),
1261  $a_lo_result["result_perc"],
1262  $a_lo_result["limit_perc"]
1263  );
1264 
1265 
1266  include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
1267  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
1268 
1269  $is_qualified = ($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED);
1270  $is_qualified_initial = ($a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1271  ilLOSettings::getInstanceByObjId($a_lo_result['course_id'])->isInitialTestQualifying());
1272  $has_completed = ($a_lo_result["status"] == ilLOUserResults::STATUS_COMPLETED);
1273 
1274  $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = null;
1275  $compare_value = null;
1276 
1277  if ($is_qualified ||
1278  $is_qualified_initial) {
1279  $progress_txt = $lng->txt("crs_loc_progress_result_qtest");
1280  $tt_txt = $lng->txt("crs_loc_tab_qtest") . ": " . $tt_txt;
1281 
1282  if ($has_completed) {
1283  $next_step = $lng->txt("crs_loc_progress_objective_complete");
1284  $bar_color = "ilCourseObjectiveProgressBarCompleted";
1285 
1286  // render 2nd progressbar if there is also an initial test
1287  if ($is_qualified &&
1288  $a_has_initial_test &&
1289  is_array($a_lo_result["initial"])) {
1290  $a_lo_result["initial"]["itest"] = $a_lo_result["itest"];
1291 
1292  // force list mode to get rid of next step
1293  #$initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
1294  $compare_value = $a_lo_result['initial']['result_perc'];
1295  }
1296  } else {
1297  $next_step = $lng->txt("crs_loc_progress_do_qualifying_again");
1298  $bar_color = "ilCourseObjectiveProgressBarFailed";
1299  }
1300  }
1301  // initial test
1302  else {
1303  if ($a_lo_result["status"]) {
1304  $progress_txt = $lng->txt("crs_loc_progress_result_itest");
1305  $tt_txt = $lng->txt("crs_loc_tab_itest") . ": " . $tt_txt;
1306 
1307  $bar_color = "ilCourseObjectiveProgressBarNeutral";
1308  $next_step = $has_completed
1309  ? $lng->txt("crs_loc_progress_do_qualifying")
1310  : $lng->txt("crs_loc_suggested");
1311  }
1312  // not attempted: no progress bar
1313  else {
1314  $next_step = (bool) $a_has_initial_test
1315  ? $lng->txt("crs_loc_progress_no_result_do_initial")
1316  : $lng->txt("crs_loc_progress_no_result_no_initial");
1317  }
1318  }
1319 
1320  // link to test statistics
1321  $relevant_test_id = $a_lo_result["qtest"]
1322  ? $a_lo_result["qtest"]
1323  : $a_lo_result["itest"];
1324  if ($relevant_test_id) {
1325  $test_url = ilLOUtils::getTestResultLinkForUser($relevant_test_id, $a_lo_result["user_id"]);
1326  }
1327 
1328  $main_text = $lng->txt('crs_loc_itest_info');
1329  if ($a_lo_result['type'] == ilLOSettings::TYPE_TEST_QUALIFIED) {
1330  $main_text = $lng->txt('crs_loc_qtest_info');
1331  }
1332 
1333 
1334 
1335  return self::renderProgressMeter(
1336  $a_lo_result["result_perc"],
1337  $a_lo_result["limit_perc"],
1338  $compare_value,
1339  $progress_txt,
1340  $test_url,
1341  $tooltip_id,
1342  $tt_txt,
1343  $a_list_mode
1344  ? null
1345  : $next_step,
1346  $initial_sub,
1347  $a_list_mode
1348  ? 30
1349  : 10,
1350  $main_text,
1351  $lng->txt('crs_lobj_pm_min_goal')
1352  );
1353  }
static getInstanceByObjId($a_obj_id)
get singleton instance
static getTestResultLinkForUser($a_test_ref_id, $a_user_id)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDetailsLevel()

ilContainerObjectiveGUI::getDetailsLevel (   $a_objective_id)

get details level

public

Parameters

Definition at line 98 of file class.ilContainerObjectiveGUI.php.

Referenced by renderObjective().

99  {
100  // no details anymore
101  return self::DETAILS_ALL;
102  }
+ Here is the caller graph for this function:

◆ getMainContent()

ilContainerObjectiveGUI::getMainContent ( )

Impementation of abstract method getMainContent.

public

Returns

Definition at line 110 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\$access, ilContainerContentGUI\$ctrl, $ilCtrl, $ilUser, ilContainerContentGUI\$lng, $tabs, ilContainerContentGUI\$tpl, ilContainerContentGUI\$user, ilObject\_lookupObjId(), ilObjTestAccess\checkCondition(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilLOSettings\getInstanceByObjId(), ilLOUserResults\hasResults(), ilContainerContentGUI\initRenderer(), ilConditionHandler\OPERATOR_FINISHED, renderTest(), showButton(), showMaterials(), and showObjectives().

111  {
112  $lng = $this->lng;
113  $ilTabs = $this->tabs;
114  $ilAccess = $this->access;
117 
118  // see bug #7452
119  // $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
120 
121 
122  include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
123 
124  $tpl = new ilTemplate("tpl.container_page.html", true, true, "Services/Container");
125 
126  if ($ilAccess->checkAccess('write', '', $this->getContainerObject()->getRefId())) {
127  // check for results
128  include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
129  if (ilLOUserResults::hasResults($this->getContainerObject()->getId(), $ilUser->getId())) {
130  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
131  $ilToolbar = new ilToolbarGUI();
132  $ilToolbar->addButton(
133  $lng->txt('crs_reset_results'),
134  $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI()), 'reset')
135  );
136  }
137  }
138 
139  // Feedback
140  // @todo
141  // $this->__showFeedBack();
142 
143  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
144 
145  $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
146  $is_order = $this->getContainerGUI()->isActiveOrdering();
147 
148  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
149  $this->loc_settings = ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId());
150 
151  $this->initRenderer();
152 
153  if (!$is_manage && !$is_order) {
154  // currently inactive
155  // $this->showStatus($tpl);
156  }
157  if (!$is_manage) {
158  $this->showObjectives($tpl, $is_order);
159 
160  // $this->showMaterials($tpl,self::MATERIALS_TESTS, false, !$is_order);
161 
162  // check for results
163  include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
164  $has_results = ilLOUserResults::hasResults($this->getContainerObject()->getId(), $ilUser->getId());
165 
166  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
167  $tst_obj_id = ilObject::_lookupObjId($this->loc_settings->getInitialTest());
168 
169  if (
170  $this->loc_settings->getInitialTest() &&
171  $this->loc_settings->isGeneralInitialTestVisible() &&
172  !$this->loc_settings->isInitialTestStart() &&
174  ) {
175  $this->output_html .= $this->renderTest($this->loc_settings->getInitialTest(), null, true, true);
176  } elseif (
177  $this->loc_settings->getQualifiedTest() &&
178  $this->loc_settings->isGeneralQualifiedTestVisible()
179  ) {
180  $this->output_html .= $this->renderTest($this->loc_settings->getQualifiedTest(), null, false, true);
181  }
182 
183  $this->showMaterials($tpl, self::MATERIALS_OTHER, false, !$is_order);
184  } else {
185  $this->showMaterials($tpl, null, $is_manage);
186  }
187 
188  // reset results by setting or for admins
189  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
190  if (
191  ilLOSettings::getInstanceByObjId($this->getContainerObject()->getId())->isResetResultsEnabled() or
192  $ilAccess->checkAccess('write', '', $this->getContainerObject()->getRefId())
193  ) {
194  if ($has_results) {
195  if (!$is_manage && !$is_order) {
196  $this->showButton('askReset', $lng->txt('crs_reset_results'));
197  }
198  }
199  }
200 
201  $tpl->setVariable('CONTAINER_PAGE_CONTENT', $this->output_html);
202 
203  return $tpl->get();
204  }
static getInstanceByObjId($a_obj_id)
get singleton instance
showObjectives($a_tpl, $a_is_order=false)
show objectives
initRenderer()
Init container renderer.
global $ilCtrl
Definition: ilias.php:18
getContainerGUI()
Get container GUI object.
static _lookupObjId($a_id)
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
showButton($a_cmd, $a_text, $a_target='', $a_id="")
show action button
renderTest($a_test_ref_id, $a_objective_id, $a_is_initial=false, $a_add_border=false, $a_lo_result=array())
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static hasResults($a_container_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.
+ Here is the call graph for this function:

◆ getObjectiveResultSummary()

static ilContainerObjectiveGUI::getObjectiveResultSummary (   $a_has_initial_test,
  $a_objective_id,
  $a_lo_result 
)
static

Get objective result summary.

Parameters
bool
int
array
Todo:
refactor to presentation class

Definition at line 1191 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilContainerContentGUI\$lng, ilLOSettings\getInstanceByObjId(), ilLOUserResults\STATUS_COMPLETED, ilLOUserResults\TYPE_INITIAL, and ilLOUserResults\TYPE_QUALIFIED.

1192  {
1193  global $DIC;
1194 
1195  $lng = $DIC->language();
1196  $lng->loadLanguageModule('crs');
1197 
1198  $is_qualified =
1199  ($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED);
1200  $is_qualified_initial =
1201  (
1202  $a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1203  ilLOSettings::getInstanceByObjId($a_lo_result['course_id'])->isInitialTestQualifying()
1204  );
1205  $has_completed =
1206  ($a_lo_result["status"] == ilLOUserResults::STATUS_COMPLETED);
1207 
1208  $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = null;
1209 
1210  if (
1211  $is_qualified ||
1212  $is_qualified_initial) {
1213  if ($has_completed) {
1214  $next_step = $lng->txt("crs_loc_progress_objective_complete");
1215  } else {
1216  $next_step = $lng->txt("crs_loc_progress_do_qualifying_again");
1217  }
1218  } // initial test
1219  else {
1220  if ($a_lo_result["status"]) {
1221  $next_step =
1222  $has_completed ?
1223  $lng->txt("crs_loc_progress_do_qualifying") :
1224  $lng->txt("crs_loc_suggested");
1225  } else {
1226  $next_step = (bool) $a_has_initial_test ?
1227  $lng->txt("crs_loc_progress_no_result_do_initial") :
1228  $lng->txt("crs_loc_progress_no_result_no_initial");
1229  }
1230  }
1231  return $next_step;
1232  }
static getInstanceByObjId($a_obj_id)
get singleton instance
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getSettings()

ilContainerObjectiveGUI::getSettings ( )
Returns

Definition at line 84 of file class.ilContainerObjectiveGUI.php.

References $loc_settings.

Referenced by renderObjective().

+ Here is the caller graph for this function:

◆ getTestAssignments()

ilContainerObjectiveGUI::getTestAssignments ( )

Get test assignments object.

Returns
ilLOTestAssignments

Definition at line 76 of file class.ilContainerObjectiveGUI.php.

References $test_assignments.

Referenced by renderObjective().

+ Here is the caller graph for this function:

◆ initDetails()

ilContainerObjectiveGUI::initDetails ( )
protected

init details

protected

Parameters

Definition at line 963 of file class.ilContainerObjectiveGUI.php.

References $ilUser, and ilContainerContentGUI\$user.

Referenced by __construct().

964  {
966 
967  // no details
968  return;
969  }
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ initTestAssignments()

ilContainerObjectiveGUI::initTestAssignments ( )
protected

Definition at line 971 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\getContainerObject(), and ilLOTestAssignments\getInstance().

Referenced by __construct().

972  {
973  include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
974  $this->test_assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
975  }
static getInstance($a_container_id)
Get instance by container id.
getContainerObject()
Get container object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseLOUserResults()

ilContainerObjectiveGUI::parseLOUserResults ( )
protected

Parse learning objective results.

Returns
type

Definition at line 981 of file class.ilContainerObjectiveGUI.php.

References $ilUser, $res, $result, ilContainerContentGUI\$user, ilContainerContentGUI\getContainerObject(), ilLOTestAssignments\getInstance(), ilLOUserResults\TYPE_INITIAL, ilLOUserResults\TYPE_QUALIFIED, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by showObjectives().

982  {
984 
985  $res = array();
986 
987  include_once "Modules/Course/classes/Objectives/class.ilLOTestAssignments.php";
988  $lo_ass = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
989 
990  include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
991  $lur = new ilLOUserResults($this->getContainerObject()->getId(), $ilUser->getId());
992  foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
993  // show either initial or qualified for objective
994  if (isset($types[ilLOUserResults::TYPE_INITIAL])) {
995  $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
996  }
997 
998  // qualified test has priority
999  if (isset($types[ilLOUserResults::TYPE_QUALIFIED])) {
1002  $result["initial"] = $types[ilLOUserResults::TYPE_INITIAL];
1003  } else {
1006  }
1007 
1008  $result["initial_status"] = $initial_status;
1009 
1010  $result["itest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
1011  $result["qtest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
1012 
1013  $res[$objective_id] = $result;
1014  }
1015 
1016  return $res;
1017  }
static getInstance($a_container_id)
Get instance by container id.
$result
foreach($_POST as $key=> $value) $res
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderObjective()

ilContainerObjectiveGUI::renderObjective (   $a_objective_id,
$a_has_lo_page,
ilAccordionGUI  $a_accordion = null,
array  $a_lo_result = null 
)
protected

render objective

protected

Parameters
intobjective id
boolco page status
ilAccordionGUI$a_accordion
array$a_lo_result
Returns
string html

Definition at line 751 of file class.ilContainerObjectiveGUI.php.

References $_GET, $ilUser, ilContainerContentGUI\$lng, ilContainerContentGUI\$user, ilPageUtil\_existsAndNotEmpty(), ilObject\_lookupObjId(), ilLMObject\_lookupTitle(), buildAccordionContent(), buildAccordionTitle(), ilObjTestAccess\checkCondition(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), getDetailsLevel(), ilObjStyleSheet\getEffectiveContentStyleId(), ilContainerContentGUI\getItemGUI(), ilObjectActivation\getItemsByObjective(), getSettings(), getTestAssignments(), ilConditionHandler\OPERATOR_FINISHED, renderTest(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by showObjectives().

752  {
754  $lng = $this->lng;
755 
756  include_once('./Modules/Course/classes/class.ilCourseObjective.php');
757  $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id);
758 
759  include_once('./Services/Container/classes/class.ilContainerSorting.php');
760  include_once('./Services/Object/classes/class.ilObjectActivation.php');
761  $items = ilObjectActivation::getItemsByObjective($a_objective_id);
762 
763  // sorting is handled by ilCourseObjectiveMaterials
764  // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
765 
766  include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
767  $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
768 
769  // #13381 - map material assignment to position
770  $sort_map = array();
771  foreach ($objectives_lm_obj->getMaterials() as $item) {
772  $sort_map[$item["lm_ass_id"]] = $item["position"];
773  }
774 
775  $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
776  $is_order = $this->getContainerGUI()->isActiveOrdering();
777 
778  $sort_content = array();
779 
780  foreach ($items as $item) {
781  if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
782  continue;
783  }
784 
785  $item_list_gui2 = $this->getItemGUI($item);
786  $item_list_gui2->enableIcon(true);
787 
788  if ($is_order || $a_accordion) {
789  $item_list_gui2->enableCommands(true, true);
790  $item_list_gui2->enableProperties(false);
791  }
792 
793  $chapters = $objectives_lm_obj->getChapters();
794  if (count($chapters)) {
795  $has_sections = false;
796  foreach ($chapters as $chapter) {
797  if ($chapter['ref_id'] != $item['child']) {
798  continue;
799  }
800  $has_sections = true;
801 
802  include_once './Modules/LearningModule/classes/class.ilLMObject.php';
803  $title = $item['title'] .
804  " &rsaquo; " . ilLMObject::_lookupTitle($chapter['obj_id']) .
805  " (" . $lng->txt('obj_' . $chapter['type']) . ")";
806 
807  $item_list_gui2->setDefaultCommandParameters(array(
808  "obj_id" => $chapter['obj_id'],
809  "focus_id" => $chapter['obj_id'],
810  "focus_return" => $this->container_obj->getRefId()));
811 
812  if ($is_order) {
813  $item_list_gui2->setPositionInputField(
814  "[lobj][" . $a_objective_id . "][" . $chapter['lm_ass_id'] . "]",
815  sprintf('%d', $chapter['position'] * 10)
816  );
817  }
818 
819  $sub_item_html = $item_list_gui2->getListItemHTML(
820  $item['ref_id'],
821  $item['obj_id'],
822  $title,
823  $item['description']
824  );
825 
826  // #13381 - use materials order
827  $sort_key = str_pad($chapter['position'], 5, 0, STR_PAD_LEFT) . "_" . strtolower($title) . "_" . $chapter['lm_ass_id'];
828  $sort_content[$sort_key] = $sub_item_html;
829  }
830  }
831 
832  $this->rendered_items[$item['child']] = true;
833 
834  if ($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true)) {
835  if ($is_order) {
836  $item_list_gui2->setPositionInputField(
837  "[lobj][" . $a_objective_id . "][" . $lm_ass_id . "]",
838  sprintf('%d', $sort_map[$lm_ass_id] * 10)
839  );
840  }
841 
842  $sub_item_html = $item_list_gui2->getListItemHTML(
843  $item['ref_id'],
844  $item['obj_id'],
845  $item['title'],
846  $item['description']
847  );
848 
849  // #13381 - use materials order
850  $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . "_" . strtolower($item['title']) . "_" . $lm_ass_id;
851  $sort_content[$sort_key] = $sub_item_html;
852  }
853  }
854 
855  if ($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL) {
856  $this->objective_list_gui->enableCommands(false);
857  } else {
858  $this->objective_list_gui->enableCommands(true);
859  }
860 
861  if ($is_order) {
862  $this->objective_list_gui->setPositionInputField(
863  "[lobj][" . $a_objective_id . "][0]",
864  $objective->__getPosition() * 10
865  );
866  }
867 
868  ksort($sort_content);
869 
870  if (!$a_accordion) {
871  foreach ($sort_content as $sub_item_html) {
872  $this->objective_list_gui->addSubItemHTML($sub_item_html);
873  }
874 
875  return $this->objective_list_gui->getObjectiveListItemHTML(
876  0,
877  $a_objective_id,
878  $objective->getTitle(),
879  $objective->getDescription(),
880  ($is_manage || $is_order)
881  );
882  } else {
883  $acc_content = $sort_content;
884 
885  $initial_shown = false;
886  $initial_test_ref_id = $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL);
887  $initial_test_obj_id = ilObject::_lookupObjId($initial_test_ref_id);
888  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
889 
890  if (
891  $initial_test_obj_id &&
892  $this->getSettings()->hasSeparateInitialTests() &&
894  ) {
895  $acc_content[] = $this->renderTest(
896  $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL),
897  $a_objective_id,
898  true,
899  false,
900  $a_lo_result
901  );
902  $initial_shown = true;
903  } elseif ($this->getSettings()->hasSeparateQualifiedTests()) {
904  $acc_content[] = $this->renderTest(
905  $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED),
906  $a_objective_id,
907  false,
908  false,
909  $a_lo_result
910  );
911  }
912 
913 
914  /*
915  if($this->loc_settings->getInitialTest() &&
916  $this->loc_settings->getType() == ilLOSettings::LOC_INITIAL_SEL &&
917  !$a_lo_risult["initial_status"])
918  {
919  $acc_content[] = $this->renderTest($this->loc_settings->getInitialTest(), $a_objective_id, true, false, $a_lo_result);
920  $initial_shown = true;
921  }
922  if(!$initial_shown &&
923  $this->loc_settings->getQualifiedTest() &&
924  $this->loc_settings->isQualifiedTestPerObjectiveVisible())
925  {
926  $acc_content[] = $this->renderTest($this->loc_settings->getQualifiedTest(), $a_objective_id, false, false, $a_lo_result);
927  }
928  */
929 
930  $co_page = null;
931  include_once("./Services/COPage/classes/class.ilPageUtil.php");
932  if (ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId())) {
933  $a_has_lo_page = true;
934 
935  include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
936  $page_gui = new ilLOPageGUI($objective->getObjectiveId());
937 
938  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
939  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
940  $page_gui->setPresentationTitle("");
941  $page_gui->setTemplateOutput(false);
942  $page_gui->setHeader("");
943 
944  $co_page = "<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . "</div>";
945  }
946 
947  $a_accordion->addItem(
948  $this->buildAccordionTitle($objective, $a_lo_result),
949  $co_page .
950  $this->buildAccordionContent($acc_content),
951  (isset($_GET["oobj"]) && (int) $_GET["oobj"] == $objective->getObjectiveId())
952  );
953  }
954  }
$_GET["client_id"]
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
addItem($a_header, $a_content, $a_force_open=false)
Add item.
static _lookupTitle($a_obj_id)
Lookup title.
buildAccordionTitle(ilCourseObjective $a_objective, array $a_lo_result=null)
class ilCourseObjectiveMaterials
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)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
(Course) learning objective page GUI class
renderTest($a_test_ref_id, $a_objective_id, $a_is_initial=false, $a_add_border=false, $a_lo_result=array())
static getItemsByObjective($a_objective_id)
Get objective items.
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
getTestAssignments()
Get test assignments object.
getDetailsLevel($a_objective_id)
get details level
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderProgressBar()

static ilContainerObjectiveGUI::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 
)
static

Render progress bar(s)

Parameters
int$a_perc_result
int$a_perc_limit
string$a_css
string$a_caption
string$a_url
string$a_tt_id
string$a_tt_txt
string$a_next_step
string$a_sub(html)
int$a_sub_style
Returns
type

Definition at line 1034 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilContainerContentGUI\$tpl, ilTooltipGUI\addTooltip(), and ilLinkButton\getInstance().

Referenced by ilStudyProgrammeProgressListGUI\buildProgressBar().

1045  {
1046  global $DIC;
1047 
1048  $tpl = new ilTemplate("tpl.objective_progressbar.html", true, true, "Services/Container");
1049 
1050  if ($a_perc_result !== null) {
1051  $tpl->setCurrentBlock("statusbar_bl");
1052  $tpl->setVariable("PERC_STATUS", $a_perc_result);
1053  $tpl->setVariable("PERC_WIDTH", $a_perc_result);
1054  $tpl->setVariable("PERC_COLOR", $a_css);
1055  if ($a_perc_limit) {
1056  // :TODO: magic?
1057  $limit_pos = (99 - (int) $a_perc_limit) * -1;
1058  $tpl->setVariable("LIMIT_POS", $limit_pos);
1059  }
1060  if ($a_tt_txt &&
1061  $a_tt_id) {
1062  $tpl->setVariable("TT_ID", $a_tt_id);
1063  }
1064  $tpl->parseCurrentBlock();
1065  }
1066 
1067  if ($a_caption) {
1068  if ($a_url) {
1069  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1070  $button = ilLinkButton::getInstance();
1071  $button->setCaption($a_caption, false);
1072  $button->setUrl($a_url);
1073 
1074  $tpl->setCurrentBlock("statustxt_bl");
1075  $tpl->setVariable("TXT_PROGRESS_STATUS", $button->render());
1076  $tpl->parseCurrentBlock();
1077  } else {
1078  $tpl->setCurrentBlock("statustxt_no_link_bl");
1079  $tpl->setVariable("TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
1080  $tpl->parseCurrentBlock();
1081  }
1082  }
1083 
1084  if ($a_next_step) {
1085  #$tpl->setCurrentBlock("nstep_bl");
1086  $tpl->setVariable("TXT_NEXT_STEP", $a_next_step);
1087  #$tpl->parseCurrentBlock();
1088  }
1089 
1090  if ($a_tt_id &&
1091  $a_tt_txt) {
1092  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1093  ilTooltipGUI::addTooltip($a_tt_id, $a_tt_txt);
1094  }
1095 
1096  if ($a_sub) {
1097  $tpl->setVariable("SUB_STYLE", ' style="padding-left: ' . $a_sub_style . 'px;"');
1098  $tpl->setVariable("SUB_INIT", $a_sub);
1099  }
1100 
1101  return $tpl->get();
1102  }
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.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderProgressMeter()

static ilContainerObjectiveGUI::renderProgressMeter (   $a_perc_result = null,
  $a_perc_limit = null,
  $a_compare_value = null,
  $a_caption = null,
  $a_url = null,
  $a_tt_id = null,
  $a_tt_txt = null,
  $a_next_step = null,
  $a_sub = false,
  $a_sub_style = 30,
  $a_main_text = '',
  $a_required_text = '' 
)
static

Render progress bar(s)

Parameters
int$a_perc_result
int$a_perc_limit
int$a_compare_value
string$a_caption
string$a_url
string$a_tt_id
string$a_tt_txt
string$a_next_step
string$a_sub(html)
int$a_sub_style
string$a_main_text
string$a_required_text
Returns
type

Definition at line 1121 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilContainerContentGUI\$lng, ilContainerContentGUI\$tpl, and ilTooltipGUI\addTooltip().

1134  {
1135  global $DIC;
1136 
1137  $tpl = new ilTemplate("tpl.objective_progressmeter.html", true, true, "Services/Container");
1138 
1139  $lng = $DIC->language();
1140  $lng->loadLanguageModule('crs');
1141 
1142 
1143 
1144  if (is_numeric($a_perc_result)) {
1145  $uiFactory = $DIC->ui()->factory();
1146  $uiRenderer = $DIC->ui()->renderer();
1147 
1148  $pMeter = $uiFactory->chart()->progressMeter()->standard(
1149  100,
1150  (int) $a_perc_result,
1151  (int) $a_perc_limit,
1152  (int) $a_compare_value
1153  );
1154  if (strlen($a_main_text)) {
1155  #$pMeter = $pMeter->withMainText($a_main_text);
1156  }
1157  if (strlen($a_required_text)) {
1158  #$pMeter = $pMeter->withRequiredText($a_required_text);
1159  }
1160  $tpl->setVariable('PROGRESS_METER', $uiRenderer->render($pMeter));
1161  }
1162 
1163 
1164  if ($a_next_step) {
1165  //$tpl->setCurrentBlock("nstep_bl");
1166  $tpl->setVariable("TXT_NEXT_STEP", $a_next_step);
1167  //$tpl->parseCurrentBlock();
1168  }
1169 
1170  if ($a_tt_id &&
1171  $a_tt_txt) {
1172  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1173  ilTooltipGUI::addTooltip($a_tt_id, $a_tt_txt);
1174  }
1175 
1176  if ($a_sub) {
1177  $tpl->setVariable("SUB_STYLE", ' style="padding-left: ' . $a_sub_style . 'px;"');
1178  $tpl->setVariable("SUB_INIT", $a_sub);
1179  }
1180 
1181  return $tpl->get();
1182  }
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.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ renderTest()

ilContainerObjectiveGUI::renderTest (   $a_test_ref_id,
  $a_objective_id,
  $a_is_initial = false,
  $a_add_border = false,
  $a_lo_result = array() 
)
protected

Definition at line 374 of file class.ilContainerObjectiveGUI.php.

References $DIC, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilCourseObjective\lookupObjectiveTitle(), ilContainerContentGUI\renderItem(), and ilLOUserResults\STATUS_COMPLETED.

Referenced by getMainContent(), and renderObjective().

375  {
376  global $DIC;
377 
378  $tree = $DIC->repositoryTree();
379 
380  $node_data = [];
381  if ($a_test_ref_id) {
382  $node_data = $tree->getNodeData($a_test_ref_id);
383  }
384  if (!$node_data['child']) {
385  return '';
386  }
387 
388  // update ti
389  if ($a_objective_id) {
390  if ($a_is_initial) {
391  $title = sprintf($this->lng->txt('crs_loc_itst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
392  } else {
393  $title = sprintf($this->lng->txt('crs_loc_qtst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
394  }
395  $node_data['objective_id'] = $a_objective_id;
396  $node_data['objective_status'] =
397  (
398  $a_lo_result['status'] == ilLOUserResults::STATUS_COMPLETED ?
399  false :
400  false
401  );
402  } else {
403  $obj_id = ilObject::_lookupObjId($a_test_ref_id);
404  $title = ilObject::_lookupTitle($obj_id);
405 
406  $title .= (
407  ' (' .
408  (
409  $a_is_initial
410  ? $this->lng->txt('crs_loc_itest_info')
411  : $this->lng->txt('crs_loc_qtest_info')
412  ) .
413  ')'
414  );
415  $node_data['objective_id'] = 0;
416  }
417 
418  $node_data['title'] = $title;
419 
420  return "<div class='ilContObjectivesViewTestItem'>" . $this->renderItem($node_data) . "</div>";
421  }
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showButton()

ilContainerObjectiveGUI::showButton (   $a_cmd,
  $a_text,
  $a_target = '',
  $a_id = "" 
)
protected

show action button

protected

Parameters

Definition at line 1511 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\$ctrl, $ilCtrl, and $toolbar.

Referenced by getMainContent(), and showObjectives().

1512  {
1513  $ilToolbar = $this->toolbar;
1514  $ilCtrl = $this->ctrl;
1515 
1516  // #11842
1517  $ilToolbar->addButton(
1518  $a_text,
1519  $ilCtrl->getLinkTarget($this->getContainerGUI(), $a_cmd),
1520  $a_target,
1521  "",
1522  '',
1523  $a_id
1524  );
1525  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ showMaterials()

ilContainerObjectiveGUI::showMaterials (   $a_tpl,
  $a_mode = null,
  $a_is_manage = false,
  $a_as_accordion = false 
)

Show all other (no assigned tests, no assigned materials) materials.

public

Parameters
object$tpltemplate object
Returns
void

Definition at line 430 of file class.ilContainerObjectiveGUI.php.

References ilContainerContentGUI\$access, ilContainerContentGUI\$lng, $txt, buildAccordionContent(), buildObjectiveMap(), ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerObject(), ilLOTestAssignments\getInstance(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\renderItem(), and ilLOSettings\TYPE_TEST_UNDEFINED.

Referenced by getMainContent().

431  {
432  $ilAccess = $this->access;
433  $lng = $this->lng;
434 
436 
437  if (is_array($this->items["_all"])) {
438  $this->objective_map = $this->buildObjectiveMap();
439 
440  // all rows
441  $item_r = array();
442 
443  $position = 1;
444  foreach ($this->items["_all"] as $k => $item_data) {
445  if ($a_mode == self::MATERIALS_TESTS and $item_data['type'] != 'tst') {
446  continue;
447  }
448  if ($item_data['type'] == 'itgr') {
449  continue;
450  }
451  if (!$a_is_manage) {
452  // if test object is qualified or initial do not show here
453  include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
454  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
455  $assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
456  if ($assignments->getTypeByTest($item_data['child']) != ilLOSettings::TYPE_TEST_UNDEFINED) {
457  continue;
458  }
459  }
460 
461  if ($this->rendered_items[$item_data["child"]] !== true &&
462  !$this->renderer->hasItem($item_data["child"])) {
463  $this->rendered_items[$item_data['child']] = true;
464 
465  // TODO: Position (DONE ?)
466  $html = $this->renderItem($item_data, $position++, $a_mode == self::MATERIALS_TESTS ? false : true);
467  if ($html != "") {
468  $item_r[] = array("html" => $html, "id" => $item_data["child"], "type" => $item_data["type"]);
469  }
470  }
471  }
472 
473  // if we have at least one item, output the block
474  if (count($item_r) > 0) {
475  if (!$a_as_accordion) {
476  $pos = 0;
477 
478  switch ($a_mode) {
479  case self::MATERIALS_TESTS:
480  $block_id = "tst";
481  $this->renderer->addTypeBlock($block_id);
482  break;
483 
484  case self::MATERIALS_OTHER:
485  $block_id = "oth";
486  $this->renderer->addCustomBlock($block_id, $lng->txt('crs_other_resources'));
487  break;
488 
489  // manage
490  default:
491  $block_id = "all";
492  $this->renderer->addCustomBlock($block_id, $lng->txt('content'));
493  break;
494  }
495 
496  // :TODO:
497  if ($a_mode != self::MATERIALS_TESTS) {
498  $pos = $this->getItemGroupsHTML();
499  }
500 
501  foreach ($item_r as $h) {
502  if (!$this->renderer->hasItem($h["id"])) {
503  $this->renderer->addItemToBlock($block_id, $h["type"], $h["id"], $h["html"]);
504  }
505  }
506 
507  $this->output_html .= $this->renderer->getHTML();
508  } else {
509  switch ($a_mode) {
510  case self::MATERIALS_TESTS:
511  $txt = $lng->txt('objs_tst');
512  break;
513 
514  case self::MATERIALS_OTHER:
515  $txt = $lng->txt('crs_other_resources');
516  break;
517  }
518 
519  include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
520  $acc = new ilAccordionGUI();
521  $acc->setId("crsobjtvmat" . $a_mode . "_" . $this->container_obj->getId());
522 
523  $acc_content = array();
524  foreach ($item_r as $h) {
525  $acc_content[] = $h["html"];
526  }
527  $acc->addItem($txt, $this->buildAccordionContent($acc_content));
528 
529  $this->output_html .= $acc->getHTML();
530  }
531  }
532  }
533  }
static getInstance($a_container_id)
Get instance by container id.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
getContainerObject()
Get container object.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
$txt
Definition: error.php:13
clearAdminCommandsDetermination()
cleaer administration commands determination
Accordion user interface class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showObjectives()

ilContainerObjectiveGUI::showObjectives (   $a_tpl,
  $a_is_order = false 
)

show objectives

public

Parameters
object$tpltemplate object
Returns

Definition at line 237 of file class.ilContainerObjectiveGUI.php.

References $ilSetting, ilContainerContentGUI\$lng, $output_html, ilContainerContentGUI\$settings, ilContainerContentGUI\$tpl, ilCourseObjective\_getObjectiveIds(), addFooterRow(), ilContainerContentGUI\clearAdminCommandsDetermination(), ilAccordionGUI\FIRST_OPEN, ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilObjStyleSheet\getContentStylePath(), ilLOSettings\getInstanceByObjId(), ilObjStyleSheet\getSyntaxStylePath(), ilLOUtils\hasActiveRun(), ilContainerContentGUI\insertPageEmbeddedBlocks(), parseLOUserResults(), renderObjective(), showButton(), and ilLOSettings\TYPE_TEST_INITIAL.

Referenced by getMainContent().

238  {
239  $lng = $this->lng;
241  $tpl = $this->tpl;
242 
244 
245  // get embedded blocks
246  $has_container_page = false;
247  if (!$a_is_order) {
248  $output_html = $this->getContainerGUI()->getContainerPageHTML();
249  if ($output_html != "") {
250  $has_container_page = true;
251  $this->output_html .= $this->insertPageEmbeddedBlocks($output_html);
252  }
253  unset($output_html);
254  }
255 
256  // All objectives
257  include_once './Modules/Course/classes/class.ilCourseObjective.php';
258  if (!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
259  return false;
260  }
261 
262  include_once('./Modules/Course/classes/class.ilCourseObjectiveListGUI.php');
263  $this->objective_list_gui = new ilCourseObjectiveListGUI();
264  $this->objective_list_gui->setContainerObject($this->getContainerGUI());
265  if ($ilSetting->get("icon_position_in_lists") == "item_rows") {
266  $this->objective_list_gui->enableIcon(true);
267  }
268 
269  $acc = null;
270  if (!$a_is_order) {
271  include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
272  $acc = new ilAccordionGUI();
273  $acc->setUseSessionStorage(true);
274  $acc->setAllowMultiOpened(true);
275  $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
276  $acc->setId("crsobjtv_" . $this->container_obj->getId());
277  } else {
278  $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives'));
279  }
280 
281  $lur_data = $this->parseLOUserResults();
282 
283  $has_initial = ilLOSettings::getInstanceByObjId($this->container_obj->getId())->worksWithInitialTest();
284 
285  $has_lo_page = false;
286  $obj_cnt = 0;
287  foreach ($objective_ids as $objective_id) {
288  include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
289  if (
290  $has_initial &&
291  (
292  !isset($lur_data[$objective_id]) or
294  $this->container_obj->getId(),
295  ilLOSettings::getInstanceByObjId($this->container_obj->getId())->getInitialTest(),
296  $objective_id
297  )
298  )
299  ) {
300  $lur_data[$objective_id] = array("type" => ilLOSettings::TYPE_TEST_INITIAL);
301  }
302 
303  if ($html = $this->renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id])) {
304  $this->renderer->addItemToBlock('lobj', 'lobj', $objective_id, $html);
305  }
306  $obj_cnt++;
307  }
308 
309  // buttons for showing/hiding all objectives
310  if (!$a_is_order && $obj_cnt > 1) {
311  $this->showButton("", $lng->txt("crs_show_all_obj"), "", "crs_show_all_obj_btn");
312  $this->showButton("", $lng->txt("crs_hide_all_obj"), "", "crs_hide_all_obj_btn");
313  $acc->setShowAllElement("crs_show_all_obj_btn");
314  $acc->setHideAllElement("crs_hide_all_obj_btn");
315  }
316 
317  if (!$has_container_page && $has_lo_page) {
318  // add core co page css
319  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
320  $tpl->setVariable(
321  "LOCATION_CONTENT_STYLESHEET",
323  );
324  $tpl->setCurrentBlock("SyntaxStyle");
325  $tpl->setVariable(
326  "LOCATION_SYNTAX_STYLESHEET",
328  );
329  $tpl->parseCurrentBlock();
330  }
331 
332  // order/block
333  if ($a_is_order) {
334  $this->addFooterRow();
335 
336  $this->output_html .= $output_html . $this->renderer->getHTML();
337 
338  $this->renderer->resetDetails();
339  }
340  // view/accordion
341  else {
342  $this->output_html .= "<div class='ilCrsObjAcc'>" . $acc->getHTML() . "</div>";
343  }
344  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getInstanceByObjId($a_obj_id)
get singleton instance
static hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
static _getObjectiveIds($course_id, $a_activated_only=false)
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
parseLOUserResults()
Parse learning objective results.
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container object.
static getSyntaxStylePath()
get syntax style path
clearAdminCommandsDetermination()
cleaer administration commands determination
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
global $ilSetting
Definition: privfeed.php:17
List gui for course objectives.
Accordion user interface class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStatus()

ilContainerObjectiveGUI::showStatus (   $tpl)

show status

public

Parameters

Definition at line 213 of file class.ilContainerObjectiveGUI.php.

References $ilUser, ilContainerContentGUI\$lng, ilContainerContentGUI\$user, ilContainerContentGUI\getContainerObject(), ilCourseObjectiveResultCache\getStatus(), and IL_OBJECTIVE_STATUS_EMPTY.

214  {
216  $lng = $this->lng;
217 
218  include_once('./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
219 
220  $status = ilCourseObjectiveResultCache::getStatus($ilUser->getId(), $this->getContainerObject()->getId());
221  if ($status == IL_OBJECTIVE_STATUS_EMPTY) {
222  return;
223  }
224  $info_tpl = new ilTemplate('tpl.crs_objectives_view_info_table.html', true, true, 'Modules/Course');
225  $info_tpl->setVariable("INFO_STRING", $lng->txt('crs_objectives_info_' . $status));
226 
227  $this->output_html .= $info_tpl->get();
228  }
const IL_OBJECTIVE_STATUS_EMPTY
getContainerObject()
Get container object.
static getStatus($a_usr_id, $a_crs_id)
get status of user
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ updateResult()

ilContainerObjectiveGUI::updateResult (   $a_res,
  $a_item_ref_id,
  $a_objective_id,
  $a_user_id 
)
protected

Definition at line 715 of file class.ilContainerObjectiveGUI.php.

References ilObject\_lookupObjId(), ilObjTest\isParticipantsLastPassActive(), and ilLOTestRun\lookupRunExistsForObjective().

Referenced by addItemDetails().

716  {
717  if ($this->loc_settings->getQualifiedTest() == $a_item_ref_id) {
718  // Check for existing test run, and decrease tries, reset final if run exists
719  include_once './Modules/Test/classes/class.ilObjTest.php';
720  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
722  $a_item_ref_id,
723  $a_user_id
724  );
725 
726  if ($active) {
727  include_once './Modules/Course/classes/Objectives/class.ilLOTestRun.php';
729  ilObject::_lookupObjId($a_item_ref_id),
730  $a_objective_id,
731  $a_user_id
732  )) {
733  ($a_res['tries'] > 0) ? --$a_res['tries'] : 0;
734  $a_res['is_final'] = 0;
735  }
736  }
737  }
738  return $a_res;
739  }
static lookupRunExistsForObjective($a_test_id, $a_objective_id, $a_user_id)
type $ilDB
static _lookupObjId($a_id)
static isParticipantsLastPassActive($testRefId, $userId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $force_details

ilContainerObjectiveGUI::$force_details = 0
protected

Definition at line 31 of file class.ilContainerObjectiveGUI.php.

◆ $loc_settings

ilContainerObjectiveGUI::$loc_settings
protected

Definition at line 36 of file class.ilContainerObjectiveGUI.php.

Referenced by getSettings().

◆ $logger

ilContainerObjectiveGUI::$logger = null
private

Definition at line 19 of file class.ilContainerObjectiveGUI.php.

◆ $output_html

ilContainerObjectiveGUI::$output_html = ''
private

Definition at line 41 of file class.ilContainerObjectiveGUI.php.

Referenced by showObjectives().

◆ $tabs

ilContainerObjectiveGUI::$tabs
protected

Definition at line 24 of file class.ilContainerObjectiveGUI.php.

Referenced by getMainContent().

◆ $test_assignments

ilContainerObjectiveGUI::$test_assignments = null
private

Definition at line 43 of file class.ilContainerObjectiveGUI.php.

Referenced by getTestAssignments().

◆ $toolbar

ilContainerObjectiveGUI::$toolbar
protected

Definition at line 29 of file class.ilContainerObjectiveGUI.php.

Referenced by showButton().

◆ MATERIALS_OTHER

const ilContainerObjectiveGUI::MATERIALS_OTHER = 2

Definition at line 39 of file class.ilContainerObjectiveGUI.php.

◆ MATERIALS_TESTS

const ilContainerObjectiveGUI::MATERIALS_TESTS = 1

Definition at line 38 of file class.ilContainerObjectiveGUI.php.


The documentation for this class was generated from the following file: