ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. 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 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
 
 $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 ()
 
 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
 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

 $force_details = 0
 
 $loc_settings
 
- Protected Attributes inherited from ilContainerContentGUI
 $details_level = self::DETAILS_DEACTIVATED
 
 $renderer
 

Private Attributes

 $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 35 of file class.ilContainerObjectiveGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerObjectiveGUI::__construct (   $a_container_gui)

Constructor.

@access public

Parameters
objectcontainer gui object
Returns

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

55 {
56 global $lng;
57
58 $this->lng = $lng;
59 parent::__construct($a_container_gui);
60
61 $this->initDetails();
62 $this->initTestAssignments();
63 }
global $lng
Definition: privfeed.php:40

References $lng, initDetails(), and initTestAssignments().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFooterRow()

ilContainerObjectiveGUI::addFooterRow ( )

add footer row

@access public

Parameters

return

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

362 {
363 // no details
364 return;
365
366 /*
367 global $ilCtrl;
368
369 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getContainerObject()->getRefId());
370 $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "1");
371 $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
372 $this->renderer->addDetailsLevel(2, $url, ($this->details_level == self::DETAILS_TITLE));
373
374 $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "2");
375 $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
376 $this->renderer->addDetailsLevel(3, $url, ($this->details_level == self::DETAILS_ALL));
377
378 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
379 */
380 }

Referenced by showObjectives().

+ Here is the caller graph for this function:

◆ addItemDetails()

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

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

619 {
620 global $lng, $ilCtrl;
621
622 $item_ref_id = $a_item["ref_id"];
623
624 if(is_array($this->objective_map))
625 {
626 $details = array();
627 if(isset($this->objective_map["material"][$item_ref_id]))
628 {
629 // #12965
630 foreach($this->objective_map["material"][$item_ref_id] as $objective_id)
631 {
632 $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $objective_id);
633 $url = $ilCtrl->getLinkTargetByClass(array('illoeditorgui', 'ilcourseobjectivesgui'), 'edit');
634 $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', '');
635
636 $details[] = array(
637 'desc' => $lng->txt('crs_loc_tab_materials').': ',
638 'target' => '_top',
639 'link' => $url,
640 'name' => $this->objective_map["names"][$objective_id]
641 );
642 }
643 }
644 if($this->objective_map["test_i"] == $item_ref_id)
645 {
646 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
647 $details[] = array(
648 'desc' => '',
649 'target' => '_top',
650 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
651 'name' => $lng->txt('crs_loc_tab_itest')
652 );
653 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
654 }
655 if($this->objective_map["test_q"] == $item_ref_id)
656 {
657 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
658 $details[] = array(
659 'desc' => '',
660 'target' => '_top',
661 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'),
662 'name' => $lng->txt('crs_loc_tab_qtest')
663 );
664 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
665 }
666
667 // #15367
668 if(is_array($this->objective_map["test_ass"][$item_ref_id]))
669 {
670 foreach($this->objective_map["test_ass"][$item_ref_id] as $type => $items)
671 {
673 {
674 $caption = $lng->txt('crs_loc_tab_itest');
675 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1);
676 }
677 else
678 {
679 $caption = $lng->txt('crs_loc_tab_qtest');
680 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2);
681 }
682 foreach($items as $objtv_title)
683 {
684 $details[] = array(
685 'desc' => '',
686 'target' => '_top',
687 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testsOverview'),
688 'name' => $caption." (".$this->lng->txt("crs_loc_learning_objective").": ".$objtv_title.")"
689 );
690 }
691 $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0);
692 }
693 }
694
695 if(sizeof($details))
696 {
697 $a_item_list_gui->enableItemDetailLinks(true);
698 $a_item_list_gui->setItemDetailLinks($details, $lng->txt('crs_loc_settings_tbl').': ');
699 }
700 else
701 {
702 $a_item_list_gui->enableItemDetailLinks(false);
703 }
704 }
705
706 // order
707 if($this->getContainerGUI()->isActiveOrdering())
708 {
709 $a_item_list_gui->enableCommands(true, true);
710 $a_item_list_gui->enableProperties(false);
711 }
712 // view
713 else if(!$this->getContainerGUI()->isActiveAdministrationPanel())
714 {
715 $a_item_list_gui->enableCommands(true, true);
716 $a_item_list_gui->enableProperties(false);
717 }
718
719 if($a_item['objective_id'])
720 {
721 $a_item_list_gui->setDefaultCommandParameters(array('objective_id' => $a_item['objective_id']));
722
723
724 if($this->loc_settings->getQualifiedTest() == $a_item['ref_id'])
725 {
726 $a_item_list_gui->setConditionTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj');
727 // check conditions of target
728 include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
729 $fullfilled = ilConditionHandler::_checkAllConditionsOfTarget($this->getContainerObject()->getRefId(),$a_item['objective_id'],'lobj');
730 if(!$fullfilled || $a_item['objective_status'])
731 {
732 $a_item_list_gui->disableTitleLink(true);
733 }
734 }
735 include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php';
737 $this->getContainerObject()->getId(),
738 $GLOBALS['ilUser']->getId(),
739 $a_item['objective_id'],
741
742 $res = $this->updateResult($res,$a_item['ref_id'],$a_item['objective_id'],$GLOBALS['ilUser']->getId());
743
744 if($res['is_final'])
745 {
746 $a_item_list_gui->disableTitleLink(true);
747 $a_item_list_gui->enableProperties(true);
748 $a_item_list_gui->addCustomProperty(
749 $this->lng->txt('crs_loc_passes_reached'),
750 '',
751 true
752 );
753 }
754 elseif($this->loc_settings->getQualifiedTest() == $a_item['ref_id'])
755 {
756 include_once './Modules/Course/classes/class.ilCourseObjective.php';
757 $poss_pass = ilCourseObjective::lookupMaxPasses($a_item['objective_id']);
758
759 if($poss_pass)
760 {
761 $a_item_list_gui->enableProperties(true);
762 $a_item_list_gui->addCustomProperty(
763 $this->lng->txt('crs_loc_passes_left'),
764 (($poss_pass - $res['tries']) > 0) ? ($poss_pass - $res['tries']) : 1,
765 false
766 );
767 }
768 }
769 }
770 }
_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
getContainerObject()
Get container object.
getContainerGUI()
Get container GUI object.
updateResult($a_res, $a_item_ref_id, $a_objective_id, $a_user_id)
static lookupMaxPasses($a_objective_id)
static lookupResult($a_course_obj_id, $a_user_id, $a_objective_id, $a_tst_type)
Lookup user result.
setConditionTarget($a_ref_id, $a_obj_id, $a_target_type)
enableCommands($a_status, $a_std_only=false)
En/disable commands.
setDefaultCommandParameters(array $a_params)
enableProperties($a_status)
En/disable properties.
addCustomProperty($a_property="", $a_value="", $a_alert=false, $a_newline=false)
add custom property
enableItemDetailLinks($a_status)
enable item detail links E.g Direct links to chapters or pages
setItemDetailLinks($a_detail_links, $a_intro_txt='')
set items detail links
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
global $ilCtrl
Definition: ilias.php:18
$url
Definition: shib_logout.php:72

References $GLOBALS, $ilCtrl, $lng, $res, $url, 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().

+ Here is the call graph for this function:

◆ buildAccordionContent()

ilContainerObjectiveGUI::buildAccordionContent ( array  $a_items)
protected

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

1310 {
1311 $tpl = new ilTemplate("tpl.objective_accordion_content.html", true, true, "Services/Container");
1312 foreach($a_items as $item)
1313 {
1314 $tpl->setCurrentBlock("items_bl");
1315 $tpl->setVariable("ITEM", $item);
1316 $tpl->parseCurrentBlock();
1317 }
1318 return $tpl->get();
1319 }
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR

References $tpl.

Referenced by showMaterials().

+ Here is the caller graph for this function:

◆ buildAccordionTitle()

ilContainerObjectiveGUI::buildAccordionTitle ( ilCourseObjective  $a_objective,
array  $a_lo_result = null 
)
protected

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

1286 {
1287 $tpl = new ilTemplate("tpl.objective_accordion_title.html", true, true, "Services/Container");
1288
1289 if($a_lo_result)
1290 {
1291 $tpl->setVariable("PROGRESS_BAR", self::buildObjectiveProgressBar(
1292 (bool) $this->loc_settings->worksWithInitialTest(),
1293 $a_objective->getObjectiveId(),
1294 $a_lo_result)
1295 );
1296 }
1297
1298 // $tpl->setVariable("ICON_SRC", ilObject::_getIcon($a_objective->getObjectiveId(), "small", "lobj"));
1299 // $tpl->setVariable("ICON_TXT", $this->lng->txt("icon")." ".$this->lng->txt("crs_objectives"));
1300 $tpl->setVariable("TITLE", $this->lng->txt("crs_loc_learning_objective").": ".trim($a_objective->getTitle()));
1301 $tpl->setVariable("DESCRIPTION", nl2br(trim($a_objective->getDescription())));
1302
1303 // #15510
1304 $tpl->setVariable("ANCHOR_ID", "objtv_acc_".$a_objective->getObjectiveId());
1305
1306 return $tpl->get();
1307 }

References $tpl, ilCourseObjective\getDescription(), ilCourseObjective\getObjectiveId(), and ilCourseObjective\getTitle().

Referenced by renderObjective().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildObjectiveMap()

ilContainerObjectiveGUI::buildObjectiveMap ( )
protected

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

565 {
566 $objective_map = array();
567 include_once './Modules/Course/classes/class.ilCourseObjective.php';
568 // begin-patch lok
569 if(count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(),true)))
570 // end-patch lok
571 {
572 include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
573 foreach($objective_ids as $objective_id)
574 {
575 foreach(ilCourseObjectiveMaterials::_getAssignedMaterials($objective_id) as $mat_ref_id)
576 {
577 $objective_map["material"][$mat_ref_id][] = $objective_id;
578
579 if(!isset($objective_map["names"][$objective_id]))
580 {
581 $objective = new ilCourseObjective($this->getContainerObject(), $objective_id);
582 $objective_map["names"][$objective_id] = $objective->getTitle();
583 }
584 }
585 }
586
587 // initial/qualifying test
588 $tst = $this->loc_settings->getInitialTest();
589 if($tst)
590 {
591 $objective_map["test_i"] = $tst;
592 }
593 $tst = $this->loc_settings->getQualifiedTest();
594 if($tst)
595 {
596 $objective_map["test_q"] = $tst;
597 }
598
599 // objective test assignments
600 include_once 'Modules/Course/classes/Objectives/class.ilLOSettings.php';
601 include_once 'Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
602 $ass_test = new ilLOTestAssignments($this->getContainerObject()->getId());
603 foreach($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_INITIAL) as $ass)
604 {
605 $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
606 $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
607 }
608 foreach($ass_test->getAssignmentsByType(ilLOSettings::TYPE_TEST_QUALIFIED) as $ass)
609 {
610 $title = ilCourseObjective::lookupObjectiveTitle($ass->getObjectiveId());
611 $objective_map["test_ass"][$ass->getTestRefId()][$ass->getAssignmentType()][] = $title;
612 }
613 }
614
615 return $objective_map;
616 }
static _getAssignedMaterials($a_objective_id)
get assigned materials
class ilcourseobjective
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
static _getObjectiveIds($course_id, $a_activated_only=false)
Settings for LO courses.

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

Referenced by showMaterials().

+ 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 1179 of file class.ilContainerObjectiveGUI.php.

1180 {
1181 global $lng;
1182
1183 // tooltip (has to be unique!)
1184
1185 $tooltip_id = "crsobjtvusr_".$a_objective_id."_".$a_lo_result["type"]."_".((int)$a_sub);
1186 if($a_tt_suffix !== null)
1187 {
1188 $tooltip_id .= "_".$a_tt_suffix;
1189 }
1190
1191 $tt_txt = sprintf(
1192 $lng->txt("crs_loc_tt_info"),
1193 $a_lo_result["result_perc"],
1194 $a_lo_result["limit_perc"]
1195 );
1196
1197
1198 include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
1199 include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
1200
1201 $is_qualified = ($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED);
1202 $is_qualified_initial = ($a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
1203 ilLOSettings::getInstanceByObjId($a_lo_result['course_id'])->isInitialTestQualifying());
1204 $has_completed = ($a_lo_result["status"] == ilLOUserResults::STATUS_COMPLETED);
1205
1206 $next_step = $progress_txt = $bar_color = $test_url = $initial_sub = null;
1207
1208 if($is_qualified ||
1209 $is_qualified_initial)
1210 {
1211 $progress_txt = $lng->txt("crs_loc_progress_result_qtest");
1212 $tt_txt = $lng->txt("crs_loc_tab_qtest").": ".$tt_txt;
1213
1214 if($has_completed)
1215 {
1216 $next_step = $lng->txt("crs_loc_progress_objective_complete");
1217 $bar_color = "ilCourseObjectiveProgressBarCompleted";
1218
1219 // render 2nd progressbar if there is also an initial test
1220 if($is_qualified &&
1221 $a_has_initial_test &&
1222 is_array($a_lo_result["initial"]))
1223 {
1224 $a_lo_result["initial"]["itest"] = $a_lo_result["itest"];
1225
1226 // force list mode to get rid of next step
1227 $initial_sub = self::buildObjectiveProgressBar(true, $a_objective_id, $a_lo_result["initial"], true, true, $a_tt_suffix);
1228 }
1229 }
1230 else
1231 {
1232 $next_step = $lng->txt("crs_loc_progress_do_qualifying_again");
1233 $bar_color = "ilCourseObjectiveProgressBarFailed";
1234 }
1235 }
1236 // initial test
1237 else
1238 {
1239 if($a_lo_result["status"])
1240 {
1241 $progress_txt = $lng->txt("crs_loc_progress_result_itest");
1242 $tt_txt = $lng->txt("crs_loc_tab_itest").": ".$tt_txt;
1243
1244 $bar_color = "ilCourseObjectiveProgressBarNeutral";
1245 $next_step = $has_completed
1246 ? $lng->txt("crs_loc_progress_do_qualifying")
1247 : $lng->txt("crs_loc_suggested");
1248 }
1249 // not attempted: no progress bar
1250 else
1251 {
1252 $next_step = (bool)$a_has_initial_test
1253 ? $lng->txt("crs_loc_progress_no_result_do_initial")
1254 : $lng->txt("crs_loc_progress_no_result_no_initial");
1255 }
1256 }
1257
1258 // link to test statistics
1259 $relevant_test_id = $a_lo_result["qtest"]
1260 ? $a_lo_result["qtest"]
1261 : $a_lo_result["itest"];
1262 if($relevant_test_id)
1263 {
1264 $test_url = ilLOUtils::getTestResultLinkForUser($relevant_test_id, $a_lo_result["user_id"]);
1265 }
1266
1268 $a_lo_result["result_perc"],
1269 $a_lo_result["limit_perc"],
1270 $bar_color,
1271 $progress_txt,
1272 $test_url,
1273 $tooltip_id,
1274 $tt_txt,
1275 $a_list_mode
1276 ? null
1277 : $next_step,
1278 $initial_sub,
1279 $a_list_mode
1280 ? 30
1281 : 10
1282 );
1283 }
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.
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 getInstanceByObjId($a_obj_id)
get singleton instance
static getTestResultLinkForUser($a_test_ref_id, $a_user_id)

References $lng, buildObjectiveProgressBar(), ilLOSettings\getInstanceByObjId(), ilLOUtils\getTestResultLinkForUser(), renderProgressBar(), ilLOUserResults\STATUS_COMPLETED, ilLOUserResults\TYPE_INITIAL, and ilLOUserResults\TYPE_QUALIFIED.

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

+ 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

@access public

Parameters

return

Reimplemented from ilContainerContentGUI.

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

92 {
93 // no details anymore
94 return self::DETAILS_ALL;
95 }

References ilContainerContentGUI\DETAILS_ALL.

Referenced by renderObjective().

+ Here is the caller graph for this function:

◆ getMainContent()

ilContainerObjectiveGUI::getMainContent ( )

Impementation of abstract method getMainContent.

@access public

Returns

Reimplemented from ilContainerContentGUI.

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

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

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

+ Here is the call graph for this function:

◆ getSettings()

ilContainerObjectiveGUI::getSettings ( )
Returns
ilLOSettings

Definition at line 77 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 69 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

@access protected

Parameters

return

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

1028 {
1029 global $ilUser;
1030
1031 // no details
1032 return;
1033
1034 }

References $ilUser.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ initTestAssignments()

ilContainerObjectiveGUI::initTestAssignments ( )
protected

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

1037 {
1038 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
1039 $this->test_assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
1040 }
static getInstance($a_container_id)
Get instance by container id.

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseLOUserResults()

ilContainerObjectiveGUI::parseLOUserResults ( )
protected

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

