ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSCORMObject Class Reference

Parent object for all SCORM objects, that are stored in table scorm_object. More...

+ Inheritance diagram for ilSCORMObject:
+ Collaboration diagram for ilSCORMObject:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 getId ()
 
 setId ($a_id)
 
 getType ()
 
 setType ($a_type)
 
 getTitle ()
 
 setTitle ($a_title)
 
 getSLMId ()
 
 setSLMId ($a_slm_id)
 
 read ()
 
 create ()
 Create database record for SCORM object. More...
 
 update ()
 Updates database record for SCORM object. More...
 
 delete ()
 

Static Public Member Functions

static _lookupPresentableItems ($a_slm_id)
 Count number of presentable SCOs/Assets of SCORM learning module. More...
 
static & _getInstance ($a_id, $a_slm_id)
 get instance of specialized GUI class More...
 

Data Fields

 $id
 
 $title
 
 $type
 
 $slm_id
 

Detailed Description

Parent object for all SCORM objects, that are stored in table scorm_object.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 33 of file class.ilSCORMObject.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORMObject::__construct (   $a_id = 0)

Constructor.

Parameters
int$a_idObject ID @access public

Reimplemented in ilSCORMItem, ilSCORMManifest, ilSCORMOrganization, ilSCORMOrganizations, ilSCORMResource, and ilSCORMResources.

Definition at line 47 of file class.ilSCORMObject.php.

48 {
49 global $DIC;
50 $ilias = $DIC['ilias'];
51
52 $this->ilias = $ilias;
53 $this->id = $a_id;
54 if ($a_id > 0) {
55 $this->read();
56 }
57 }
global $DIC
Definition: goto.php:24
redirection script todo: (a better solution should control the processing via a xml file)

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static & ilSCORMObject::_getInstance (   $a_id,
  $a_slm_id 
)
static

get instance of specialized GUI class

static

Definition at line 199 of file class.ilSCORMObject.php.

200 {
201 global $DIC;
202 $ilDB = $DIC['ilDB'];
203
204 $sc_set = $ilDB->queryF(
205 '
206 SELECT c_type FROM scorm_object
207 WHERE obj_id = %s
208 AND slm_id = %s',
209 array('integer','integer'),
210 array($a_id, $a_slm_id)
211 );
212 $sc_rec = $ilDB->fetchAssoc($sc_set);
213
214 switch ($sc_rec["c_type"]) {
215 case "sit": // item
216 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
217 $item = new ilSCORMItem($a_id);
218 return $item;
219 break;
220
221 case "sos": // organizations
222 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMOrganizations.php");
223 $sos = new ilSCORMOrganizations($a_id);
224 return $sos;
225 break;
226
227 case "sor": // organization
228 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMOrganization.php");
229 $sor = new ilSCORMOrganization($a_id);
230 return $sor;
231 break;
232
233 case "sma": // manifest
234 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMManifest.php");
235 $sma = new ilSCORMManifest($a_id);
236 return $sma;
237 break;
238
239 case "srs": // resources
240 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResources.php");
241 $srs = new ilSCORMResources($a_id);
242 return $srs;
243 break;
244
245 case "sre": // resource
246 include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
247 $sre = new ilSCORMResource($a_id);
248 return $sre;
249 break;
250 }
251 }
SCORM Resources Element.
global $ilDB

References $DIC, and $ilDB.

Referenced by ilObjSAHSLearningModule\delete().

+ Here is the caller graph for this function:

◆ _lookupPresentableItems()

static ilSCORMObject::_lookupPresentableItems (   $a_slm_id)
static

Count number of presentable SCOs/Assets of SCORM learning module.

Definition at line 118 of file class.ilSCORMObject.php.

119 {
120 global $DIC;
121 $ilDB = $DIC['ilDB'];
122
123 $set = $ilDB->queryF(
124 "
125 SELECT sit.obj_id id
126 FROM scorm_object sob, sc_item sit
127 WHERE sob.slm_id = %s
128 AND sob.obj_id = sit.obj_id
129 AND sit.identifierref IS NOT NULL",
130 array('integer'),
131 array($a_slm_id)
132 );
133 $items = array();
134 while ($rec = $ilDB->fetchAssoc($set)) {
135 $items[] = $rec["id"];
136 }
137
138 return $items;
139 }

References $DIC, and $ilDB.

Referenced by ilSCORMPresentationGUI\frameset(), ilSCORMPresentationGUI\launchSahs(), and ilObjSCORMTracking\storeJsApiCmi().

+ Here is the caller graph for this function:

◆ create()

ilSCORMObject::create ( )

Create database record for SCORM object.

Reimplemented in ilSCORMItem, ilSCORMManifest, ilSCORMOrganization, ilSCORMOrganizations, ilSCORMResource, and ilSCORMResources.

Definition at line 145 of file class.ilSCORMObject.php.

146 {
147 global $DIC;
148 $ilDB = $DIC['ilDB'];
149
150 $nextId = $ilDB->nextId('scorm_object');
151 $this->setId($nextId);
152
153 $ilDB->manipulateF(
154 '
155 INSERT INTO scorm_object (obj_id,title, c_type, slm_id)
156 VALUES (%s,%s,%s,%s) ',
157 array('integer','text','text','integer'),
158 array($nextId, $this->getTitle(),$this->getType(), $this->getSLMId())
159 );
160 }

References $DIC, $ilDB, getSLMId(), getTitle(), getType(), and setId().

+ Here is the call graph for this function:

◆ delete()

ilSCORMObject::delete ( )

Reimplemented in ilSCORMItem, ilSCORMManifest, ilSCORMOrganization, ilSCORMOrganizations, ilSCORMResource, and ilSCORMResources.

Definition at line 183 of file class.ilSCORMObject.php.

184 {
185 global $DIC;
186 $ilDB = $DIC['ilDB'];
187 $ilDB->manipulateF(
188 'DELETE FROM scorm_object WHERE obj_id = %s',
189 array('integer'),
190 array($this->getId())
191 );
192 }

References $DIC, $ilDB, and getId().

+ Here is the call graph for this function:

◆ getId()

◆ getSLMId()

ilSCORMObject::getSLMId ( )

Definition at line 89 of file class.ilSCORMObject.php.

90 {
91 return $this->slm_id;
92 }

References $slm_id.

Referenced by create(), ilSCORMItem\delete(), ilSCORMItem\getTrackingDataOfUser(), and update().

+ Here is the caller graph for this function:

◆ getTitle()

ilSCORMObject::getTitle ( )

Definition at line 79 of file class.ilSCORMObject.php.

80 {
81 return $this->title;
82 }

References $title.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getType()

ilSCORMObject::getType ( )

Definition at line 69 of file class.ilSCORMObject.php.

70 {
71 return $this->type;
72 }

References $type.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ read()

ilSCORMObject::read ( )

Reimplemented in ilSCORMItem, ilSCORMManifest, ilSCORMOrganization, ilSCORMOrganizations, ilSCORMResource, and ilSCORMResources.

Definition at line 99 of file class.ilSCORMObject.php.

100 {
101 global $DIC;
102 $ilDB = $DIC['ilDB'];
103
104 $obj_set = $ilDB->queryF(
105 'SELECT * FROM scorm_object WHERE obj_id = %s',
106 array('integer'),
107 array($this->getId())
108 );
109 $obj_rec = $ilDB->fetchAssoc($obj_set);
110 $this->setTitle($obj_rec["title"]);
111 $this->setType($obj_rec["c_type"]);
112 $this->setSLMId($obj_rec["slm_id"]);
113 }

References $DIC, $ilDB, getId(), setSLMId(), setTitle(), and setType().

Referenced by __construct().

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

◆ setId()

ilSCORMObject::setId (   $a_id)

Definition at line 64 of file class.ilSCORMObject.php.

65 {
66 $this->id = $a_id;
67 }

Referenced by create(), and ilSCORMResource\readByIdRef().

+ Here is the caller graph for this function:

◆ setSLMId()

ilSCORMObject::setSLMId (   $a_slm_id)

Definition at line 94 of file class.ilSCORMObject.php.

95 {
96 $this->slm_id = $a_slm_id;
97 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilSCORMObject::setTitle (   $a_title)

Definition at line 84 of file class.ilSCORMObject.php.

85 {
86 $this->title = $a_title;
87 }

Referenced by ilSCORMOrganizations\__construct(), ilSCORMResources\__construct(), read(), ilSCORMResource\setHRef(), and ilSCORMManifest\setImportId().

+ Here is the caller graph for this function:

◆ setType()

ilSCORMObject::setType (   $a_type)

Definition at line 74 of file class.ilSCORMObject.php.

75 {
76 $this->type = $a_type;
77 }

Referenced by ilSCORMItem\__construct(), ilSCORMManifest\__construct(), ilSCORMOrganization\__construct(), ilSCORMOrganizations\__construct(), ilSCORMResource\__construct(), ilSCORMResources\__construct(), and read().

+ Here is the caller graph for this function:

◆ update()

ilSCORMObject::update ( )

Updates database record for SCORM object.

Reimplemented in ilSCORMItem, ilSCORMManifest, ilSCORMOrganization, ilSCORMOrganizations, ilSCORMResource, and ilSCORMResources.

Definition at line 166 of file class.ilSCORMObject.php.

167 {
168 global $DIC;
169 $ilDB = $DIC['ilDB'];
170
171 $ilDB->manipulateF(
172 '
173 UPDATE scorm_object
174 SET title = %s,
175 c_type = %s,
176 slm_id = %s
177 WHERE obj_id = %s',
178 array('text','text','integer','integer'),
179 array($this->getTitle(),$this->getType(), $this->getSLMId(),$this->getId())
180 );
181 }

References $DIC, $ilDB, getId(), getSLMId(), getTitle(), and getType().

+ Here is the call graph for this function:

Field Documentation

◆ $id

ilSCORMObject::$id

Definition at line 35 of file class.ilSCORMObject.php.

Referenced by getId().

◆ $slm_id

ilSCORMObject::$slm_id

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

Referenced by getSLMId().

◆ $title

ilSCORMObject::$title

Definition at line 36 of file class.ilSCORMObject.php.

Referenced by getTitle().

◆ $type

ilSCORMObject::$type

Definition at line 37 of file class.ilSCORMObject.php.

Referenced by getType().


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