ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilLPCollectionOfSCOs.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 require_once "Services/Tracking/classes/collection/class.ilLPCollection.php";
6 
17 {
18  protected static $possible_items = array();
19 
20  // see ilSCORMCertificateAdapter
21  public function getPossibleItems()
22  {
23  if(!isset(self::$possible_items[$this->obj_id]))
24  {
25  include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
26 
27  $items = array();
28 
29  switch(ilObjSAHSLearningModule::_lookupSubType($this->obj_id))
30  {
31  case 'hacp':
32  case 'aicc':
33  include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
34  foreach(ilObjAICCLearningModule::_getTrackingItems($this->obj_id) as $item)
35  {
36  $items[$item['obj_id']]['title'] = $item['title'];
37  }
38  break;
39 
40  case 'scorm':
41  include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
42  include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
43  foreach(ilObjSCORMLearningModule::_getTrackingItems($this->obj_id) as $item)
44  {
45  $items[$item->getId()]['title'] = $item->getTitle();
46  }
47  break;
48 
49  case 'scorm2004':
50  include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
51  foreach(ilObjSCORM2004LearningModule::_getTrackingItems($this->obj_id) as $item)
52  {
53  $items[$item['id']]['title'] = $item['title'];
54  }
55  break;
56  }
57 
58  self::$possible_items[$this->obj_id] = $items;
59  }
60 
61  return self::$possible_items[$this->obj_id];
62  }
63 
64 
65  //
66  // TABLE GUI
67  //
68 
69  public function getTableGUIData($a_parent_ref_id)
70  {
71  $data = array();
72 
73  foreach($this->getPossibleItems() as $sco_id => $item)
74  {
75  $tmp = array();
76  $tmp['id'] = $sco_id;
77  $tmp['ref_id'] = 0;
78  $tmp['type'] = 'sco';
79  $tmp['title'] = $item['title'];
80  $tmp["status"] = $this->isAssignedEntry($sco_id);
81 
82  $data[] = $tmp;
83  }
84 
85  return $data;
86  }
87 
88 
89  //
90  // HELPER
91  //
92 
93  // see ilSCORMCertificateAdapter
94  public function getScoresForUserAndCP_Node_Id($item_id, $user_id)
95  {
96  include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
97  switch(ilObjSAHSLearningModule::_lookupSubType($this->obj_id))
98  {
99  case 'hacp':
100  case 'aicc':
101  include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
102  return ilObjAICCLearningModule::_getScoresForUser($item_id, $user_id);
103 
104  case 'scorm':
105  include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
106  //include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
107  return ilObjSCORMLearningModule::_getScoresForUser($item_id, $user_id);
108 
109  case 'scorm2004':
110  include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
111  return ilObjSCORM2004LearningModule::_getScores2004ForUser($item_id, $user_id);
112  }
113 
114  return array("raw" => null, "max" => null, "scaled" => null);
115  }
116 }
117 
118 ?>
static _getTrackingItems($a_obj_id)
get all tracking items of scorm object
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
static _getScores2004ForUser($a_cp_node_id, $a_user)
Create styles array
The data for the language used.
static _getTrackingItems($a_obj_id)
get all tracking items of scorm object static
LP collection base class.
isAssignedEntry($a_item_id)
getScoresForUserAndCP_Node_Id($item_id, $user_id)
static _getTrackingItems($a_obj_id)
get all tracking items of scorm object
static _getScoresForUser($a_item_id, $a_user_id)