Class ilSCORM2004Tracking.
More...
|
static | _getInProgress ($scorm_item_id, $a_obj_id) |
|
static | _getCompleted ($scorm_item_id, $a_obj_id) |
|
static | _getFailed ($scorm_item_id, $a_obj_id) |
|
static | _getCountCompletedPerUser ($a_scorm_item_ids, $a_obj_id, $a_omit_failed=false) |
| Get progress of selected scos. More...
|
|
static | _getProgressInfo ($a_obj_id) |
| Get overall scorm status. More...
|
|
static | _getProgressInfoOfUser ($a_obj_id, $a_user_id) |
| Get overall scorm status. More...
|
|
static | _getTrackedUsers ($a_obj_id) |
| Get all tracked users. More...
|
|
static | _getItemProgressInfo ($a_scorm_item_ids, $a_obj_id, $a_omit_failed=false) |
|
static | _getCollectionStatus ($a_scos, $a_obj_id, $a_user_id) |
|
static | _countCompleted ($a_scos, $a_obj_id, $a_user_id, $a_omit_failed=false) |
|
static | _syncReadEvent ($a_obj_id, $a_user_id, $a_type, $a_ref_id, $time_from_lms=null) |
| Synch read event table. More...
|
|
static | _isCompleted ($a_status, $a_satisfied) |
|
static | _isInProgress ($a_status, $a_satisfied) |
|
static | _isFailed ($a_status, $a_satisfied) |
|
static | getSumTotalTimeSecondsFromScos ($a_obj_id, $a_user_id, $a_write=false) |
| should be avoided; store value to increase performance for further requests More...
|
|
◆ _countCompleted()
static ilSCORM2004Tracking::_countCompleted |
( |
|
$a_scos, |
|
|
|
$a_obj_id, |
|
|
|
$a_user_id, |
|
|
|
$a_omit_failed = false |
|
) |
| |
|
static |
Definition at line 336 of file class.ilSCORM2004Tracking.php.
References $ilDB, $in, $res, and array.
Referenced by ilLPStatusSCORM\determinePercentage().
341 if (is_array($a_scos))
343 $in = $ilDB->in(
'cp_node.cp_node_id', $a_scos,
false,
'integer');
345 $res = $ilDB->queryF(
346 'SELECT cp_node.cp_node_id id, 347 cmi_node.completion_status completion, 348 cmi_node.success_status success 349 FROM cp_node, cmi_node 351 AND cp_node.cp_node_id = cmi_node.cp_node_id 352 AND cp_node.slm_id = %s 353 AND cmi_node.user_id = %s',
354 array(
'integer',
'integer'),
355 array($a_obj_id, $a_user_id)
360 while ($rec = $ilDB->fetchAssoc(
$res))
365 if (($rec[
"completion"] ==
"completed" || $rec[
"success"] ==
"passed")
366 && (!$a_omit_failed || $rec[
"success"] !=
"failed"))
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getCollectionStatus()
static ilSCORM2004Tracking::_getCollectionStatus |
( |
|
$a_scos, |
|
|
|
$a_obj_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Definition at line 293 of file class.ilSCORM2004Tracking.php.
References $failed, $ilDB, $in, $res, and array.
Referenced by ilLPStatusSCORM\determineStatus().
297 $status =
"not_attempted";
299 if (is_array($a_scos))
301 $in = $ilDB->in(
'cp_node.cp_node_id', $a_scos,
false,
'integer');
303 $res = $ilDB->queryF(
304 'SELECT cp_node.cp_node_id id, 305 cmi_node.completion_status completion, 306 cmi_node.success_status success 307 FROM cp_node, cmi_node 309 AND cp_node.cp_node_id = cmi_node.cp_node_id 310 AND cp_node.slm_id = %s 311 AND cmi_node.user_id = %s',
312 array(
'integer',
'integer'),
313 array($a_obj_id, $a_user_id)
319 while ($rec = $ilDB->fetchAssoc(
$res))
321 if ($rec[
"completion"] ==
"completed" || $rec[
"success"] ==
"passed")
325 if ($rec[
"success"] ==
"failed")
$failed =
true;
328 if ($started ==
true) $status =
"in_progress";
329 if (
$failed ==
true) $status =
"failed";
330 else if ($cntcompleted == count($a_scos)) $status =
"completed";
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getCompleted()
static ilSCORM2004Tracking::_getCompleted |
( |
|
$scorm_item_id, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
◆ _getCountCompletedPerUser()
static ilSCORM2004Tracking::_getCountCompletedPerUser |
( |
|
$a_scorm_item_ids, |
|
|
|
$a_obj_id, |
|
|
|
$a_omit_failed = false |
|
) |
| |
|
static |
Get progress of selected scos.
- Parameters
-
object | $a_scorm_item_ids | |
object | $a_obj_id | |
bool | $a_omit_failed | do not include success==failed |
- Returns
Definition at line 117 of file class.ilSCORM2004Tracking.php.
References $ilDB, $in, $res, $row, and array.
Referenced by ilLPStatusSCORM\_getStatusInfo().
121 $in = $ilDB->in(
'cp_node.cp_node_id', $a_scorm_item_ids,
false,
'integer');
127 $omit_failed =
' AND success_status <> '.$ilDB->quote(
'failed',
'text');
130 $res = $ilDB->queryF(
' 131 SELECT cmi_node.user_id user_id, COUNT(user_id) completed FROM cp_node, cmi_node 132 WHERE '.
$in.$omit_failed.
' 133 AND cp_node.cp_node_id = cmi_node.cp_node_id 134 AND cp_node.slm_id = %s 135 AND completion_status = %s 136 GROUP BY cmi_node.user_id',
137 array(
'integer',
'text'),
138 array($a_obj_id,
'completed')
140 while(
$row = $ilDB->fetchObject(
$res))
142 $users[
$row->user_id] =
$row->completed;
145 return $users ? $users :
array();
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getFailed()
static ilSCORM2004Tracking::_getFailed |
( |
|
$scorm_item_id, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
◆ _getInProgress()
static ilSCORM2004Tracking::_getInProgress |
( |
|
$scorm_item_id, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
◆ _getItemProgressInfo()
static ilSCORM2004Tracking::_getItemProgressInfo |
( |
|
$a_scorm_item_ids, |
|
|
|
$a_obj_id, |
|
|
|
$a_omit_failed = false |
|
) |
| |
|
static |
Definition at line 250 of file class.ilSCORM2004Tracking.php.
References $ilDB, $in, $info, $res, $row, and array.
Referenced by ilLPStatusSCORM\_getStatusInfo().
254 $in = $ilDB->in(
'cp_node.cp_node_id', $a_scorm_item_ids,
false,
'integer');
256 $res = $ilDB->queryF(
257 'SELECT cp_node.cp_node_id id, 258 cmi_node.user_id user_id, 259 cmi_node.completion_status completion, 260 cmi_node.success_status success 261 FROM cp_node, cmi_node 263 AND cp_node.cp_node_id = cmi_node.cp_node_id 264 AND cp_node.slm_id = %s',
273 while(
$row = $ilDB->fetchAssoc(
$res))
276 $info[
'in_progress'][
$row[
"id"]][] = $row[
"user_id"];
277 if ($row[
"completion"] ==
"completed" || $row[
"success"] ==
"passed")
280 if(!$a_omit_failed || $row[
"success"] !=
"failed")
282 $info[
'completed'][$row[
"id"]][] = $row[
"user_id"];
285 if ($row[
"success"] ==
"failed")
287 $info[
'failed'][$row[
"id"]][] = $row[
"user_id"];
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getProgressInfo()
static ilSCORM2004Tracking::_getProgressInfo |
( |
|
$a_obj_id | ) |
|
|
static |
Get overall scorm status.
- Parameters
-
- Returns
Definition at line 154 of file class.ilSCORM2004Tracking.php.
References $ilDB, $info, $res, $row, and array.
Referenced by ilLPStatusSCORMPackage\_getStatusInfo().
158 $res = $ilDB->queryF(
' 159 SELECT user_id, status, satisfied FROM cmi_gobjective 160 WHERE objective_id = %s 162 array(
'text',
'integer'),
163 array(
'-course_overall_status-', $a_obj_id)
170 while(
$row = $ilDB->fetchAssoc(
$res))
172 if (self::_isCompleted(
$row[
"status"],
$row[
"satisfied"]))
176 if (self::_isInProgress(
$row[
"status"],
$row[
"satisfied"]))
178 $info[
'in_progress'][] =
$row[
"user_id"];
180 if (self::_isFailed(
$row[
"status"],
$row[
"satisfied"]))
Create styles array
The data for the language used.
◆ _getProgressInfoOfUser()
static ilSCORM2004Tracking::_getProgressInfoOfUser |
( |
|
$a_obj_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Get overall scorm status.
- Parameters
-
- Returns
Definition at line 194 of file class.ilSCORM2004Tracking.php.
References $ilDB, $ilLog, $res, $row, and array.
Referenced by ilLPStatusSCORMPackage\determineStatus().
198 $res = $ilDB->queryF(
' 199 SELECT status, satisfied FROM cmi_gobjective 200 WHERE objective_id = %s 201 AND scope_id = %s AND user_id = %s',
202 array(
'text',
'integer',
'integer'),
203 array(
'-course_overall_status-', $a_obj_id, $a_user_id)
206 $status =
"not_attempted";
209 if (self::_isInProgress(
$row[
"status"],
$row[
"satisfied"]))
211 $status =
"in_progress";
213 if (self::_isCompleted(
$row[
"status"],
$row[
"satisfied"]))
215 $status =
"completed";
217 if (self::_isFailed(
$row[
"status"],
$row[
"satisfied"]))
Create styles array
The data for the language used.
◆ _getTrackedUsers()
static ilSCORM2004Tracking::_getTrackedUsers |
( |
|
$a_obj_id | ) |
|
|
static |
◆ _isCompleted()
static ilSCORM2004Tracking::_isCompleted |
( |
|
$a_status, |
|
|
|
$a_satisfied |
|
) |
| |
|
static |
◆ _isFailed()
static ilSCORM2004Tracking::_isFailed |
( |
|
$a_status, |
|
|
|
$a_satisfied |
|
) |
| |
|
static |
◆ _isInProgress()
static ilSCORM2004Tracking::_isInProgress |
( |
|
$a_status, |
|
|
|
$a_satisfied |
|
) |
| |
|
static |
◆ _syncReadEvent()
static ilSCORM2004Tracking::_syncReadEvent |
( |
|
$a_obj_id, |
|
|
|
$a_user_id, |
|
|
|
$a_type, |
|
|
|
$a_ref_id, |
|
|
|
$time_from_lms = null |
|
) |
| |
|
static |
Synch read event table.
- Parameters
-
Definition at line 382 of file class.ilSCORM2004Tracking.php.
References $a_type, $ilDB, ilChangeEvent\_recordReadEvent(), array, and ilUtil\yn2tf().
Referenced by ilSCORM2004StoreData\scormPlayerUnload(), and ilSCORM2004StoreData\syncGlobalStatus().
387 $val_set = $ilDB->queryF(
388 'SELECT time_from_lms FROM sahs_lm WHERE id = %s',
390 $val_rec = $ilDB->fetchAssoc($val_set);
394 $val_set = $ilDB->queryF(
' 395 SELECT package_attempts, sco_total_time_sec, total_time_sec 396 FROM sahs_user WHERE obj_id = %s AND user_id = %s',
397 array(
'integer',
'integer'),
array($a_obj_id,$a_user_id));
398 $val_rec = $ilDB->fetchAssoc($val_set);
399 if ($time_from_lms ==
false) $time = $val_rec[
"sco_total_time_sec"];
400 else $time = $val_rec[
"total_time_sec"];
401 $attempts = $val_rec[
"package_attempts"];
402 if ($attempts == null) $attempts =
"";
404 if ($attempts !=
"" && $time == null) {
405 $time = self::getSumTotalTimeSecondsFromScos($a_obj_id, $a_user_id,
true);
408 include_once(
"./Services/Tracking/classes/class.ilChangeEvent.php");
410 $a_obj_id, $a_user_id,
false, $attempts, $time);
static _recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
Create styles array
The data for the language used.
static yn2tf($a_yn)
convert "y"/"n" to true/false
◆ getSumTotalTimeSecondsFromScos()
static ilSCORM2004Tracking::getSumTotalTimeSecondsFromScos |
( |
|
$a_obj_id, |
|
|
|
$a_user_id, |
|
|
|
$a_write = false |
|
) |
| |
|
static |
should be avoided; store value to increase performance for further requests
Definition at line 455 of file class.ilSCORM2004Tracking.php.
References $ilDB, $ilLog, ilObjSCORM2004LearningModule\_ISODurationToCentisec(), and array.
Referenced by ilObjSCORMInitData\getStatus().
459 $val_set = $ilDB->queryF(
460 'SELECT cp_node_id FROM cp_node 462 AND cp_node.slm_id = %s',
463 array(
'text',
'integer'),
464 array(
'item', $a_obj_id)
466 while($val_rec = $ilDB->fetchAssoc($val_set))
468 array_push($scos,$val_rec[
'cp_node_id']);
471 foreach ($scos as $sco)
473 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
474 $data_set = $ilDB->queryF(
' 477 WHERE cp_node_id = %s 479 array(
'integer',
'integer'),
480 array($sco, $a_user_id)
483 while($data_rec = $ilDB->fetchAssoc($data_set))
491 if ($a_write && $time>0) {
492 $ilDB->queryF(
'UPDATE sahs_user SET sco_total_time_sec=%s WHERE obj_id = %s AND user_id = %s',
493 array(
'integer',
'integer',
'integer'),
494 array($time, $a_obj_id, $a_user_id));
Create styles array
The data for the language used.
static _ISODurationToCentisec($str)
convert ISO 8601 Timeperiods to centiseconds ta
The documentation for this class was generated from the following file: