ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSCORMItem Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (int $a_id=0)
 
 getImportId ()
 
 setImportId (string $a_import_id)
 
 getIdentifierRef ()
 
 setIdentifierRef (string $a_id_ref)
 
 getVisible ()
 
 setVisible (bool $a_visible)
 
 getParameters ()
 
 setParameters (?string $a_par)
 
 getPrereqType ()
 
 setPrereqType (?string $a_p_type)
 
 getPrerequisites ()
 
 setPrerequisites (?string $a_pre)
 
 getMaxTimeAllowed ()
 
 setMaxTimeAllowed (?string $a_max)
 
 getTimeLimitAction ()
 
 setTimeLimitAction (?string $a_lim_act)
 
 getDataFromLms ()
 
 setDataFromLms (?string $a_data)
 
 getMasteryScore ()
 
 setMasteryScore (?string $a_score)
 
 read ()
 
 create ()
 
 update ()
 
 getTrackingDataOfUser (int $a_user_id=0)
 get tracking data of specified or current user More...
 
 delete ()
 
 insertTrackData (string $a_lval, string $a_rval, int $a_obj_id)
 
- Public Member Functions inherited from ilSCORMObject
 __construct (int $a_id=0)
 Constructor. More...
 
 getId ()
 
 setId (int $a_id)
 
 getType ()
 
 setType (?string $a_type)
 
 getTitle ()
 
 setTitle (string $a_title)
 
 getSLMId ()
 
 setSLMId (int $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 (int $a_item_id, int $a_user_id=0, int $a_obj_id=0)
 
static _getItems (int $a_obj_id)
 
static _lookupTitle (int $a_obj_id)
 
- Static Public Member Functions inherited from ilSCORMObject
static _lookupPresentableItems (int $a_slm_id)
 Count number of presentable SCOs/Assets of SCORM learning module. More...
 
static & _getInstance (int $a_id, int $a_slm_id)
 

Data Fields

string $import_id
 
string $identifierref
 
bool $isvisible = true
 
string $parameters = null
 
string $prereq_type = null
 
string $prerequisites = null
 
string $maxtimeallowed = null
 
string $timelimitaction = null
 
string $datafromlms = null
 
string $masteryscore = null
 
- Data Fields inherited from ilSCORMObject
int $id
 
string $title = ""
 
string $type = null
 
int $slm_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 29 of file class.ilSCORMItem.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORMItem::__construct ( int  $a_id = 0)
Parameters
int$a_idObject ID

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

References ILIAS\GlobalScreen\Provider\__construct(), and ilSCORMObject\setType().

46  {
47  parent::__construct($a_id);
48  $this->setType("sit");
49  }
setType(?string $a_type)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getItems()

static ilSCORMItem::_getItems ( int  $a_obj_id)
static
Returns
int[]

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

References $DIC, $ilDB, and $res.

330  : array
331  {
332  global $DIC;
333  $ilDB = $DIC->database();
334  $item_ids = [];
335 
336  $res = $ilDB->queryF(
337  '
338  SELECT obj_id FROM scorm_object
339  WHERE slm_id = %s
340  AND c_type = %s',
341  array('integer', 'text'),
342  array($a_obj_id, 'sit')
343  );
344  while ($row = $ilDB->fetchObject($res)) {
345  $item_ids[] = $row->obj_id;
346  }
347  return $item_ids;
348  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _lookupTitle()

static ilSCORMItem::_lookupTitle ( int  $a_obj_id)
static

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

References $DIC, $ilDB, and $res.

Referenced by ilLPStatusSCORM\_getStatusInfo().

350  : string
351  {
352  global $DIC;
353  $ilDB = $DIC->database();
354 
355  $res = $ilDB->queryF(
356  'SELECT title FROM scorm_object WHERE obj_id = %s',
357  array('integer'),
358  array($a_obj_id)
359  );
360 
361  while ($row = $ilDB->fetchObject($res)) {
362  return $row->title;
363  }
364  return '';
365  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupTrackingDataOfUser()

static ilSCORMItem::_lookupTrackingDataOfUser ( int  $a_item_id,
int  $a_user_id = 0,
int  $a_obj_id = 0 
)
static
Returns
array<int|string, mixed>

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

References $DIC, $ilDB, and $ilUser.

Referenced by ilSCORMExplorer\getOutputIcons().

269  : array
270  {
271  global $DIC;
272  $ilDB = $DIC->database();
273  $ilUser = $DIC->user();
274 
275  if ($a_user_id == 0) {
276  $a_user_id = $ilUser->getId();
277  }
278 
279  $track_set = $ilDB->queryF(
280  '
281  SELECT lvalue, rvalue FROM scorm_tracking
282  WHERE sco_id = %s
283  AND user_id = %s
284  AND obj_id = %s',
285  array('integer', 'integer', 'integer'),
286  array($a_item_id, $a_user_id, $a_obj_id)
287  );
288 
289  $trdata = array();
290  while ($track_rec = $ilDB->fetchAssoc($track_set)) {
291  $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
292  }
293 
294  return $trdata;
295  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ create()

ilSCORMItem::create ( )

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

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

180  : void
181  {
182  global $DIC;
183  $ilDB = $DIC->database();
184 
185  parent::create();
186 
187  $str_visible = ($this->getVisible()) ? 'true' : 'false';
188 
189  $ilDB->insert('sc_item', array(
190  'obj_id' => array('integer', $this->getId()),
191  'import_id' => array('text', $this->getImportId()),
192  'identifierref' => array('text', $this->getIdentifierRef()),
193  'isvisible' => array('text', $str_visible),
194  'parameters' => array('text', $this->getParameters()),
195  'prereq_type' => array('text', $this->getPrereqType()),
196  'prerequisites' => array('text', $this->getPrerequisites()),
197  'maxtimeallowed' => array('text', $this->getMaxTimeAllowed()),
198  'timelimitaction' => array('text', $this->getTimeLimitAction()),
199  'datafromlms' => array('clob', $this->getDataFromLms()),
200  'masteryscore' => array('text', $this->getMasteryScore())
201  ));
202  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ delete()

ilSCORMItem::delete ( )

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

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

297  : void
298  {
299  global $DIC;
300  $ilDB = $DIC->database();
301  $ilLog = ilLoggerFactory::getLogger('sahs');
302 
303  parent::delete();
304 
305  $ilDB->manipulateF(
306  'DELETE FROM sc_item WHERE obj_id = %s',
307  array('integer'),
308  array($this->getId())
309  );
310 
311  $ilLog->write("SAHS Delete(ScormItem): " .
312  'DELETE FROM scorm_tracking WHERE sco_id = ' . $this->getId() . ' AND obj_id = ' . $this->getSLMId());
313  $ilDB->manipulateF(
314  'DELETE FROM scorm_tracking WHERE sco_id = %s AND obj_id = %s',
315  array('integer', 'integer'),
316  array($this->getId(), $this->getSLMId())
317  );
319  }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
+ Here is the call graph for this function:

◆ getDataFromLms()

ilSCORMItem::getDataFromLms ( )

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

References $datafromlms.

Referenced by create(), and update().

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

◆ getIdentifierRef()

ilSCORMItem::getIdentifierRef ( )

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

References $identifierref.

Referenced by create(), and update().

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

◆ getImportId()

ilSCORMItem::getImportId ( )

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

References $import_id.

Referenced by create(), and update().

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

◆ getMasteryScore()

ilSCORMItem::getMasteryScore ( )

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

References $masteryscore.

Referenced by create(), and update().

141  : ?string
142  {
143  return $this->masteryscore;
144  }
+ Here is the caller graph for this function:

◆ getMaxTimeAllowed()

ilSCORMItem::getMaxTimeAllowed ( )

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

References $maxtimeallowed.

Referenced by create(), and update().

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

◆ getParameters()

ilSCORMItem::getParameters ( )

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

References $parameters.

Referenced by create(), and update().

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

◆ getPrereqType()

ilSCORMItem::getPrereqType ( )

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

References $prereq_type.

Referenced by create(), and update().

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

◆ getPrerequisites()

ilSCORMItem::getPrerequisites ( )

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

References $prerequisites.

Referenced by create(), and update().

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

◆ getTimeLimitAction()

ilSCORMItem::getTimeLimitAction ( )

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

References $timelimitaction.

Referenced by create(), and update().

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

◆ getTrackingDataOfUser()

ilSCORMItem::getTrackingDataOfUser ( int  $a_user_id = 0)

get tracking data of specified or current user

Returns
array<int|string, mixed>

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

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

238  : array
239  {
240  global $DIC;
241  $ilDB = $DIC->database();
242  $ilUser = $DIC->user();
243 
244  if ($a_user_id == 0) {
245  $a_user_id = $ilUser->getId();
246  }
247 
248  $track_set = $ilDB->queryF(
249  '
250  SELECT lvalue, rvalue FROM scorm_tracking
251  WHERE sco_id = %s
252  AND user_id = %s
253  AND obj_id = %s',
254  array('integer', 'integer', 'integer'),
255  array($this->getId(), $a_user_id, $this->getSLMId())
256  );
257 
258  $trdata = array();
259  while ($track_rec = $ilDB->fetchAssoc($track_set)) {
260  $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
261  }
262 
263  return $trdata;
264  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ getVisible()

ilSCORMItem::getVisible ( )

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

References $isvisible.

Referenced by create(), and update().

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

◆ insertTrackData()

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

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

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

321  : void
322  {
323  //ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_ref_id);
324  ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
325  }
static _insertTrackData(int $a_sahs_id, string $a_lval, string $a_rval, int $a_obj_id)
+ Here is the call graph for this function:

◆ read()

ilSCORMItem::read ( )

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

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

151  : void
152  {
153  global $DIC;
154  $ilDB = $DIC->database();
155 
156  parent::read();
157 
158  $obj_set = $ilDB->queryF(
159  'SELECT * FROM sc_item WHERE obj_id = %s',
160  array('integer'),
161  array($this->getId())
162  );
163  $obj_rec = $ilDB->fetchAssoc($obj_set);
164  $this->setImportId((string) $obj_rec["import_id"]);
165  $this->setIdentifierRef((string) $obj_rec["identifierref"]);
166  if (strtolower((string) $obj_rec["isvisible"]) === "false") {
167  $this->setVisible(false);
168  } else {
169  $this->setVisible(true);
170  }
171  $this->setParameters($obj_rec["parameters"]);
172  $this->setPrereqType($obj_rec["prereq_type"]);
173  $this->setPrerequisites($obj_rec["prerequisites"]);
174  $this->setMaxTimeAllowed($obj_rec["maxtimeallowed"]);
175  $this->setTimeLimitAction($obj_rec["timelimitaction"]);
176  $this->setDataFromLms($obj_rec["datafromlms"]);
177  $this->setMasteryScore($obj_rec["masteryscore"]);
178  }
setPrerequisites(?string $a_pre)
setMaxTimeAllowed(?string $a_max)
setVisible(bool $a_visible)
global $DIC
Definition: feed.php:28
setMasteryScore(?string $a_score)
setTimeLimitAction(?string $a_lim_act)
setParameters(?string $a_par)
setDataFromLms(?string $a_data)
setIdentifierRef(string $a_id_ref)
setPrereqType(?string $a_p_type)
setImportId(string $a_import_id)
+ Here is the call graph for this function:

◆ setDataFromLms()

ilSCORMItem::setDataFromLms ( ?string  $a_data)

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

Referenced by read().

136  : void
137  {
138  $this->datafromlms = $a_data;
139  }
+ Here is the caller graph for this function:

◆ setIdentifierRef()

ilSCORMItem::setIdentifierRef ( string  $a_id_ref)

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

Referenced by read().

66  : void
67  {
68  $this->identifierref = $a_id_ref;
69  }
+ Here is the caller graph for this function:

◆ setImportId()

ilSCORMItem::setImportId ( string  $a_import_id)

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

Referenced by read().

56  : void
57  {
58  $this->import_id = $a_import_id;
59  }
+ Here is the caller graph for this function:

◆ setMasteryScore()

ilSCORMItem::setMasteryScore ( ?string  $a_score)

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

Referenced by read().

146  : void
147  {
148  $this->masteryscore = $a_score;
149  }
+ Here is the caller graph for this function:

◆ setMaxTimeAllowed()

ilSCORMItem::setMaxTimeAllowed ( ?string  $a_max)

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

Referenced by read().

116  : void
117  {
118  $this->maxtimeallowed = $a_max;
119  }
+ Here is the caller graph for this function:

◆ setParameters()

ilSCORMItem::setParameters ( ?string  $a_par)

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

Referenced by read().

86  : void
87  {
88  $this->parameters = $a_par;
89  }
+ Here is the caller graph for this function:

◆ setPrereqType()

ilSCORMItem::setPrereqType ( ?string  $a_p_type)

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

Referenced by read().

96  : void
97  {
98  $this->prereq_type = $a_p_type;
99  }
+ Here is the caller graph for this function:

◆ setPrerequisites()

ilSCORMItem::setPrerequisites ( ?string  $a_pre)

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

Referenced by read().

106  : void
107  {
108  $this->prerequisites = $a_pre;
109  }
+ Here is the caller graph for this function:

◆ setTimeLimitAction()

ilSCORMItem::setTimeLimitAction ( ?string  $a_lim_act)

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

Referenced by read().

126  : void
127  {
128  $this->timelimitaction = $a_lim_act;
129  }
+ Here is the caller graph for this function:

◆ setVisible()

ilSCORMItem::setVisible ( bool  $a_visible)

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

Referenced by read().

76  : void
77  {
78  $this->isvisible = $a_visible;
79  }
+ Here is the caller graph for this function:

◆ update()

ilSCORMItem::update ( )

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

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

204  : void
205  {
206  global $DIC;
207  $ilDB = $DIC->database();
208 
209  parent::update();
210 
211  $str_visible = ($this->getVisible()) ? 'true' : 'false';
212 
213  $ilDB->update(
214  'sc_item',
215  array(
216  'import_id' => array('text', $this->getImportId()),
217  'identifierref' => array('text', $this->getIdentifierRef()),
218  'isvisible' => array('text', $str_visible),
219  'parameters' => array('text', $this->getParameters()),
220  'prereq_type' => array('text', $this->getPrereqType()),
221  'prerequisites' => array('text', $this->getPrerequisites()),
222  'maxtimeallowed' => array('text', $this->getMaxTimeAllowed()),
223  'timelimitaction' => array('text', $this->getTimeLimitAction()),
224  'datafromlms' => array('clob', $this->getDataFromLms()),
225  'masteryscore' => array('text', $this->getMasteryScore())
226  ),
227  array(
228  'obj_id' => array('integer', $this->getId())
229  )
230  );
231  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Field Documentation

◆ $datafromlms

string ilSCORMItem::$datafromlms = null

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

Referenced by getDataFromLms().

◆ $identifierref

string ilSCORMItem::$identifierref

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

Referenced by getIdentifierRef().

◆ $import_id

string ilSCORMItem::$import_id

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

Referenced by getImportId().

◆ $isvisible

bool ilSCORMItem::$isvisible = true

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

Referenced by getVisible().

◆ $masteryscore

string ilSCORMItem::$masteryscore = null

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

Referenced by getMasteryScore().

◆ $maxtimeallowed

string ilSCORMItem::$maxtimeallowed = null

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

Referenced by getMaxTimeAllowed().

◆ $parameters

string ilSCORMItem::$parameters = null

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

Referenced by getParameters().

◆ $prereq_type

string ilSCORMItem::$prereq_type = null

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

Referenced by getPrereqType().

◆ $prerequisites

string ilSCORMItem::$prerequisites = null

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

Referenced by getPrerequisites().

◆ $timelimitaction

string ilSCORMItem::$timelimitaction = null

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

Referenced by getTimeLimitAction().


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