1043 {
1044 global $ilUser;
1045
1046 $res = array();
1047
1048 include_once "Modules/Course/classes/Objectives/class.ilLOTestAssignments.php";
1049 $lo_ass = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
1050
1051 include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1052 $lur = new ilLOUserResults($this->getContainerObject()->getId(), $ilUser->getId());
1053 foreach($lur->getCourseResultsForUserPresentation() as $objective_id => $types)
1054 {
1055 // show either initial or qualified for objective
1056 if(isset($types[ilLOUserResults::TYPE_INITIAL]))
1057 {
1058 $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
1059 }
1060
1061 // qualified test has priority
1062 if(isset($types[ilLOUserResults::TYPE_QUALIFIED]))
1063 {
1066 $result["initial"] = $types[ilLOUserResults::TYPE_INITIAL];
1067 }
1068 else
1069 {
1072 }
1073
1074 $result["initial_status"] = $initial_status;
1075
1076 $result["itest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
1077 $result["qtest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
1078
1079 $res[$objective_id] = $result;
1080 }
1081
1082 return $res;
1083 }
$result

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

Referenced by showObjectives().

+ 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

@access protected

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

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

812 {
813 global $ilUser,$lng;
814
815 include_once('./Modules/Course/classes/class.ilCourseObjective.php');
816 $objective = new ilCourseObjective($this->getContainerObject(),$a_objective_id);
817
818 include_once('./Services/Container/classes/class.ilContainerSorting.php');
819 include_once('./Services/Object/classes/class.ilObjectActivation.php');
820 $items = ilObjectActivation::getItemsByObjective($a_objective_id);
821
822 // sorting is handled by ilCourseObjectiveMaterials
823 // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
824
825 include_once('./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
826 $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
827
828 // #13381 - map material assignment to position
829 $sort_map = array();
830 foreach($objectives_lm_obj->getMaterials() as $item)
831 {
832 $sort_map[$item["lm_ass_id"]] = $item["position"];
833 }
834
835 $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
836 $is_order = $this->getContainerGUI()->isActiveOrdering();
837
838 $sort_content = array();
839
840 foreach($items as $item)
841 {
842 if($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL)
843 {
844 continue;
845 }
846
847 $item_list_gui2 = $this->getItemGUI($item);
848 $item_list_gui2->enableIcon(true);
849
850 if($is_order || $a_accordion)
851 {
852 $item_list_gui2->enableCommands(true, true);
853 $item_list_gui2->enableProperties(false);
854 }
855
856 $chapters = $objectives_lm_obj->getChapters();
857 if(count($chapters))
858 {
859 $has_sections = false;
860 foreach($chapters as $chapter)
861 {
862 if($chapter['ref_id'] != $item['child'])
863 {
864 continue;
865 }
866 $has_sections = true;
867
868 include_once './Modules/LearningModule/classes/class.ilLMObject.php';
869 $title = $item['title'].
870 " &rsaquo; ".ilLMObject::_lookupTitle($chapter['obj_id']).
871 " (".$lng->txt('obj_'.$chapter['type']).")";
872
873 $item_list_gui2->setDefaultCommandParameters(array(
874 "obj_id" => $chapter['obj_id'],
875 "focus_id" => $chapter['obj_id'],
876 "focus_return" => $this->container_obj->getRefId()));
877
878 if($is_order)
879 {
880 $item_list_gui2->setPositionInputField("[lobj][".$a_objective_id."][".$chapter['lm_ass_id']."]",
881 sprintf('%d', $chapter['position']*10));
882 }
883
884 $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'],
885 $item['obj_id'], $title, $item['description']);
886
887 // #13381 - use materials order
888 $sort_key = str_pad($chapter['position'], 5, 0, STR_PAD_LEFT)."_".strtolower($title)."_".$chapter['lm_ass_id'];
889 $sort_content[$sort_key] = $sub_item_html;
890 }
891 }
892
893 $this->rendered_items[$item['child']] = true;
894
895 if($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true))
896 {
897 if($is_order)
898 {
899 $item_list_gui2->setPositionInputField("[lobj][".$a_objective_id."][".$lm_ass_id."]",
900 sprintf('%d', $sort_map[$lm_ass_id]*10));
901 }
902
903 $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'],
904 $item['obj_id'], $item['title'], $item['description']);
905
906 // #13381 - use materials order
907 $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT)."_".strtolower($item['title'])."_".$lm_ass_id;
908 $sort_content[$sort_key] = $sub_item_html;
909 }
910 }
911
912 if($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL)
913 {
914 $this->objective_list_gui->enableCommands(false);
915 }
916 else
917 {
918 $this->objective_list_gui->enableCommands(true);
919 }
920
921 if($is_order)
922 {
923 $this->objective_list_gui->setPositionInputField("[lobj][".$a_objective_id."][0]",
924 $objective->__getPosition()*10);
925 }
926
927 ksort($sort_content);
928
929 if(!$a_accordion)
930 {
931 foreach($sort_content as $sub_item_html)
932 {
933 $this->objective_list_gui->addSubItemHTML($sub_item_html);
934 }
935
936 return $this->objective_list_gui->getListItemHTML(
937 0,
938 $a_objective_id,
939 $objective->getTitle(),
940 $objective->getDescription(),
941 ($is_manage || $is_order));
942 }
943 else
944 {
945 $acc_content = $sort_content;
946
947 $initial_shown = false;
948 $initial_test_ref_id = $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL);
949 $initial_test_obj_id = ilObject::_lookupObjId($initial_test_ref_id);
950 include_once './Modules/Test/classes/class.ilObjTestAccess.php';
951
952 if(
953 $initial_test_obj_id &&
954 $this->getSettings()->hasSeparateInitialTests() &&
956 )
957 {
958 $acc_content[] = $this->renderTest(
959 $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL),
960 $a_objective_id,
961 true,
962 false,
963 $a_lo_result);
964 $initial_shown = TRUE;
965 }
966 elseif($this->getSettings()->hasSeparateQualifiedTests())
967 {
968 $acc_content[] = $this->renderTest(
969 $this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED),
970 $a_objective_id,
971 false,
972 false,
973 $a_lo_result);
974 }
975
976
977 /*
978 if($this->loc_settings->getInitialTest() &&
979 $this->loc_settings->getType() == ilLOSettings::LOC_INITIAL_SEL &&
980 !$a_lo_risult["initial_status"])
981 {
982 $acc_content[] = $this->renderTest($this->loc_settings->getInitialTest(), $a_objective_id, true, false, $a_lo_result);
983 $initial_shown = true;
984 }
985 if(!$initial_shown &&
986 $this->loc_settings->getQualifiedTest() &&
987 $this->loc_settings->isQualifiedTestPerObjectiveVisible())
988 {
989 $acc_content[] = $this->renderTest($this->loc_settings->getQualifiedTest(), $a_objective_id, false, false, $a_lo_result);
990 }
991 */
992
993 $co_page = null;
994 include_once("./Services/COPage/classes/class.ilPageUtil.php");
995 if(ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId()))
996 {
997 $a_has_lo_page = true;
998
999 include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
1000 $page_gui = new ilLOPageGUI($objective->getObjectiveId());
1001
1002 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1003 $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
1004 $page_gui->setPresentationTitle("");
1005 $page_gui->setTemplateOutput(false);
1006 $page_gui->setHeader("");
1007
1008 $co_page = "<div class='ilContObjectiveIntro'>".$page_gui->showPage()."</div>";
1009 }
1010
1011 $a_accordion->addItem(
1012 $this->buildAccordionTitle($objective, $a_lo_result),
1013 $co_page.
1014 $this->buildAccordionContent($acc_content),
1015 (isset($_GET["oobj"]) && (int)$_GET["oobj"] == $objective->getObjectiveId())
1016 );
1017 }
1018 }
$_GET["client_id"]
addItem($a_header, $a_content, $a_force_open=false)
Add item.
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
buildAccordionTitle(ilCourseObjective $a_objective, array $a_lo_result=null)
getDetailsLevel($a_objective_id)
get details level
getTestAssignments()
Get test assignments object.
class ilCourseObjectiveMaterials
(Course) learning objective page GUI class
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getItemsByObjective($a_objective_id)
Get objective items.
_existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)

