ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSCORMItem Class Reference

SCORM Item. 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 ()
 Create database record for SCORM object. More...
 
 update ()
 Updates database record for SCORM object. More...
 
 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

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

Reimplemented from ilSCORMObject.

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

46 {
48 $this->setType("sit");
49 }
setType(?string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ 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.

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: shib_login.php:26

References $DIC, $ilDB, and $res.

◆ _lookupTitle()

static ilSCORMItem::_lookupTitle ( int  $a_obj_id)
static

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

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 }

References $DIC, $ilDB, and $res.

Referenced by ilLPStatusSCORM\_getStatusInfo().

+ 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.

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 }

References $DIC, and $ilDB.

Referenced by ilSCORMExplorer\getOutputIcons().

+ Here is the caller graph for this function:

◆ create()

ilSCORMItem::create ( )

Create database record for SCORM object.

Reimplemented from ilSCORMObject.

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

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 }

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

+ Here is the call graph for this function:

◆ delete()

ilSCORMItem::delete ( )

Reimplemented from ilSCORMObject.

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

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 _refreshStatus(int $a_obj_id, ?array $a_users=null)
static getLogger(string $a_component_id)
Get component logger.

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

+ Here is the call graph for this function:

◆ getDataFromLms()

ilSCORMItem::getDataFromLms ( )

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

131 : ?string
132 {
133 return $this->datafromlms;
134 }

References $datafromlms.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getIdentifierRef()

ilSCORMItem::getIdentifierRef ( )

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

61 : string
62 {
64 }

References $identifierref.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getImportId()

ilSCORMItem::getImportId ( )

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

51 : string
52 {
53 return $this->import_id;
54 }

References $import_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getMasteryScore()

ilSCORMItem::getMasteryScore ( )

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

141 : ?string
142 {
143 return $this->masteryscore;
144 }

References $masteryscore.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getMaxTimeAllowed()

ilSCORMItem::getMaxTimeAllowed ( )

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

111 : ?string
112 {
114 }
string $maxtimeallowed

References $maxtimeallowed.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getParameters()

ilSCORMItem::getParameters ( )

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

81 : ?string
82 {
83 return $this->parameters;
84 }

References $parameters.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getPrereqType()

ilSCORMItem::getPrereqType ( )

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

91 : ?string
92 {
93 return $this->prereq_type;
94 }

References $prereq_type.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getPrerequisites()

ilSCORMItem::getPrerequisites ( )

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

101 : ?string
102 {
104 }

References $prerequisites.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getTimeLimitAction()

ilSCORMItem::getTimeLimitAction ( )

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

121 : ?string
122 {
124 }
string $timelimitaction

References $timelimitaction.

Referenced by create(), and update().

+ 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.

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 }

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

+ Here is the call graph for this function:

◆ getVisible()

ilSCORMItem::getVisible ( )

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

71 : bool
72 {
73 return $this->isvisible;
74 }

References $isvisible.

Referenced by create(), and update().

+ 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.

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)

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

+ Here is the call graph for this function:

◆ read()

ilSCORMItem::read ( )
Returns
void

Reimplemented from ilSCORMObject.

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

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 }
setTimeLimitAction(?string $a_lim_act)
setVisible(bool $a_visible)
setIdentifierRef(string $a_id_ref)
setParameters(?string $a_par)
setDataFromLms(?string $a_data)
setImportId(string $a_import_id)
setPrereqType(?string $a_p_type)
setPrerequisites(?string $a_pre)
setMasteryScore(?string $a_score)
setMaxTimeAllowed(?string $a_max)

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

+ Here is the call graph for this function:

◆ setDataFromLms()

ilSCORMItem::setDataFromLms ( ?string  $a_data)

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

136 : void
137 {
138 $this->datafromlms = $a_data;
139 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setIdentifierRef()

ilSCORMItem::setIdentifierRef ( string  $a_id_ref)

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

66 : void
67 {
68 $this->identifierref = $a_id_ref;
69 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setImportId()

ilSCORMItem::setImportId ( string  $a_import_id)

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

56 : void
57 {
58 $this->import_id = $a_import_id;
59 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMasteryScore()

ilSCORMItem::setMasteryScore ( ?string  $a_score)

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

146 : void
147 {
148 $this->masteryscore = $a_score;
149 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMaxTimeAllowed()

ilSCORMItem::setMaxTimeAllowed ( ?string  $a_max)

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

116 : void
117 {
118 $this->maxtimeallowed = $a_max;
119 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setParameters()

ilSCORMItem::setParameters ( ?string  $a_par)

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

86 : void
87 {
88 $this->parameters = $a_par;
89 }

References ILIAS\UI\examples\Prompt\Standard\parameters().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPrereqType()

ilSCORMItem::setPrereqType ( ?string  $a_p_type)

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

96 : void
97 {
98 $this->prereq_type = $a_p_type;
99 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPrerequisites()

ilSCORMItem::setPrerequisites ( ?string  $a_pre)

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

106 : void
107 {
108 $this->prerequisites = $a_pre;
109 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTimeLimitAction()

ilSCORMItem::setTimeLimitAction ( ?string  $a_lim_act)

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

126 : void
127 {
128 $this->timelimitaction = $a_lim_act;
129 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setVisible()

ilSCORMItem::setVisible ( bool  $a_visible)

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

76 : void
77 {
78 $this->isvisible = $a_visible;
79 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilSCORMItem::update ( )

Updates database record for SCORM object.

Reimplemented from ilSCORMObject.

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

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 }

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

+ 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: