Class ilSCORM2004Tracking.
More...
|
static | _getInProgress (int $scorm_item_id, int $a_obj_id) |
|
static | _getCompleted (int $scorm_item_id, int $a_obj_id) |
|
static | _getFailed (int $scorm_item_id, int $a_obj_id) |
|
static | _getCountCompletedPerUser (array $a_scorm_item_ids, int $a_obj_id, bool $a_omit_failed=false) |
| Get progress of selected scos. More...
|
|
static | _getProgressInfo (int $a_obj_id) |
| Get overall scorm status. More...
|
|
static | _getProgressInfoOfUser (int $a_obj_id, int $a_user_id) |
| Get overall scorm status. More...
|
|
static | _getTrackedUsers (int $a_obj_id) |
| Get all tracked users. More...
|
|
static | _getItemProgressInfo (array $a_scorm_item_ids, int $a_obj_id, bool $a_omit_failed) |
|
static | _getCollectionStatus (array $a_scos, int $a_obj_id, int $a_user_id) |
|
static | _countCompleted (array $a_scos, int $a_obj_id, int $a_user_id, bool $a_omit_failed) |
|
static | _syncReadEvent (int $a_obj_id, int $a_user_id, string $a_type, int $a_ref_id, ?bool $time_from_lms=null) |
| Synch read event table. More...
|
|
static | _isCompleted (string $a_status, string $a_satisfied) |
|
static | _isInProgress (string $a_status, string $a_satisfied) |
|
static | _isFailed (string $a_status, string $a_satisfied) |
|
static | getSumTotalTimeSecondsFromScos (int $a_obj_id, int $a_user_id, bool $a_write=false) |
| should be avoided; store value to increase performance for further requests More...
|
|
◆ _countCompleted()
static ilSCORM2004Tracking::_countCompleted |
( |
array |
$a_scos, |
|
|
int |
$a_obj_id, |
|
|
int |
$a_user_id, |
|
|
bool |
$a_omit_failed |
|
) |
| |
|
static |
Definition at line 279 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, and $res.
Referenced by ilLPStatusSCORM\determinePercentage().
287 $ilDB = $DIC->database();
290 if (is_array($a_scos)) {
291 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scos,
false,
'integer');
294 'SELECT cp_node.cp_node_id id, 295 cmi_node.completion_status completion, 296 cmi_node.success_status success 297 FROM cp_node, cmi_node 299 AND cp_node.cp_node_id = cmi_node.cp_node_id 300 AND cp_node.slm_id = %s 301 AND cmi_node.user_id = %s',
302 array(
'integer',
'integer'),
303 array($a_obj_id, $a_user_id)
311 if (($rec[
"completion"] ===
"completed" || $rec[
"success"] ===
"passed")
312 && (!$a_omit_failed || $rec[
"success"] !==
"failed")) {
◆ _getCollectionStatus()
static ilSCORM2004Tracking::_getCollectionStatus |
( |
array |
$a_scos, |
|
|
int |
$a_obj_id, |
|
|
int |
$a_user_id |
|
) |
| |
|
static |
Definition at line 231 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, and $res.
Referenced by ilLPStatusSCORM\determineStatus().
235 $ilDB = $DIC->database();
237 $status =
"not_attempted";
239 if (is_array($a_scos)) {
240 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scos,
false,
'integer');
243 'SELECT cp_node.cp_node_id id, 244 cmi_node.completion_status completion, 245 cmi_node.success_status success 246 FROM cp_node, cmi_node 248 AND cp_node.cp_node_id = cmi_node.cp_node_id 249 AND cp_node.slm_id = %s 250 AND cmi_node.user_id = %s',
251 array(
'integer',
'integer'),
252 array($a_obj_id, $a_user_id)
259 if ($rec[
"completion"] ===
"completed" || $rec[
"success"] ===
"passed") {
262 if ($rec[
"success"] ===
"failed") {
267 if ($started ==
true) {
268 $status =
"in_progress";
270 if ($failed ==
true) {
272 } elseif ($cntcompleted == count($a_scos)) {
273 $status =
"completed";
◆ _getCompleted()
static ilSCORM2004Tracking::_getCompleted |
( |
int |
$scorm_item_id, |
|
|
int |
$a_obj_id |
|
) |
| |
|
static |
◆ _getCountCompletedPerUser()
static ilSCORM2004Tracking::_getCountCompletedPerUser |
( |
array |
$a_scorm_item_ids, |
|
|
int |
$a_obj_id, |
|
|
bool |
$a_omit_failed = false |
|
) |
| |
|
static |
Get progress of selected scos.
- Parameters
-
bool | $a_omit_failed | do not include success==failed |
- Returns
- array<int|string, mixed>
Definition at line 57 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, and $res.
Referenced by ilLPStatusSCORM\_getStatusInfo().
61 $ilDB = $DIC->database();
64 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scorm_item_ids,
false,
'integer');
69 $omit_failed =
' AND success_status <> ' .
$ilDB->quote(
'failed',
'text');
74 SELECT cmi_node.user_id user_id, COUNT(user_id) completed FROM cp_node, cmi_node 75 WHERE ' . $in . $omit_failed .
' 76 AND cp_node.cp_node_id = cmi_node.cp_node_id 77 AND cp_node.slm_id = %s 78 AND completion_status = %s 79 GROUP BY cmi_node.user_id',
80 array(
'integer',
'text'),
81 array($a_obj_id,
'completed')
84 $users[$row->user_id] = $row->completed;
◆ _getFailed()
static ilSCORM2004Tracking::_getFailed |
( |
int |
$scorm_item_id, |
|
|
int |
$a_obj_id |
|
) |
| |
|
static |
◆ _getInProgress()
static ilSCORM2004Tracking::_getInProgress |
( |
int |
$scorm_item_id, |
|
|
int |
$a_obj_id |
|
) |
| |
|
static |
◆ _getItemProgressInfo()
static ilSCORM2004Tracking::_getItemProgressInfo |
( |
array |
$a_scorm_item_ids, |
|
|
int |
$a_obj_id, |
|
|
bool |
$a_omit_failed |
|
) |
| |
|
static |
- Returns
- array<string, array<int|string, mixed[]>>
Definition at line 190 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, and $res.
Referenced by ilLPStatusSCORM\_getStatusInfo().
194 $ilDB = $DIC->database();
196 $in =
$ilDB->in(
'cp_node.cp_node_id', $a_scorm_item_ids,
false,
'integer');
199 'SELECT cp_node.cp_node_id id, 200 cmi_node.user_id user_id, 201 cmi_node.completion_status completion, 202 cmi_node.success_status success 203 FROM cp_node, cmi_node 205 AND cp_node.cp_node_id = cmi_node.cp_node_id 206 AND cp_node.slm_id = %s',
211 $info[
'completed'] = array();
212 $info[
'failed'] = array();
213 $info[
'in_progress'] = array();
217 $info[
'in_progress'][$row[
"id"]][] = $row[
"user_id"];
218 if ($row[
"completion"] ===
"completed" || $row[
"success"] ===
"passed") {
220 if (!$a_omit_failed || $row[
"success"] !==
"failed") {
221 $info[
'completed'][$row[
"id"]][] = $row[
"user_id"];
224 if ($row[
"success"] ===
"failed") {
225 $info[
'failed'][$row[
"id"]][] = $row[
"user_id"];
◆ _getProgressInfo()
static ilSCORM2004Tracking::_getProgressInfo |
( |
int |
$a_obj_id | ) |
|
|
static |
Get overall scorm status.
- Returns
- array<string, int[]>
Definition at line 94 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $res, and ILIAS\Repository\int().
Referenced by ilLPStatusSCORMPackage\_getStatusInfo().
98 $ilDB = $DIC->database();
102 SELECT user_id, status, satisfied FROM cmi_gobjective 103 WHERE objective_id = %s 105 array(
'text',
'integer'),
106 array(
'-course_overall_status-', $a_obj_id)
109 $info[
'completed'] = array();
110 $info[
'failed'] = array();
111 $info[
'in_progress'] = array();
114 if (self::_isCompleted($row[
"status"], $row[
"satisfied"])) {
115 $info[
'completed'][] = (
int) $row[
"user_id"];
117 if (self::_isInProgress($row[
"status"], $row[
"satisfied"])) {
118 $info[
'in_progress'][] = (
int) $row[
"user_id"];
120 if (self::_isFailed($row[
"status"], $row[
"satisfied"])) {
121 $info[
'failed'][] = (
int) $row[
"user_id"];
◆ _getProgressInfoOfUser()
static ilSCORM2004Tracking::_getProgressInfoOfUser |
( |
int |
$a_obj_id, |
|
|
int |
$a_user_id |
|
) |
| |
|
static |
Get overall scorm status.
Definition at line 131 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, and $res.
Referenced by ilLPStatusSCORMPackage\determineStatus().
135 $ilDB = $DIC->database();
139 SELECT status, satisfied FROM cmi_gobjective 140 WHERE objective_id = %s 141 AND scope_id = %s AND user_id = %s',
142 array(
'text',
'integer',
'integer'),
143 array(
'-course_overall_status-', $a_obj_id, $a_user_id)
146 $status =
"not_attempted";
148 if (self::_isInProgress($row[
"status"], $row[
"satisfied"])) {
149 $status =
"in_progress";
151 if (self::_isCompleted($row[
"status"], $row[
"satisfied"])) {
152 $status =
"completed";
154 if (self::_isFailed($row[
"status"], $row[
"satisfied"])) {
◆ _getTrackedUsers()
static ilSCORM2004Tracking::_getTrackedUsers |
( |
int |
$a_obj_id | ) |
|
|
static |
◆ _isCompleted()
static ilSCORM2004Tracking::_isCompleted |
( |
string |
$a_status, |
|
|
string |
$a_satisfied |
|
) |
| |
|
static |
◆ _isFailed()
static ilSCORM2004Tracking::_isFailed |
( |
string |
$a_status, |
|
|
string |
$a_satisfied |
|
) |
| |
|
static |
◆ _isInProgress()
static ilSCORM2004Tracking::_isInProgress |
( |
string |
$a_status, |
|
|
string |
$a_satisfied |
|
) |
| |
|
static |
◆ _syncReadEvent()
static ilSCORM2004Tracking::_syncReadEvent |
( |
int |
$a_obj_id, |
|
|
int |
$a_user_id, |
|
|
string |
$a_type, |
|
|
int |
$a_ref_id, |
|
|
?bool |
$time_from_lms = null |
|
) |
| |
|
static |
Synch read event table.
Definition at line 323 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, $time_from_lms, ilChangeEvent\_recordReadEvent(), null, and ilUtil\yn2tf().
Referenced by ilSCORM2004StoreData\scormPlayerUnload(), and ilSCORM2004StoreData\syncGlobalStatus().
327 $ilDB = $DIC->database();
330 $val_set =
$ilDB->queryF(
331 'SELECT time_from_lms FROM sahs_lm WHERE id = %s',
335 $val_rec =
$ilDB->fetchAssoc($val_set);
339 $val_set =
$ilDB->queryF(
341 SELECT package_attempts, sco_total_time_sec, total_time_sec 342 FROM sahs_user WHERE obj_id = %s AND user_id = %s',
343 array(
'integer',
'integer'),
344 array($a_obj_id,$a_user_id)
346 $val_rec =
$ilDB->fetchAssoc($val_set);
348 $time = $val_rec[
"sco_total_time_sec"];
350 $time = $val_rec[
"total_time_sec"];
352 $attempts = $val_rec[
"package_attempts"];
353 if ($attempts ==
null) {
357 if ($attempts !=
"" && $time ==
null) {
358 $time = self::getSumTotalTimeSecondsFromScos($a_obj_id, $a_user_id,
true);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static yn2tf(string $a_yn)
◆ getSumTotalTimeSecondsFromScos()
static ilSCORM2004Tracking::getSumTotalTimeSecondsFromScos |
( |
int |
$a_obj_id, |
|
|
int |
$a_user_id, |
|
|
bool |
$a_write = false |
|
) |
| |
|
static |
should be avoided; store value to increase performance for further requests
Definition at line 403 of file class.ilSCORM2004Tracking.php.
References $DIC, $ilDB, ilObjSCORM2004LearningModule\_ISODurationToCentisec(), and ILIAS\Repository\int().
Referenced by ilObjSCORMInitData\getStatus().
407 $ilDB = $DIC->database();
409 $val_set =
$ilDB->queryF(
410 'SELECT cp_node_id FROM cp_node 412 AND cp_node.slm_id = %s',
413 array(
'text',
'integer'),
414 array(
'item', $a_obj_id)
416 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
417 $scos[] = $val_rec[
'cp_node_id'];
420 foreach ($scos as $sco) {
422 $data_set =
$ilDB->queryF(
426 WHERE cp_node_id = %s 428 array(
'integer',
'integer'),
429 array($sco, $a_user_id)
432 while ($data_rec =
$ilDB->fetchAssoc($data_set)) {
438 if ($a_write && $time > 0) {
440 'UPDATE sahs_user SET sco_total_time_sec=%s WHERE obj_id = %s AND user_id = %s',
441 array(
'integer',
'integer',
'integer'),
442 array($time, $a_obj_id, $a_user_id)
static _ISODurationToCentisec(string $str)
convert ISO 8601 Timeperiods to centiseconds
The documentation for this class was generated from the following file: