ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

 ilSCORMObject ($a_id=0)
 Constructor. More...
 
 getId ()
 
 setId ($a_id)
 
 getType ()
 
 setType ($a_type)
 
 getTitle ()
 
 setTitle ($a_title)
 
 getSLMId ()
 
 setSLMId ($a_slm_id)
 
 read ()
 
 _lookupPresentableItems ($a_slm_id)
 Count number of presentable SCOs/Assets of SCORM learning module. More...
 
 create ()
 Create database record for SCORM object. More...
 
 update ()
 Updates database record for SCORM object. More...
 
 delete ()
 
_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.

Member Function Documentation

◆ _getInstance()

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

get instance of specialized GUI class

static

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

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

References $ilDB.

Referenced by ilObjSAHSLearningModule\delete().

+ Here is the caller graph for this function:

◆ _lookupPresentableItems()

ilSCORMObject::_lookupPresentableItems (   $a_slm_id)

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

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

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

References $ilDB.

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

+ 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 140 of file class.ilSCORMObject.php.

141 {
142 global $ilDB;
143
144 $nextId = $ilDB->nextId('scorm_object');
145 $this->setId($nextId);
146
147 $ilDB->manipulateF('
148 INSERT INTO scorm_object (obj_id,title, c_type, slm_id)
149 VALUES (%s,%s,%s,%s) ',
150 array('integer','text','text','integer'),
151 array($nextId, $this->getTitle(),$this->getType(), $this->getSLMId()));
152
153
154 }

References $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 176 of file class.ilSCORMObject.php.

177 {
178 global $ilDB;
179 $ilDB->manipulateF('DELETE FROM scorm_object WHERE obj_id = %s',
180 array('integer'),array($this->getId()) );
181
182 }

References $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:

◆ ilSCORMObject()

ilSCORMObject::ilSCORMObject (   $a_id = 0)

Constructor.

Parameters
int$a_idObject ID @access public

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

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

References read().

+ Here is the call 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 $ilDB;
102
103 $obj_set = $ilDB->queryF('SELECT * FROM scorm_object WHERE obj_id = %s',
104 array('integer'),array($this->getId()));
105 $obj_rec = $ilDB->fetchAssoc($obj_set);
106 $this->setTitle($obj_rec["title"]);
107 $this->setType($obj_rec["c_type"]);
108 $this->setSLMId($obj_rec["slm_id"]);
109 }

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

Referenced by ilSCORMObject().

+ 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\ilSCORMOrganizations(), ilSCORMResources\ilSCORMResources(), read(), ilSCORMResource\setHRef(), and ilSCORMManifest\setImportId().

+ Here is the caller graph for this function:

◆ setType()

ilSCORMObject::setType (   $a_type)

◆ update()

ilSCORMObject::update ( )

Updates database record for SCORM object.

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

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

161 {
162 global $ilDB;
163
164 $ilDB->manipulateF('
165 UPDATE scorm_object
166 SET title = %s,
167 c_type = %s,
168 slm_id = %s
169 WHERE obj_id = %s',
170 array('text','text','integer','integer'),
171 array($this->getTitle(),$this->getType(), $this->getSLMId(),$this->getId())
172 );
173
174 }

References $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: