ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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['title'] = $item['title'];
79  $tmp["status"] = $this->isAssignedEntry($sco_id);
80 
81  $data[] = $tmp;
82  }
83 
84  return $data;
85  }
86 
87 
88  //
89  // HELPER
90  //
91 
92  // see ilSCORMCertificateAdapter
93  public function getScoresForUserAndCP_Node_Id($item_id, $user_id)
94  {
95  include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
96  switch(ilObjSAHSLearningModule::_lookupSubType($this->obj_id))
97  {
98  case 'hacp':
99  case 'aicc':
100  include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
101  return ilObjAICCLearningModule::_getScoresForUser($item_id, $user_id);
102 
103  case 'scorm':
104  include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
105  //include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
106  return ilObjSCORMLearningModule::_getScoresForUser($item_id, $user_id);
107 
108  case 'scorm2004':
109  include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
110  return ilObjSCORM2004LearningModule::_getScores2004ForUser($item_id, $user_id);
111  }
112 
113  return array("raw" => null, "max" => null, "scaled" => null);
114  }
115 }
116 
117 ?>