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 346 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $in, and $res.
Referenced by ilLPStatusSCORM\determinePercentage().
354 $ilDB = $DIC->database();
356 if (is_array($a_scos)) {
357 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scos,
false,
'integer');
360 'SELECT cp_node.cp_node_id id, 361 cmi_node.completion_status completion, 362 cmi_node.success_status success 363 FROM cp_node, cmi_node 365 AND cp_node.cp_node_id = cmi_node.cp_node_id 366 AND cp_node.slm_id = %s 367 AND cmi_node.user_id = %s',
368 array(
'integer',
'integer'),
369 array($a_obj_id, $a_user_id)
378 if (($rec[
"completion"] ==
"completed" || $rec[
"success"] ==
"passed")
379 && (!$a_omit_failed || $rec[
"success"] !=
"failed")) {
foreach($_POST as $key=> $value) $res
if(php_sapi_name() !='cli') $in
◆ _getCollectionStatus()
static ilSCORM2004Tracking::_getCollectionStatus |
( |
|
$a_scos, |
|
|
|
$a_obj_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Definition at line 298 of file class.ilSCORM2004Tracking.php.
References $DIC, $failed, $ilDB, $in, and $res.
Referenced by ilLPStatusSCORM\determineStatus().
302 $ilDB = $DIC->database();
304 $status =
"not_attempted";
306 if (is_array($a_scos)) {
307 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scos,
false,
'integer');
310 'SELECT cp_node.cp_node_id id, 311 cmi_node.completion_status completion, 312 cmi_node.success_status success 313 FROM cp_node, cmi_node 315 AND cp_node.cp_node_id = cmi_node.cp_node_id 316 AND cp_node.slm_id = %s 317 AND cmi_node.user_id = %s',
318 array(
'integer',
'integer'),
319 array($a_obj_id, $a_user_id)
326 if ($rec[
"completion"] ==
"completed" || $rec[
"success"] ==
"passed") {
329 if ($rec[
"success"] ==
"failed") {
334 if ($started ==
true) {
335 $status =
"in_progress";
339 } elseif ($cntcompleted == count($a_scos)) {
340 $status =
"completed";
foreach($_POST as $key=> $value) $res
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 121 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $in, $res, $row, and $users.
Referenced by ilLPStatusSCORM\_getStatusInfo().
125 $ilDB = $DIC->database();
127 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scorm_item_ids,
false,
'integer');
131 if ($a_omit_failed) {
132 $omit_failed =
' AND success_status <> ' .
$ilDB->quote(
'failed',
'text');
137 SELECT cmi_node.user_id user_id, COUNT(user_id) completed FROM cp_node, cmi_node 138 WHERE ' .
$in . $omit_failed .
' 139 AND cp_node.cp_node_id = cmi_node.cp_node_id 140 AND cp_node.slm_id = %s 141 AND completion_status = %s 142 GROUP BY cmi_node.user_id',
143 array(
'integer',
'text'),
144 array($a_obj_id,
'completed')
foreach($_POST as $key=> $value) $res
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 257 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $in, $info, $res, and $row.
Referenced by ilLPStatusSCORM\_getStatusInfo().
261 $ilDB = $DIC->database();
263 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scorm_item_ids,
false,
'integer');
266 'SELECT cp_node.cp_node_id id, 267 cmi_node.user_id user_id, 268 cmi_node.completion_status completion, 269 cmi_node.success_status success 270 FROM cp_node, cmi_node 272 AND cp_node.cp_node_id = cmi_node.cp_node_id 273 AND cp_node.slm_id = %s',
278 $info[
'completed'] = array();
279 $info[
'failed'] = array();
280 $info[
'in_progress'] = array();
284 $info[
'in_progress'][
$row[
"id"]][] = $row[
"user_id"];
285 if ($row[
"completion"] ==
"completed" || $row[
"success"] ==
"passed") {
287 if (!$a_omit_failed || $row[
"success"] !=
"failed") {
288 $info[
'completed'][$row[
"id"]][] = $row[
"user_id"];
291 if ($row[
"success"] ==
"failed") {
292 $info[
'failed'][$row[
"id"]][] = $row[
"user_id"];
foreach($_POST as $key=> $value) $res
if(php_sapi_name() !='cli') $in
◆ _getProgressInfo()
static ilSCORM2004Tracking::_getProgressInfo |
( |
|
$a_obj_id | ) |
|
|
static |
Get overall scorm status.
- Parameters
-
- Returns
Definition at line 159 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $info, $res, and $row.
Referenced by ilLPStatusSCORMPackage\_getStatusInfo().
163 $ilDB = $DIC->database();
167 SELECT user_id, status, satisfied FROM cmi_gobjective 168 WHERE objective_id = %s 170 array(
'text',
'integer'),
171 array(
'-course_overall_status-', $a_obj_id)
174 $info[
'completed'] = array();
175 $info[
'failed'] = array();
176 $info[
'in_progress'] = array();
179 if (self::_isCompleted(
$row[
"status"],
$row[
"satisfied"])) {
182 if (self::_isInProgress(
$row[
"status"],
$row[
"satisfied"])) {
183 $info[
'in_progress'][] =
$row[
"user_id"];
185 if (self::_isFailed(
$row[
"status"],
$row[
"satisfied"])) {
foreach($_POST as $key=> $value) $res
◆ _getProgressInfoOfUser()
static ilSCORM2004Tracking::_getProgressInfoOfUser |
( |
|
$a_obj_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Get overall scorm status.
- Parameters
-
- Returns
Definition at line 198 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $ilLog, $res, and $row.
Referenced by ilLPStatusSCORMPackage\determineStatus().
202 $ilDB = $DIC->database();
207 SELECT status, satisfied FROM cmi_gobjective 208 WHERE objective_id = %s 209 AND scope_id = %s AND user_id = %s',
210 array(
'text',
'integer',
'integer'),
211 array(
'-course_overall_status-', $a_obj_id, $a_user_id)
214 $status =
"not_attempted";
216 if (self::_isInProgress(
$row[
"status"],
$row[
"satisfied"])) {
217 $status =
"in_progress";
219 if (self::_isCompleted(
$row[
"status"],
$row[
"satisfied"])) {
220 $status =
"completed";
222 if (self::_isFailed(
$row[
"status"],
$row[
"satisfied"])) {
foreach($_POST as $key=> $value) $res
◆ _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 393 of file class.ilSCORM2004Tracking.php.
References $a_type, $DIC, $ilDB, $time, ilChangeEvent\_recordReadEvent(), and ilUtil\yn2tf().
Referenced by ilSCORM2004StoreData\scormPlayerUnload(), and ilSCORM2004StoreData\syncGlobalStatus().
397 $ilDB = $DIC->database();
400 $val_set =
$ilDB->queryF(
401 'SELECT time_from_lms FROM sahs_lm WHERE id = %s',
405 $val_rec =
$ilDB->fetchAssoc($val_set);
409 $val_set =
$ilDB->queryF(
411 SELECT package_attempts, sco_total_time_sec, total_time_sec 412 FROM sahs_user WHERE obj_id = %s AND user_id = %s',
413 array(
'integer',
'integer'),
414 array($a_obj_id,$a_user_id)
416 $val_rec =
$ilDB->fetchAssoc($val_set);
417 if ($time_from_lms ==
false) {
418 $time = $val_rec[
"sco_total_time_sec"];
420 $time = $val_rec[
"total_time_sec"];
422 $attempts = $val_rec[
"package_attempts"];
423 if ($attempts == null) {
427 if ($attempts !=
"" &&
$time == null) {
428 $time = self::getSumTotalTimeSecondsFromScos($a_obj_id, $a_user_id,
true);
431 include_once(
"./Services/Tracking/classes/class.ilChangeEvent.php");
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.
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 482 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $ilLog, $time, and ilObjSCORM2004LearningModule\_ISODurationToCentisec().
Referenced by ilObjSCORMInitData\getStatus().
486 $ilDB = $DIC->database();
489 $val_set =
$ilDB->queryF(
490 'SELECT cp_node_id FROM cp_node 492 AND cp_node.slm_id = %s',
493 array(
'text',
'integer'),
494 array(
'item', $a_obj_id)
496 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
497 array_push($scos, $val_rec[
'cp_node_id']);
500 foreach ($scos as $sco) {
501 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
502 $data_set =
$ilDB->queryF(
506 WHERE cp_node_id = %s 508 array(
'integer',
'integer'),
509 array($sco, $a_user_id)
512 while ($data_rec =
$ilDB->fetchAssoc($data_set)) {
519 if ($a_write &&
$time > 0) {
521 'UPDATE sahs_user SET sco_total_time_sec=%s WHERE obj_id = %s AND user_id = %s',
522 array(
'integer',
'integer',
'integer'),
523 array(
$time, $a_obj_id, $a_user_id)
static _ISODurationToCentisec($str)
convert ISO 8601 Timeperiods to centiseconds ta
The documentation for this class was generated from the following file: