ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
_getInstance ($a_id, $a_slm_id)
 get instance of specialized GUI class More...
 

Static Public Member Functions

static _lookupPresentableItems ($a_slm_id)
 Count number of presentable SCOs/Assets of SCORM learning module. 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 public

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

References read().

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) ...
+ Here is the call graph for this function:

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.

References $ilDB, and array.

Referenced by ilObjSAHSLearningModule\delete().

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 Item.
Create styles array
The data for the language used.
SCORM Resources Element.
global $ilDB
+ 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 114 of file class.ilSCORMObject.php.

References $ilDB, and array.

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

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  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ create()

ilSCORMObject::create ( )

Create database record for SCORM object.

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

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

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  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilSCORMObject::delete ( )

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

References $ilDB, array, and getId().

177  {
178  global $ilDB;
179  $ilDB->manipulateF('DELETE FROM scorm_object WHERE obj_id = %s',
180  array('integer'),array($this->getId()) );
181 
182  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getId()

◆ getSLMId()

ilSCORMObject::getSLMId ( )

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

References $slm_id.

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

90  {
91  return $this->slm_id;
92  }
+ Here is the caller graph for this function:

◆ getTitle()

ilSCORMObject::getTitle ( )

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

References $title.

Referenced by create(), and update().

80  {
81  return $this->title;
82  }
+ Here is the caller graph for this function:

◆ getType()

ilSCORMObject::getType ( )

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

References $type.

Referenced by create(), and update().

70  {
71  return $this->type;
72  }
+ Here is the caller graph for this function:

◆ read()

ilSCORMObject::read ( )

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

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

Referenced by __construct().

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  }
Create styles array
The data for the language used.
global $ilDB
+ 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.

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

65  {
66  $this->id = $a_id;
67  }
+ Here is the caller graph for this function:

◆ setSLMId()

ilSCORMObject::setSLMId (   $a_slm_id)

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

Referenced by read().

95  {
96  $this->slm_id = $a_slm_id;
97  }
+ Here is the caller graph for this function:

◆ setTitle()

ilSCORMObject::setTitle (   $a_title)

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

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

85  {
86  $this->title = $a_title;
87  }
+ Here is the caller graph for this function:

◆ setType()

ilSCORMObject::setType (   $a_type)

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

References $a_type.

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

75  {
76  $this->type = $a_type;
77  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ update()

ilSCORMObject::update ( )

Updates database record for SCORM object.

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

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

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  }
Create styles array
The data for the language used.
global $ilDB
+ 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: