ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSCORMItem Class Reference

SCORM Item. More...

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

Public Member Functions

 ilSCORMItem ($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...
 
 _lookupTrackingDataOfUser ($a_item_id, $a_user_id=0, $a_obj_id=0)
 
 delete ()
 
 insertTrackData ($a_lval, $a_rval, $a_obj_id)
 
 _getItems ($a_obj_id)
 
 _lookupTitle ($a_obj_id)
 
- Public Member Functions inherited from ilSCORMObject
 ilSCORMObject ($a_id=0)
 Constructor. More...
 
 getId ()
 
 setId ($a_id)
 
 getType ()
 
 setType ($a_type)
 
 getTitle ()
 
 setTitle ($a_title)
 
 getSLMId ()
 
 setSLMId ($a_slm_id)
 
 read ()
 
 _lookupPresentableItems ($a_slm_id)
 Count number of presentable SCOs/Assets of SCORM learning module. More...
 
 create ()
 Create database record for SCORM object. More...
 
 update ()
 Updates database record for SCORM object. More...
 
 delete ()
 
_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.

Member Function Documentation

◆ _getItems()

ilSCORMItem::_getItems (   $a_obj_id)

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

312 {
313 global $ilDB;
314
315 $res = $ilDB->queryF('
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 {
324 $item_ids[] = $row->obj_id;
325 }
326 return $item_ids ? $item_ids : array();
327 }
global $ilDB

References $ilDB, $res, and $row.

◆ _lookupTitle()

ilSCORMItem::_lookupTitle (   $a_obj_id)

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

330 {
331 global $ilDB;
332
333 $res = $ilDB->queryF(
334 'SELECT title FROM scorm_object WHERE obj_id = %s',
335 array('integer'),
336 array($a_obj_id)
337 );
338
339 while($row = $ilDB->fetchObject($res))
340 {
341 return $row->title;
342 }
343 return '';
344 }

References $ilDB, $res, and $row.

Referenced by ilLPStatusSCORM\_getStatusInfo().

+ Here is the caller graph for this function:

◆ _lookupTrackingDataOfUser()

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

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

252 {
253 global $ilDB, $ilUser;
254
255 if ($a_user_id == 0)
256 {
257 $a_user_id = $ilUser->getId();
258 }
259
260 $track_set = $ilDB->queryF('
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 {
272 $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
273 }
274
275 return $trdata;
276 }
global $ilUser
Definition: imgupload.php:15

References $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 169 of file class.ilSCORMItem.php.

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 }

References $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 278 of file class.ilSCORMItem.php.

279 {
280 global $ilDB, $ilLog;
281
282 parent::delete();
283
284 $ilDB->manipulateF(
285 'DELETE FROM sc_item WHERE obj_id = %s',
286 array('integer'),
287 array($this->getId())
288 );
289
290 $ilLog->write("SAHS Delete(ScormItem): ".
291 'DELETE FROM scorm_tracking WHERE sco_id = '.$this->getId().' AND obj_id = '.$this->getSLMId());
292 $ilDB->manipulateF(
293 'DELETE FROM scorm_tracking WHERE sco_id = %s AND obj_id = %s',
294 array('integer', 'integer'),
295 array($this->getId(), $this->getSLMId())
296 );
297
298 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
300 }
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.

References $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 224 of file class.ilSCORMItem.php.

225 {
226 global $ilDB, $ilUser;
227
228 if ($a_user_id == 0)
229 {
230 $a_user_id = $ilUser->getId();
231 }
232
233 $track_set = $ilDB->queryF('
234 SELECT lvalue, rvalue FROM scorm_tracking
235 WHERE sco_id = %s
236 AND user_id = %s
237 AND obj_id = %s',
238 array('integer', 'integer', 'integer'),
239 array($this->getId(), $a_user_id, $this->getSLMId())
240 );
241
242 $trdata = array();
243 while ($track_rec = $ilDB->fetchAssoc($track_set))
244 {
245 $trdata[$track_rec["lvalue"]] = $track_rec["rvalue"];
246 }
247
248 return $trdata;
249 }

References $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:

◆ ilSCORMItem()

ilSCORMItem::ilSCORMItem (   $a_id = 0)

Constructor.

Parameters
int$a_idObject ID @access public

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

35 {
36 parent::ilSCORMObject($a_id);
37 $this->setType("sit");
38 }

References ilSCORMObject\setType().

+ Here is the call graph for this function:

◆ insertTrackData()

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

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

304 {
305 require_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
306 //ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_ref_id);
307 ilObjSCORMTracking::_insertTrackData($this->getId(), $a_lval, $a_rval, $a_obj_id);
308 }
_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 $ilDB;
143
144 parent::read();
145
146 $obj_set = $ilDB->queryF('SELECT * FROM sc_item WHERE obj_id = %s',
147 array('integer'),array($this->getId()));
148 $obj_rec = $ilDB->fetchAssoc($obj_set);
149
150 $this->setImportId($obj_rec["import_id"]);
151 $this->setIdentifierRef($obj_rec["identifierref"]);
152 if (strtolower($obj_rec["isvisible"]) == "false")
153 {
154 $this->setVisible(false);
155 }
156 else
157 {
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 }
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 $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 192 of file class.ilSCORMItem.php.

193 {
194 global $ilDB;
195
196 parent::update();
197
198 $str_visible = ($this->getVisible()) ? 'true' : 'false';
199
200 $ilDB->update('sc_item',
201 array(
202 'import_id' => array('text', $this->getImportId()),
203 'identifierref' => array('text', $this->getIdentifierRef()),
204 'isvisible' => array('text', $str_visible),
205 'parameters' => array('text', $this->getParameters()),
206 'prereq_type' => array('text', $this->getPrereqType()),
207 'prerequisites' => array('text', $this->getPrerequisites()),
208 'maxtimeallowed' => array('text', $this->getMaxTimeAllowed()),
209 'timelimitaction' => array('text', $this->getTimeLimitAction()),
210 'datafromlms' => array('clob', $this->getDataFromLms()),
211 'masteryscore' => array('text', $this->getMasteryScore())
212 ),
213 array(
214 'obj_id' => array('integer', $this->getId())
215 )
216 );
217 }

References $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: