ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
5include_once "Services/Object/classes/class.ilObjectLP.php";
6
14class 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 {
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 {
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()