ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $ilias;
50
51 $this->ilias = $ilias;
52 $this->id = $a_id;
53 if ($a_id > 0) {
54 $this->read();
55 }
56 }
redirection script todo: (a better solution should control the processing via a xml file)

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

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

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

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

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

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

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

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

References $ilDB, and getId().

+ Here is the call graph for this function:

◆ getId()

◆ getSLMId()

ilSCORMObject::getSLMId ( )

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

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

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

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

References $title.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getType()

ilSCORMObject::getType ( )

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

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

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

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

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

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

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

+ Here is the caller graph for this function:

◆ setSLMId()

ilSCORMObject::setSLMId (   $a_slm_id)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilSCORMObject::setTitle (   $a_title)

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

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

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

74 {
75 $this->type = $a_type;
76 }
$a_type
Definition: workflow.php:92

References $a_type.

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

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

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: