ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 319 of file class.ilSCORMItem.php.

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

320  {
321  global $DIC;
322  $ilDB = $DIC['ilDB'];
323 
324  $res = $ilDB->queryF(
325  '
326  SELECT obj_id FROM scorm_object
327  WHERE slm_id = %s
328  AND c_type = %s',
329  array('integer', 'text'),
330  array($a_obj_id, 'sit')
331  );
332  while ($row = $ilDB->fetchObject($res)) {
333  $item_ids[] = $row->obj_id;
334  }
335  return $item_ids ? $item_ids : array();
336  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
global $ilDB

◆ _lookupTitle()

static ilSCORMItem::_lookupTitle (   $a_obj_id)
static

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

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

Referenced by ilLPStatusSCORM\_getStatusInfo().

339  {
340  global $DIC;
341  $ilDB = $DIC['ilDB'];
342 
343  $res = $ilDB->queryF(
344  'SELECT title FROM scorm_object WHERE obj_id = %s',
345  array('integer'),
346  array($a_obj_id)
347  );
348 
349  while ($row = $ilDB->fetchObject($res)) {
350  return $row->title;
351  }
352  return '';
353  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
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 256 of file class.ilSCORMItem.php.

References $DIC, $ilDB, and $ilUser.

Referenced by ilSCORMExplorer\getOutputIcons().

257  {
258  global $DIC;
259  $ilDB = $DIC['ilDB'];
260  $ilUser = $DIC['ilUser'];
261 
262  if ($a_user_id == 0) {
263  $a_user_id = $ilUser->getId();
264  }
265 
266  $track_set = $ilDB->queryF(
267  '
268  SELECT lvalue, rvalue FROM scorm_tracking
269  WHERE sco_id = %s
270  AND user_id = %s
271  AND obj_id = %s',
272  array('integer', 'integer', 'integer'),
273  array($a_item_id, $a_user_id, $a_obj_id)
274  );
275 
276  $trdata = array();
277  while ($track_rec = $ilDB->fetchAssoc($track_set)) {
278  $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
279  }
280 
281  return $trdata;
282  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
global $ilDB
+ Here is the caller graph for this function:

◆ create()

ilSCORMItem::create ( )

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

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

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

◆ delete()

ilSCORMItem::delete ( )

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

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

285  {
286  global $DIC;
287  $ilDB = $DIC['ilDB'];
288  $ilLog = $DIC['ilLog'];
289 
290  parent::delete();
291 
292  $ilDB->manipulateF(
293  'DELETE FROM sc_item WHERE obj_id = %s',
294  array('integer'),
295  array($this->getId())
296  );
297 
298  $ilLog->write("SAHS Delete(ScormItem): " .
299  'DELETE FROM scorm_tracking WHERE sco_id = ' . $this->getId() . ' AND obj_id = ' . $this->getSLMId());
300  $ilDB->manipulateF(
301  'DELETE FROM scorm_tracking WHERE sco_id = %s AND obj_id = %s',
302  array('integer', 'integer'),
303  array($this->getId(), $this->getSLMId())
304  );
305 
306  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
308  }
global $DIC
Definition: saml.php:7
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
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 228 of file class.ilSCORMItem.php.

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

229  {
230  global $DIC;
231  $ilDB = $DIC['ilDB'];
232  $ilUser = $DIC['ilUser'];
233 
234  if ($a_user_id == 0) {
235  $a_user_id = $ilUser->getId();
236  }
237 
238  $track_set = $ilDB->queryF(
239  '
240  SELECT lvalue, rvalue FROM scorm_tracking
241  WHERE sco_id = %s
242  AND user_id = %s
243  AND obj_id = %s',
244  array('integer', 'integer', 'integer'),
245  array($this->getId(), $a_user_id, $this->getSLMId())
246  );
247 
248  $trdata = array();
249  while ($track_rec = $ilDB->fetchAssoc($track_set)) {
250  $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
251  }
252 
253  return $trdata;
254  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
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 311 of file class.ilSCORMItem.php.

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

312  {
313  require_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
314  //ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_ref_id);
315  ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
316  }
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 $DIC, $ilDB, ilSCORMObject\getId(), setDataFromLms(), setIdentifierRef(), setImportId(), setMasteryScore(), setMaxTimeAllowed(), setParameters(), setPrereqType(), setPrerequisites(), setTimeLimitAction(), and setVisible().

141  {
142  global $DIC;
143  $ilDB = $DIC['ilDB'];
144 
145  parent::read();
146 
147  $obj_set = $ilDB->queryF(
148  'SELECT * FROM sc_item WHERE obj_id = %s',
149  array('integer'),
150  array($this->getId())
151  );
152  $obj_rec = $ilDB->fetchAssoc($obj_set);
153 
154  $this->setImportId($obj_rec["import_id"]);
155  $this->setIdentifierRef($obj_rec["identifierref"]);
156  if (strtolower($obj_rec["isvisible"]) == "false") {
157  $this->setVisible(false);
158  } else {
159  $this->setVisible(true);
160  }
161  $this->setParameters($obj_rec["parameters"]);
162  $this->setPrereqType($obj_rec["prereq_type"]);
163  $this->setPrerequisites($obj_rec["prerequisites"]);
164  $this->setMaxTimeAllowed($obj_rec["maxtimeallowed"]);
165  $this->setTimeLimitAction($obj_rec["timelimitaction"]);
166  $this->setDataFromLms($obj_rec["datafromlms"]);
167  $this->setMasteryScore($obj_rec["masteryscore"]);
168  }
setParameters($a_par)
setPrerequisites($a_pre)
setTimeLimitAction($a_lim_act)
global $DIC
Definition: saml.php:7
setMasteryScore($a_score)
setVisible($a_visible)
setPrereqType($a_p_type)
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 194 of file class.ilSCORMItem.php.

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

195  {
196  global $DIC;
197  $ilDB = $DIC['ilDB'];
198 
199  parent::update();
200 
201  $str_visible = ($this->getVisible()) ? 'true' : 'false';
202 
203  $ilDB->update(
204  'sc_item',
205  array(
206  'import_id' => array('text', $this->getImportId()),
207  'identifierref' => array('text', $this->getIdentifierRef()),
208  'isvisible' => array('text', $str_visible),
209  'parameters' => array('text', $this->getParameters()),
210  'prereq_type' => array('text', $this->getPrereqType()),
211  'prerequisites' => array('text', $this->getPrerequisites()),
212  'maxtimeallowed' => array('text', $this->getMaxTimeAllowed()),
213  'timelimitaction' => array('text', $this->getTimeLimitAction()),
214  'datafromlms' => array('clob', $this->getDataFromLms()),
215  'masteryscore' => array('text', $this->getMasteryScore())
216  ),
217  array(
218  'obj_id' => array('integer', $this->getId())
219  )
220  );
221  }
global $DIC
Definition: saml.php:7
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: