ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilScormLP.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "Services/Object/classes/class.ilObjectLP.php";
6 
14 class ilScormLP extends ilObjectLP
15 {
16  public function getDefaultMode()
17  {
19  }
20 
21  public function getValidModes()
22  {
23  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
24  $subtype = ilObjSAHSLearningModule::_lookupSubType($this->obj_id);
25  if($subtype != "scorm2004")
26  {
27  if($this->checkSCORMPreconditions())
28  {
29  return array(ilLPObjSettings::LP_MODE_SCORM);
30  }
31 
32  include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfSCOs.php";
33  $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
34  if(sizeof($collection->getPossibleItems()))
35  {
38  }
40  }
41  else
42  {
43  if($this->checkSCORMPreconditions())
44  {
45  return array(ilLPObjSettings::LP_MODE_SCORM,
47  }
48 
49  include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfSCOs.php";
50  $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
51  if(sizeof($collection->getPossibleItems()))
52  {
56  }
57 
60  }
61  }
62 
63  public function getCurrentMode()
64  {
65  if($this->checkSCORMPreconditions())
66  {
68  }
69  return parent::getCurrentMode();
70  }
71 
72  protected function checkSCORMPreconditions()
73  {
74  include_once('./Services/AccessControl/classes/class.ilConditionHandler.php');
75  if(count(ilConditionHandler::_getConditionsOfTrigger('sahs', $this->obj_id)))
76  {
77  return true;
78  }
79  return false;
80  }
81 }
82 
83 ?>
_getConditionsOfTrigger($a_trigger_obj_type, $a_trigger_id)
get all conditions of trigger object
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
checkSCORMPreconditions()