ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSCORMItem Class Reference

SCORM Item. More...

+ Inheritance diagram for ilSCORMItem:
+ Collaboration diagram for ilSCORMItem:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 getImportId ()
 
 setImportId ($a_import_id)
 
 getIdentifierRef ()
 
 setIdentifierRef ($a_id_ref)
 
 getVisible ()
 
 setVisible ($a_visible)
 
 getParameters ()
 
 setParameters ($a_par)
 
 getPrereqType ()
 
 setPrereqType ($a_p_type)
 
 getPrerequisites ()
 
 setPrerequisites ($a_pre)
 
 getMaxTimeAllowed ()
 
 setMaxTimeAllowed ($a_max)
 
 getTimeLimitAction ()
 
 setTimeLimitAction ($a_lim_act)
 
 getDataFromLms ()
 
 setDataFromLms ($a_data)
 
 getMasteryScore ()
 
 setMasteryScore ($a_score)
 
 read ()
 
 create ()
 
 update ()
 
 getTrackingDataOfUser ($a_user_id=0)
 get tracking data of specified or current user More...
 
 delete ()
 
 insertTrackData ($a_lval, $a_rval, $a_obj_id)
 
- Public Member Functions inherited from ilSCORMObject
 __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 _lookupTrackingDataOfUser ($a_item_id, $a_user_id=0, $a_obj_id=0)
 
static _getItems ($a_obj_id)
 
static _lookupTitle ($a_obj_id)
 
- Static Public Member Functions inherited from ilSCORMObject
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

 $import_id
 
 $identifierref
 
 $isvisible
 
 $parameters
 
 $prereq_type
 
 $prerequisites
 
 $maxtimeallowed
 
 $timelimitaction
 
 $datafromlms
 
 $masteryscore
 
- Data Fields inherited from ilSCORMObject
 $id
 
 $title
 
 $type
 
 $slm_id
 

Detailed Description

SCORM Item.

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

Definition at line 15 of file class.ilSCORMItem.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORMItem::__construct (   $a_id = 0)

Constructor.

Parameters
int$a_idObject ID public

Definition at line 34 of file class.ilSCORMItem.php.

References ilSCORMObject\setType().

35  {
36  parent::__construct($a_id);
37  $this->setType("sit");
38  }
+ Here is the call graph for this function:

Member Function Documentation

◆ _getItems()

static ilSCORMItem::_getItems (   $a_obj_id)
static

Definition at line 310 of file class.ilSCORMItem.php.

References $ilDB, $res, $row, and array.

311  {
312  global $ilDB;
313 
314  $res = $ilDB->queryF(
315  '
316  SELECT obj_id FROM scorm_object
317  WHERE slm_id = %s
318  AND c_type = %s',
319  array('integer', 'text'),
320  array($a_obj_id, 'sit')
321  );
322  while ($row = $ilDB->fetchObject($res)) {
323  $item_ids[] = $row->obj_id;
324  }
325  return $item_ids ? $item_ids : array();
326  }
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
global $ilDB

◆ _lookupTitle()

static ilSCORMItem::_lookupTitle (   $a_obj_id)
static

Definition at line 328 of file class.ilSCORMItem.php.

References $ilDB, $res, $row, and array.

Referenced by ilLPStatusSCORM\_getStatusInfo().

329  {
330  global $ilDB;
331 
332  $res = $ilDB->queryF(
333  'SELECT title FROM scorm_object WHERE obj_id = %s',
334  array('integer'),
335  array($a_obj_id)
336  );
337 
338  while ($row = $ilDB->fetchObject($res)) {
339  return $row->title;
340  }
341  return '';
342  }
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupTrackingDataOfUser()

static ilSCORMItem::_lookupTrackingDataOfUser (   $a_item_id,
  $a_user_id = 0,
  $a_obj_id = 0 
)
static

Definition at line 251 of file class.ilSCORMItem.php.

References $ilDB, $ilUser, and array.

Referenced by ilSCORMExplorer\getOutputIcons().

252  {
253  global $ilDB, $ilUser;
254 
255  if ($a_user_id == 0) {
256  $a_user_id = $ilUser->getId();
257  }
258 
259  $track_set = $ilDB->queryF(
260  '
261  SELECT lvalue, rvalue FROM scorm_tracking
262  WHERE sco_id = %s
263  AND user_id = %s
264  AND obj_id = %s',
265  array('integer', 'integer', 'integer'),
266  array($a_item_id, $a_user_id, $a_obj_id)
267  );
268 
269  $trdata = array();
270  while ($track_rec = $ilDB->fetchAssoc($track_set)) {
271  $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
272  }
273 
274  return $trdata;
275  }
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ create()

ilSCORMItem::create ( )

Definition at line 169 of file class.ilSCORMItem.php.

References $ilDB, array, getDataFromLms(), ilSCORMObject\getId(), getIdentifierRef(), getImportId(), getMasteryScore(), getMaxTimeAllowed(), getParameters(), getPrereqType(), getPrerequisites(), getTimeLimitAction(), and getVisible().

170  {
171  global $ilDB;
172 
173  parent::create();
174 
175  $str_visible = ($this->getVisible()) ? 'true' : 'false';
176 
177  $ilDB->insert('sc_item', array(
178  'obj_id' => array('integer', $this->getId()),
179  'import_id' => array('text', $this->getImportId()),
180  'identifierref' => array('text', $this->getIdentifierRef()),
181  'isvisible' => array('text', $str_visible),
182  'parameters' => array('text', $this->getParameters()),
183  'prereq_type' => array('text', $this->getPrereqType()),
184  'prerequisites' => array('text', $this->getPrerequisites()),
185  'maxtimeallowed' => array('text', $this->getMaxTimeAllowed()),
186  'timelimitaction' => array('text', $this->getTimeLimitAction()),
187  'datafromlms' => array('clob', $this->getDataFromLms()),
188  'masteryscore' => array('text', $this->getMasteryScore())
189  ));
190  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilSCORMItem::delete ( )

Definition at line 277 of file class.ilSCORMItem.php.

References $ilDB, $ilLog, ilLPStatusWrapper\_refreshStatus(), array, ilSCORMObject\getId(), and ilSCORMObject\getSLMId().

278  {
279  global $ilDB, $ilLog;
280 
281  parent::delete();
282 
283  $ilDB->manipulateF(
284  'DELETE FROM sc_item WHERE obj_id = %s',
285  array('integer'),
286  array($this->getId())
287  );
288 
289  $ilLog->write("SAHS Delete(ScormItem): " .
290  'DELETE FROM scorm_tracking WHERE sco_id = ' . $this->getId() . ' AND obj_id = ' . $this->getSLMId());
291  $ilDB->manipulateF(
292  'DELETE FROM scorm_tracking WHERE sco_id = %s AND obj_id = %s',
293  array('integer', 'integer'),
294  array($this->getId(), $this->getSLMId())
295  );
296 
297  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
299  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getDataFromLms()

ilSCORMItem::getDataFromLms ( )

Definition at line 120 of file class.ilSCORMItem.php.

References $datafromlms.

Referenced by create(), and update().

121  {
122  return $this->datafromlms;
123  }
+ Here is the caller graph for this function:

◆ getIdentifierRef()

ilSCORMItem::getIdentifierRef ( )

Definition at line 50 of file class.ilSCORMItem.php.

References $identifierref.

Referenced by create(), and update().

51  {
52  return $this->identifierref;
53  }
+ Here is the caller graph for this function:

◆ getImportId()

ilSCORMItem::getImportId ( )

Definition at line 40 of file class.ilSCORMItem.php.

References $import_id.

Referenced by create(), and update().

41  {
42  return $this->import_id;
43  }
+ Here is the caller graph for this function:

◆ getMasteryScore()

ilSCORMItem::getMasteryScore ( )

Definition at line 130 of file class.ilSCORMItem.php.

References $masteryscore.

Referenced by create(), and update().

131  {
132  return $this->masteryscore;
133  }
+ Here is the caller graph for this function:

◆ getMaxTimeAllowed()

ilSCORMItem::getMaxTimeAllowed ( )

Definition at line 100 of file class.ilSCORMItem.php.

References $maxtimeallowed.

Referenced by create(), and update().

101  {
102  return $this->maxtimeallowed;
103  }
+ Here is the caller graph for this function:

◆ getParameters()

ilSCORMItem::getParameters ( )

Definition at line 70 of file class.ilSCORMItem.php.

References $parameters.

Referenced by create(), and update().

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

◆ getPrereqType()

ilSCORMItem::getPrereqType ( )

Definition at line 80 of file class.ilSCORMItem.php.

References $prereq_type.

Referenced by create(), and update().

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

◆ getPrerequisites()

ilSCORMItem::getPrerequisites ( )

Definition at line 90 of file class.ilSCORMItem.php.

References $prerequisites.

Referenced by create(), and update().

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

◆ getTimeLimitAction()

ilSCORMItem::getTimeLimitAction ( )

Definition at line 110 of file class.ilSCORMItem.php.

References $timelimitaction.

Referenced by create(), and update().

111  {
112  return $this->timelimitaction;
113  }
+ Here is the caller graph for this function:

◆ getTrackingDataOfUser()

ilSCORMItem::getTrackingDataOfUser (   $a_user_id = 0)

get tracking data of specified or current user

Definition at line 225 of file class.ilSCORMItem.php.

References $ilDB, $ilUser, array, ilSCORMObject\getId(), and ilSCORMObject\getSLMId().

226  {
227  global $ilDB, $ilUser;
228 
229  if ($a_user_id == 0) {
230  $a_user_id = $ilUser->getId();
231  }
232 
233  $track_set = $ilDB->queryF(
234  '
235  SELECT lvalue, rvalue FROM scorm_tracking
236  WHERE sco_id = %s
237  AND user_id = %s
238  AND obj_id = %s',
239  array('integer', 'integer', 'integer'),
240  array($this->getId(), $a_user_id, $this->getSLMId())
241  );
242 
243  $trdata = array();
244  while ($track_rec = $ilDB->fetchAssoc($track_set)) {
245  $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
246  }
247 
248  return $trdata;
249  }
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getVisible()

ilSCORMItem::getVisible ( )

Definition at line 60 of file class.ilSCORMItem.php.

References $isvisible.

Referenced by create(), and update().

61  {
62  return $this->isvisible;
63  }
+ Here is the caller graph for this function:

◆ insertTrackData()

ilSCORMItem::insertTrackData (   $a_lval,
  $a_rval,
  $a_obj_id 
)

Definition at line 302 of file class.ilSCORMItem.php.

References ilObjSCORMTracking\_insertTrackData(), and ilSCORMObject\getId().

303  {
304  require_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
305  //ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_ref_id);
306  ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
307  }
static _insertTrackData($a_sahs_id, $a_lval, $a_rval, $a_obj_id)
+ Here is the call graph for this function:

◆ read()

ilSCORMItem::read ( )

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

References $ilDB, array, ilSCORMObject\getId(), setDataFromLms(), setIdentifierRef(), setImportId(), setMasteryScore(), setMaxTimeAllowed(), setParameters(), setPrereqType(), setPrerequisites(), setTimeLimitAction(), and setVisible().

141  {
142  global $ilDB;
143 
144  parent::read();
145 
146  $obj_set = $ilDB->queryF(
147  'SELECT * FROM sc_item WHERE obj_id = %s',
148  array('integer'),
149  array($this->getId())
150  );
151  $obj_rec = $ilDB->fetchAssoc($obj_set);
152 
153  $this->setImportId($obj_rec["import_id"]);
154  $this->setIdentifierRef($obj_rec["identifierref"]);
155  if (strtolower($obj_rec["isvisible"]) == "false") {
156  $this->setVisible(false);
157  } else {
158  $this->setVisible(true);
159  }
160  $this->setParameters($obj_rec["parameters"]);
161  $this->setPrereqType($obj_rec["prereq_type"]);
162  $this->setPrerequisites($obj_rec["prerequisites"]);
163  $this->setMaxTimeAllowed($obj_rec["maxtimeallowed"]);
164  $this->setTimeLimitAction($obj_rec["timelimitaction"]);
165  $this->setDataFromLms($obj_rec["datafromlms"]);
166  $this->setMasteryScore($obj_rec["masteryscore"]);
167  }
setParameters($a_par)
setPrerequisites($a_pre)
setTimeLimitAction($a_lim_act)
setMasteryScore($a_score)
setVisible($a_visible)
setPrereqType($a_p_type)
Create styles array
The data for the language used.
setImportId($a_import_id)
setDataFromLms($a_data)
global $ilDB
setIdentifierRef($a_id_ref)
setMaxTimeAllowed($a_max)
+ Here is the call graph for this function:

◆ setDataFromLms()

ilSCORMItem::setDataFromLms (   $a_data)

Definition at line 125 of file class.ilSCORMItem.php.

Referenced by read().

126  {
127  $this->datafromlms = $a_data;
128  }
+ Here is the caller graph for this function:

◆ setIdentifierRef()

ilSCORMItem::setIdentifierRef (   $a_id_ref)

Definition at line 55 of file class.ilSCORMItem.php.

Referenced by read().

56  {
57  $this->identifierref = $a_id_ref;
58  }
+ Here is the caller graph for this function:

◆ setImportId()

ilSCORMItem::setImportId (   $a_import_id)

Definition at line 45 of file class.ilSCORMItem.php.

Referenced by read().

46  {
47  $this->import_id = $a_import_id;
48  }
+ Here is the caller graph for this function:

◆ setMasteryScore()

ilSCORMItem::setMasteryScore (   $a_score)

Definition at line 135 of file class.ilSCORMItem.php.

Referenced by read().

136  {
137  $this->masteryscore = $a_score;
138  }
+ Here is the caller graph for this function:

◆ setMaxTimeAllowed()

ilSCORMItem::setMaxTimeAllowed (   $a_max)

Definition at line 105 of file class.ilSCORMItem.php.

Referenced by read().

106  {
107  $this->maxtimeallowed = $a_max;
108  }
+ Here is the caller graph for this function:

◆ setParameters()

ilSCORMItem::setParameters (   $a_par)

Definition at line 75 of file class.ilSCORMItem.php.

Referenced by read().

76  {
77  $this->parameters = $a_par;
78  }
+ Here is the caller graph for this function:

◆ setPrereqType()

ilSCORMItem::setPrereqType (   $a_p_type)

Definition at line 85 of file class.ilSCORMItem.php.

Referenced by read().

86  {
87  $this->prereq_type = $a_p_type;
88  }
+ Here is the caller graph for this function:

◆ setPrerequisites()

ilSCORMItem::setPrerequisites (   $a_pre)

Definition at line 95 of file class.ilSCORMItem.php.

Referenced by read().

96  {
97  $this->prerequisites = $a_pre;
98  }
+ Here is the caller graph for this function:

◆ setTimeLimitAction()

ilSCORMItem::setTimeLimitAction (   $a_lim_act)

Definition at line 115 of file class.ilSCORMItem.php.

Referenced by read().

116  {
117  $this->timelimitaction = $a_lim_act;
118  }
+ Here is the caller graph for this function:

◆ setVisible()

ilSCORMItem::setVisible (   $a_visible)

Definition at line 65 of file class.ilSCORMItem.php.

Referenced by read().

66  {
67  $this->isvisible = $a_visible;
68  }
+ Here is the caller graph for this function:

◆ update()

ilSCORMItem::update ( )

Definition at line 192 of file class.ilSCORMItem.php.

References $ilDB, array, getDataFromLms(), ilSCORMObject\getId(), getIdentifierRef(), getImportId(), getMasteryScore(), getMaxTimeAllowed(), getParameters(), getPrereqType(), getPrerequisites(), getTimeLimitAction(), getVisible(), and League\Flysystem\Adapter\Polyfill\update().

193  {
194  global $ilDB;
195 
196  parent::update();
197 
198  $str_visible = ($this->getVisible()) ? 'true' : 'false';
199 
200  $ilDB->update(
201  'sc_item',
202  array(
203  'import_id' => array('text', $this->getImportId()),
204  'identifierref' => array('text', $this->getIdentifierRef()),
205  'isvisible' => array('text', $str_visible),
206  'parameters' => array('text', $this->getParameters()),
207  'prereq_type' => array('text', $this->getPrereqType()),
208  'prerequisites' => array('text', $this->getPrerequisites()),
209  'maxtimeallowed' => array('text', $this->getMaxTimeAllowed()),
210  'timelimitaction' => array('text', $this->getTimeLimitAction()),
211  'datafromlms' => array('clob', $this->getDataFromLms()),
212  'masteryscore' => array('text', $this->getMasteryScore())
213  ),
214  array(
215  'obj_id' => array('integer', $this->getId())
216  )
217  );
218  }
Create styles array
The data for the language used.
update($pash, $contents, Config $config)
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $datafromlms

ilSCORMItem::$datafromlms

Definition at line 25 of file class.ilSCORMItem.php.

Referenced by getDataFromLms().

◆ $identifierref

ilSCORMItem::$identifierref

Definition at line 18 of file class.ilSCORMItem.php.

Referenced by getIdentifierRef().

◆ $import_id

ilSCORMItem::$import_id

Definition at line 17 of file class.ilSCORMItem.php.

Referenced by getImportId().

◆ $isvisible

ilSCORMItem::$isvisible

Definition at line 19 of file class.ilSCORMItem.php.

Referenced by getVisible().

◆ $masteryscore

ilSCORMItem::$masteryscore

Definition at line 26 of file class.ilSCORMItem.php.

Referenced by getMasteryScore().

◆ $maxtimeallowed

ilSCORMItem::$maxtimeallowed

Definition at line 23 of file class.ilSCORMItem.php.

Referenced by getMaxTimeAllowed().

◆ $parameters

ilSCORMItem::$parameters

Definition at line 20 of file class.ilSCORMItem.php.

Referenced by getParameters().

◆ $prereq_type

ilSCORMItem::$prereq_type

Definition at line 21 of file class.ilSCORMItem.php.

Referenced by getPrereqType().

◆ $prerequisites

ilSCORMItem::$prerequisites

Definition at line 22 of file class.ilSCORMItem.php.

Referenced by getPrerequisites().

◆ $timelimitaction

ilSCORMItem::$timelimitaction

Definition at line 24 of file class.ilSCORMItem.php.

Referenced by getTimeLimitAction().


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