References $_GET, $ilUser, $lng, ilPageUtil\_existsAndNotEmpty(), ilObject\_lookupObjId(), 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().

+ 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 1100 of file class.ilContainerObjectiveGUI.php.

1101 {
1102 $tpl = new ilTemplate("tpl.objective_progressbar.html", true, true, "Services/Container");
1103
1104 if($a_perc_result !== null)
1105 {
1106 $tpl->setCurrentBlock("statusbar_bl");
1107 $tpl->setVariable("PERC_STATUS", $a_perc_result);
1108 $tpl->setVariable("PERC_WIDTH", $a_perc_result);
1109 $tpl->setVariable("PERC_COLOR", $a_css);
1110 if($a_perc_limit)
1111 {
1112 // :TODO: magic?
1113 $limit_pos = (99-(int)$a_perc_limit)*-1;
1114 $tpl->setVariable("LIMIT_POS", $limit_pos);
1115 }
1116 if($a_tt_txt &&
1117 $a_tt_id)
1118 {
1119 $tpl->setVariable("TT_ID", $a_tt_id);
1120 }
1121 $tpl->parseCurrentBlock();
1122 }
1123
1124 if($a_caption)
1125 {
1126 if($a_url)
1127 {
1128 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1129 $button = ilLinkButton::getInstance();
1130 $button->setCaption($a_caption, false);
1131 $button->setUrl($a_url);
1132
1133 $tpl->setCurrentBlock("statustxt_bl");
1134 $tpl->setVariable("TXT_PROGRESS_STATUS", $button->render());
1135 $tpl->parseCurrentBlock();
1136 }
1137 else
1138 {
1139 $tpl->setCurrentBlock("statustxt_no_link_bl");
1140 $tpl->setVariable("TXT_PROGRESS_STATUS_NO_LINK", $a_caption);
1141 $tpl->parseCurrentBlock();
1142 }
1143 }
1144
1145 if($a_next_step)
1146 {
1147 $tpl->setCurrentBlock("nstep_bl");
1148 $tpl->setVariable("TXT_NEXT_STEP", $a_next_step);
1149 $tpl->parseCurrentBlock();
1150 }
1151
1152 if($a_tt_id &&
1153 $a_tt_txt)
1154 {
1155 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1156 ilTooltipGUI::addTooltip($a_tt_id, $a_tt_txt);
1157 }
1158
1159 if($a_sub)
1160 {
1161 $tpl->setVariable("SUB_STYLE", ' style="padding-left: '.$a_sub_style.'px;"');
1162 $tpl->setVariable("SUB_INIT", $a_sub);
1163 }
1164
1165 return $tpl->get();
1166 }
static getInstance()
Factory.
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.

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

Referenced by buildObjectiveProgressBar(), and ilStudyProgrammeProgressListGUI\buildProgressBar().

+ Here is the call graph for this function:
+ Here is the caller 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 382 of file class.ilContainerObjectiveGUI.php.

383 {
384 $node_data = array();
385 if($a_test_ref_id)
386 {
387 $node_data = $GLOBALS['tree']->getNodeData($a_test_ref_id);
388 }
389 if(!$node_data['child'])
390 {
391 return '';
392 }
393
394 // update ti
395 if($a_objective_id)
396 {
397 if($a_is_initial)
398 {
399 $title = sprintf($this->lng->txt('crs_loc_itst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
400 }
401 else
402 {
403 $title = sprintf($this->lng->txt('crs_loc_qtst_for_objective'), ilCourseObjective::lookupObjectiveTitle($a_objective_id));
404 }
405 $node_data['objective_id'] = $a_objective_id;
406 $node_data['objective_status'] =
407 (
408 $a_lo_result['status'] == ilLOUserResults::STATUS_COMPLETED ?
409 false :
410 false
411 );
412 }
413 else
414 {
415 $obj_id = ilObject::_lookupObjId($a_test_ref_id);
416 $title = ilObject::_lookupTitle($obj_id);
417
418 $title .= (
419 ' ('.
420 (
421 $a_is_initial
422 ? $this->lng->txt('crs_loc_itest_info')
423 : $this->lng->txt('crs_loc_qtest_info')
424 ).
425 ')'
426 );
427 $node_data['objective_id'] = 0;
428 }
429
430 $node_data['title'] = $title;
431
432 return "<div class='ilContObjectivesViewTestItem'>".$this->renderItem($node_data)."</div>";
433 }
static _lookupTitle($a_id)
lookup object title

References $GLOBALS, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilCourseObjective\lookupObjectiveTitle(), and ilLOUserResults\STATUS_COMPLETED.

Referenced by getMainContent(), and renderObjective().

+ 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

@access protected

Parameters

return

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

1329 {
1330 global $ilToolbar, $ilCtrl;
1331
1332 // #11842
1333 $ilToolbar->addButton($a_text,
1334 $ilCtrl->getLinkTarget($this->getContainerGUI(),$a_cmd),
1335 $a_target, "", '', $a_id);
1336 }

References $ilCtrl.

Referenced by getMainContent(), and showObjectives().

+ 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.

@access public

Parameters
object$tpltemplate object
Returns
void

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

443 {
444 global $ilAccess, $lng;
445
447
448 if (is_array($this->items["_all"]))
449 {
450 $this->objective_map = $this->buildObjectiveMap();
451
452 // all rows
453 $item_r = array();
454
455 $position = 1;
456 foreach($this->items["_all"] as $k => $item_data)
457 {
458 if($a_mode == self::MATERIALS_TESTS and $item_data['type'] != 'tst')
459 {
460 continue;
461 }
462 if ($item_data['type'] == 'itgr')
463 {
464 continue;
465 }
466 if(!$a_is_manage)
467 {
468 // if test object is qualified or initial do not show here
469 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
470 include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
471 $assignments = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
472 if($assignments->getTypeByTest($item_data['child']) != ilLOSettings::TYPE_TEST_UNDEFINED)
473 {
474 continue;
475 }
476 }
477
478 if($this->rendered_items[$item_data["child"]] !== true &&
479 !$this->renderer->hasItem($item_data["child"]))
480 {
481 $this->rendered_items[$item_data['child']] = true;
482
483 // TODO: Position (DONE ?)
484 $html = $this->renderItem($item_data,$position++,$a_mode == self::MATERIALS_TESTS ? false : true);
485 if ($html != "")
486 {
487 $item_r[] = array("html" => $html, "id" => $item_data["child"], "type" => $item_data["type"]);
488 }
489 }
490 }
491
492 // if we have at least one item, output the block
493 if (count($item_r) > 0)
494 {
495 if(!$a_as_accordion)
496 {
497 $pos = 0;
498
499 switch($a_mode)
500 {
502 $block_id = "tst";
503 $this->renderer->addTypeBlock($block_id);
504 break;
505
507 $block_id = "oth";
508 $this->renderer->addCustomBlock($block_id, $lng->txt('crs_other_resources'));
509 break;
510
511 // manage
512 default:
513 $block_id = "all";
514 $this->renderer->addCustomBlock($block_id, $lng->txt('content'));
515 break;
516 }
517
518 // :TODO:
519 if ($a_mode != self::MATERIALS_TESTS)
520 {
521 $pos = $this->getItemGroupsHTML();
522 }
523
524 foreach($item_r as $h)
525 {
526 if(!$this->renderer->hasItem($h["id"]))
527 {
528 $this->renderer->addItemToBlock($block_id, $h["type"], $h["id"], $h["html"]);
529 }
530 }
531
532 $this->output_html .= $this->renderer->getHTML();
533 }
534 else
535 {
536 switch($a_mode)
537 {
539 $txt = $lng->txt('objs_tst');
540 break;
541
543 $txt = $lng->txt('crs_other_resources');
544 break;
545 }
546
547 include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
548 $acc = new ilAccordionGUI();
549 $acc->setId("crsobjtvmat".$a_mode."_".$this->container_obj->getId());
550
551 $acc_content = array();
552 foreach($item_r as $h)
553 {
554 $acc_content[] = $h["html"];
555 }
556 $acc->addItem($txt, $this->buildAccordionContent($acc_content));
557
558 $this->output_html .= $acc->getHTML();
559 }
560 }
561 }
562 }
Accordion user interface class.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
clearAdminCommandsDetermination()
cleaer administration commands determination
$txt
Definition: error.php:12
$html
Definition: example_001.php:87
$h

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

Referenced by getMainContent().

+ 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

@access public

Parameters
object$tpltemplate object
Returns

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

239 {
240 global $lng,$ilSetting;
241
243
244 // get embedded blocks
245 $has_container_page = false;
246 if(!$a_is_order)
247 {
248 $output_html = $this->getContainerGUI()->getContainerPageHTML();
249 if ($output_html != "")
250 {
251 $has_container_page = true;
252 $this->output_html .= $this->insertPageEmbeddedBlocks($output_html);
253 }
254 unset($output_html);
255 }
256
257 // All objectives
258 include_once './Modules/Course/classes/class.ilCourseObjective.php';
259 if(!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(),true)))
260 {
261 return false;
262 }
263
264 include_once('./Modules/Course/classes/class.ilCourseObjectiveListGUI.php');
265 $this->objective_list_gui = new ilCourseObjectiveListGUI();
266 $this->objective_list_gui->setContainerObject($this->getContainerGUI());
267 if ($ilSetting->get("icon_position_in_lists") == "item_rows")
268 {
269 $this->objective_list_gui->enableIcon(true);
270 }
271
272 $acc = null;
273 if(!$a_is_order)
274 {
275 include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
276 $acc = new ilAccordionGUI();
277 $acc->setUseSessionStorage(true);
278 $acc->setAllowMultiOpened(true);
279 $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
280 $acc->setId("crsobjtv_".$this->container_obj->getId());
281 }
282 else
283 {
284 $this->renderer->addCustomBlock('lobj',$lng->txt('crs_objectives'));
285 }
286
287 $lur_data = $this->parseLOUserResults();
288
289 $has_initial = ilLOSettings::getInstanceByObjId($this->container_obj->getId())->worksWithInitialTest();
290
291 $has_lo_page = false;
292 $obj_cnt = 0;
293 foreach($objective_ids as $objective_id)
294 {
295 include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
296 if(
297 $has_initial &&
298 (
299 !isset($lur_data[$objective_id]) or
301 $this->container_obj->getId(),
302 ilLOSettings::getInstanceByObjId($this->container_obj->getId())->getInitialTest(),
303 $objective_id)
304 )
305 )
306 {
307 $lur_data[$objective_id] = array("type"=>ilLOSettings::TYPE_TEST_INITIAL);
308 }
309
310 if($html = $this->renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id]))
311 {
312 $this->renderer->addItemToBlock('lobj', 'lobj', $objective_id, $html);
313 }
314 $obj_cnt++;
315 }
316
317 // buttons for showing/hiding all objectives
318 if (!$a_is_order && $obj_cnt > 1)
319 {
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 {
328 // add core co page css
329 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
330 $GLOBALS["tpl"]->setVariable("LOCATION_CONTENT_STYLESHEET",
332 $GLOBALS["tpl"]->setCurrentBlock("SyntaxStyle");
333 $GLOBALS["tpl"]->setVariable("LOCATION_SYNTAX_STYLESHEET",
335 $GLOBALS["tpl"]->parseCurrentBlock();
336 }
337
338 // order/block
339 if($a_is_order)
340 {
341 $this->addFooterRow();
342
343 $this->output_html .= $output_html.$this->renderer->getHTML();
344
345 $this->renderer->resetDetails();
346 }
347 // view/accordion
348 else
349 {
350 $this->output_html .= "<div class='ilCrsObjAcc'>".$acc->getHTML()."</div>";
351 }
352 }
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion=null, array $a_lo_result=null)
render objective
List gui for course objectives.
static hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path
global $ilSetting
Definition: privfeed.php:40

References $GLOBALS, $html, $ilSetting, $lng, $output_html, 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStatus()

ilContainerObjectiveGUI::showStatus (   $tpl)

show status

@access public

Parameters

return

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

216 {
217 global $ilUser,$lng;
218
219 include_once('./Modules/Course/classes/class.ilCourseObjectiveResultCache.php');
220
221 $status = ilCourseObjectiveResultCache::getStatus($ilUser->getId(),$this->getContainerObject()->getId());
222 if($status == IL_OBJECTIVE_STATUS_EMPTY) {
223 return;
224 }
225 $info_tpl = new ilTemplate('tpl.crs_objectives_view_info_table.html',true,true,'Modules/Course');
226 $info_tpl->setVariable("INFO_STRING",$lng->txt('crs_objectives_info_'.$status));
227
228 $this->output_html .= $info_tpl->get();
229 }
const IL_OBJECTIVE_STATUS_EMPTY
static getStatus($a_usr_id, $a_crs_id)
get status of user

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

+ 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 772 of file class.ilContainerObjectiveGUI.php.

773 {
774
775 if($this->loc_settings->getQualifiedTest() == $a_item_ref_id)
776 {
777 // Check for existing test run, and decrease tries, reset final if run exists
778 include_once './Modules/Test/classes/class.ilObjTest.php';
779 include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
781 $a_item_ref_id,
782 $a_user_id);
783
784 if($active)
785 {
786 include_once './Modules/Course/classes/Objectives/class.ilLOTestRun.php';
788 ilObject::_lookupObjId($a_item_ref_id),
789 $a_objective_id,
790 $a_user_id))
791 {
792 ($a_res['tries'] > 0) ? --$a_res['tries'] : 0;
793 $a_res['is_final'] = 0;
794 }
795 }
796 }
797 return $a_res;
798
799 }
static lookupRunExistsForObjective($a_test_id, $a_objective_id, $a_user_id)
@global type $ilDB
static isParticipantsLastPassActive($testRefId, $userId)

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

Referenced by addItemDetails().

+ 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 37 of file class.ilContainerObjectiveGUI.php.

◆ $loc_settings

ilContainerObjectiveGUI::$loc_settings
protected

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

Referenced by getSettings().

◆ $output_html

ilContainerObjectiveGUI::$output_html = ''
private

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

Referenced by showObjectives().

◆ $test_assignments

ilContainerObjectiveGUI::$test_assignments = null
private

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

Referenced by getTestAssignments().

◆ MATERIALS_OTHER

const ilContainerObjectiveGUI::MATERIALS_OTHER = 2

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

Referenced by showMaterials().

◆ MATERIALS_TESTS

const ilContainerObjectiveGUI::MATERIALS_TESTS = 1

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

Referenced by showMaterials().


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