ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 Create database record for SCORM object. More...
 
 update ()
 Updates database record for SCORM object. More...
 
 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 @access public

Reimplemented from ilSCORMObject.

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

35 {
37 $this->setType("sit");
38 }
__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 (   $a_obj_id)
static

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

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 }
foreach($_POST as $key=> $value) $res
global $ilDB
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, and $res.

◆ _lookupTitle()

static ilSCORMItem::_lookupTitle (   $a_obj_id)
static

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

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 }

References $DIC, $ilDB, and $res.

Referenced by ilLPStatusSCORM\_getStatusInfo().

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

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 }
$ilUser
Definition: imgupload.php:18

References $DIC, $ilDB, and $ilUser.

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 170 of file class.ilSCORMItem.php.

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 }

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 284 of file class.ilSCORMItem.php.

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 }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.

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

+ Here is the call graph for this function:

◆ getDataFromLms()

ilSCORMItem::getDataFromLms ( )

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

121 {
122 return $this->datafromlms;
123 }

References $datafromlms.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getIdentifierRef()

ilSCORMItem::getIdentifierRef ( )

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

51 {
53 }

References $identifierref.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getImportId()

ilSCORMItem::getImportId ( )

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

41 {
42 return $this->import_id;
43 }

References $import_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getMasteryScore()

ilSCORMItem::getMasteryScore ( )

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

131 {
132 return $this->masteryscore;
133 }

References $masteryscore.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getMaxTimeAllowed()

ilSCORMItem::getMaxTimeAllowed ( )

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

101 {
103 }

References $maxtimeallowed.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getParameters()

ilSCORMItem::getParameters ( )

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

71 {
72 return $this->parameters;
73 }

References $parameters.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getPrereqType()

ilSCORMItem::getPrereqType ( )

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

81 {
82 return $this->prereq_type;
83 }

References $prereq_type.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getPrerequisites()

ilSCORMItem::getPrerequisites ( )

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

91 {
93 }

References $prerequisites.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getTimeLimitAction()

ilSCORMItem::getTimeLimitAction ( )

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

111 {
113 }

References $timelimitaction.

Referenced by create(), and update().

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

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 }

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

+ Here is the call graph for this function:

◆ getVisible()

ilSCORMItem::getVisible ( )

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

61 {
62 return $this->isvisible;
63 }

References $isvisible.

Referenced by create(), and update().

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

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)

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

+ Here is the call graph for this function:

◆ read()

ilSCORMItem::read ( )

Reimplemented from ilSCORMObject.

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

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

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 (   $a_data)

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

126 {
127 $this->datafromlms = $a_data;
128 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setIdentifierRef()

ilSCORMItem::setIdentifierRef (   $a_id_ref)

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

56 {
57 $this->identifierref = $a_id_ref;
58 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setImportId()

ilSCORMItem::setImportId (   $a_import_id)

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

46 {
47 $this->import_id = $a_import_id;
48 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMasteryScore()

ilSCORMItem::setMasteryScore (   $a_score)

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

136 {
137 $this->masteryscore = $a_score;
138 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMaxTimeAllowed()

ilSCORMItem::setMaxTimeAllowed (   $a_max)

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

106 {
107 $this->maxtimeallowed = $a_max;
108 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setParameters()

ilSCORMItem::setParameters (   $a_par)

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

76 {
77 $this->parameters = $a_par;
78 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPrereqType()

ilSCORMItem::setPrereqType (   $a_p_type)

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

86 {
87 $this->prereq_type = $a_p_type;
88 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setPrerequisites()

ilSCORMItem::setPrerequisites (   $a_pre)

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

96 {
97 $this->prerequisites = $a_pre;
98 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTimeLimitAction()

ilSCORMItem::setTimeLimitAction (   $a_lim_act)

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

116 {
117 $this->timelimitaction = $a_lim_act;
118 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setVisible()

ilSCORMItem::setVisible (   $a_visible)

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

66 {
67 $this->isvisible = $a_visible;
68 }

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 194 of file class.ilSCORMItem.php.

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 }

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

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: