Class ilObjSCORMTracking.
More...
|
static | storeJsApi ($obj_id=0) |
|
static | storeJsApiCmi ($user_id, $obj_id, $data) |
|
static | syncGlobalStatus ($userId, $packageId, $data, $new_global_status) |
|
static | _syncReadEvent ($a_obj_id, $a_user_id, $a_type, $a_ref_id) |
| Synch read event table. More...
|
|
static | _insertTrackData ($a_sahs_id, $a_lval, $a_rval, $a_obj_id) |
|
static | _getInProgress ($scorm_item_id, $a_obj_id, $a_blocked_user_ids=null) |
|
static | _getCompleted ($scorm_item_id, $a_obj_id) |
| like necessary because of Oracle More...
|
|
static | _getCollectionStatus ($a_scos, $a_obj_id, $a_user_id) |
|
static | _countCompleted ($a_scos, $a_obj_id, $a_user_id) |
|
static | lookupLastAccessTimes ($a_obj_id) |
| Lookup last acccess time for all users of a scorm module ilDB $ilDB. More...
|
|
static | _getTrackedUsers ($a_obj_id) |
| Get all tracked users. More...
|
|
static | _getFailed ($scorm_item_id, $a_obj_id) |
| like necessary because of Oracle More...
|
|
static | _getCountCompletedPerUser ($a_scorm_item_ids, $a_obj_id) |
| Get users who have status completed or passed. More...
|
|
static | _getProgressInfo ($sco_item_ids, $a_obj_id) |
| Get info about. More...
|
|
static | scorm12PlayerUnload () |
|
static | checkIfAllowed ($packageId, $userId, $hash) |
|
◆ _countCompleted()
static ilObjSCORMTracking::_countCompleted |
( |
|
$a_scos, |
|
|
|
$a_obj_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Definition at line 528 of file class.ilObjSCORMTracking.php.
References $ilDB, $in, $res, and array.
Referenced by ilLPStatusSCORM\determinePercentage().
532 if (is_array($a_scos))
534 $in = $ilDB->in(
'sco_id', $a_scos,
false,
'integer');
536 $res = $ilDB->queryF(
'SELECT sco_id, rvalue FROM scorm_tracking 541 array(
'integer',
'text',
'integer'),
542 array($a_obj_id,
'cmi.core.lesson_status', $a_user_id));
545 while ($rec = $ilDB->fetchAssoc(
$res))
547 if ($rec[
"rvalue"] ==
"completed" || $rec[
"rvalue"] ==
"passed")
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getCollectionStatus()
static ilObjSCORMTracking::_getCollectionStatus |
( |
|
$a_scos, |
|
|
|
$a_obj_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Definition at line 476 of file class.ilObjSCORMTracking.php.
References $failed, $ilDB, $in, $res, and array.
Referenced by ilLPStatusSCORM\determineStatus().
481 $status =
"not_attempted";
483 if (is_array($a_scos))
485 $in = $ilDB->in(
'sco_id', $a_scos,
false,
'integer');
487 $res = $ilDB->queryF(
'SELECT sco_id, rvalue FROM scorm_tracking 492 array(
'integer',
'text',
'integer'),
493 array($a_obj_id,
'cmi.core.lesson_status', $a_user_id));
498 while ($rec = $ilDB->fetchAssoc(
$res))
500 if ($rec[
"rvalue"] ==
"failed")
504 if ($rec[
"rvalue"] !=
"completed" && $rec[
"rvalue"] !=
"passed")
512 $status =
"in_progress";
514 if ($completed && $cnt == count($a_scos))
516 $status =
"completed";
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getCompleted()
static ilObjSCORMTracking::_getCompleted |
( |
|
$scorm_item_id, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
like necessary because of Oracle
- Parameters
-
object | $scorm_item_id | |
object | $a_obj_id | |
- Returns
Definition at line 442 of file class.ilObjSCORMTracking.php.
References $ilDB, $in, $res, $row, and array.
446 if(is_array($scorm_item_id))
448 $in = $ilDB->in(
'sco_id', $scorm_item_id,
false,
'integer');
450 $res = $ilDB->queryF(
'SELECT DISTINCT(user_id) FROM scorm_tracking 454 AND ('.$ilDB->like(
'rvalue',
'clob',
'completed').
' OR '.$ilDB->like(
'rvalue',
'clob',
'passed').
')',
455 array(
'integer',
'text'),
456 array($a_obj_id,
'cmi.core.lesson_status'));
460 $res = $ilDB->queryF(
'SELECT DISTINCT(user_id) FROM scorm_tracking 464 AND ('.$ilDB->like(
'rvalue',
'clob',
'completed').
' OR '.$ilDB->like(
'rvalue',
'clob',
'passed').
')',
465 array(
'integer',
'integer',
'text'),
466 array($scorm_item_id,$a_obj_id,
'cmi.core.lesson_status'));
469 while(
$row = $ilDB->fetchObject(
$res))
471 $user_ids[] =
$row->user_id;
473 return $user_ids ? $user_ids :
array();
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getCountCompletedPerUser()
static ilObjSCORMTracking::_getCountCompletedPerUser |
( |
|
$a_scorm_item_ids, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
Get users who have status completed or passed.
- Parameters
-
object | $a_scorm_item_ids | |
object | $a_obj_id | |
- Returns
Definition at line 653 of file class.ilObjSCORMTracking.php.
References $ilDB, $in, $res, $row, and array.
Referenced by ilLPStatusSCORM\_getStatusInfo().
657 $in = $ilDB->in(
'sco_id', $a_scorm_item_ids,
false,
'integer');
661 $res = $ilDB->queryF(
' 662 SELECT user_id, COUNT(user_id) completed FROM scorm_tracking 666 AND ('.$ilDB->like(
'rvalue',
'clob',
'completed').
' OR '.$ilDB->like(
'rvalue',
'clob',
'passed').
') 668 array(
'integer',
'text'),
669 array($a_obj_id,
'cmi.core.lesson_status')
671 while(
$row = $ilDB->fetchObject(
$res))
673 $users[
$row->user_id] =
$row->completed;
675 return $users ? $users :
array();
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getFailed()
static ilObjSCORMTracking::_getFailed |
( |
|
$scorm_item_id, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
like necessary because of Oracle
- Parameters
-
object | $scorm_item_id | |
object | $a_obj_id | |
- Returns
Definition at line 610 of file class.ilObjSCORMTracking.php.
References $ilDB, $in, $res, $row, and array.
614 if(is_array($scorm_item_id))
616 $in = $ilDB->in(
'sco_id', $scorm_item_id,
false,
'integer');
618 $res = $ilDB->queryF(
' 619 SELECT DISTINCT(user_id) FROM scorm_tracking 623 AND '.$ilDB->like(
'rvalue',
'clob',
'failed').
' ',
624 array(
'integer',
'text'),
625 array($a_obj_id,
'cmi.core.lesson_status'));
630 $res = $ilDB->queryF(
' 631 SELECT DISTINCT(user_id) FROM scorm_tracking 635 AND '.$ilDB->like(
'rvalue',
'clob',
'failed').
' ',
636 array(
'integer',
'integer',
'text'),
637 array($scorm_item_id,$a_obj_id,
'cmi.core.lesson_status'));
640 while(
$row = $ilDB->fetchObject(
$res))
642 $user_ids[] =
$row->user_id;
644 return $user_ids ? $user_ids :
array();
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getInProgress()
static ilObjSCORMTracking::_getInProgress |
( |
|
$scorm_item_id, |
|
|
|
$a_obj_id, |
|
|
|
$a_blocked_user_ids = null |
|
) |
| |
|
static |
- Parameters
-
object | $scorm_item_id | |
object | $a_obj_id | |
array | $a_blocked_user_ids | |
- Returns
Definition at line 397 of file class.ilObjSCORMTracking.php.
References $ilDB, $in, $res, $row, and array.
Referenced by _getProgressInfo().
401 if(is_array($scorm_item_id))
403 $in = $ilDB->in(
'sco_id', $scorm_item_id,
false,
'integer');
405 $res = $ilDB->queryF(
'SELECT user_id,sco_id FROM scorm_tracking 408 GROUP BY user_id, sco_id',
414 $res = $ilDB->queryF(
'SELECT user_id,sco_id FROM scorm_tracking 417 array(
'integer',
'integer'),
array($scorm_item_id,$a_obj_id)
421 $in_progress =
array();
423 while(
$row = $ilDB->fetchObject(
$res))
426 if(!($a_blocked_user_ids &&
427 is_array($a_blocked_user_ids[
$row->sco_id]) &&
428 in_array(
$row->user_id, $a_blocked_user_ids[
$row->sco_id])))
430 $in_progress[
$row->sco_id][] =
$row->user_id;
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
◆ _getProgressInfo()
static ilObjSCORMTracking::_getProgressInfo |
( |
|
$sco_item_ids, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
Get info about.
- Parameters
-
object | $sco_item_ids | |
object | $a_obj_id | |
- Returns
Definition at line 684 of file class.ilObjSCORMTracking.php.
References $ilDB, $in, $info, $res, $row, _getInProgress(), and array.
Referenced by ilLPStatusSCORM\_getStatusInfo().
688 $in = $ilDB->in(
'sco_id', $sco_item_ids,
false,
'integer');
690 $res = $ilDB->queryF(
' 691 SELECT * FROM scorm_tracking 695 array(
'integer',
'text'),
696 array($a_obj_id,
'cmi.core.lesson_status'));
702 while(
$row = $ilDB->fetchObject(
$res))
709 $user_ids[
$row->sco_id][] =
$row->user_id;
714 $user_ids[
$row->sco_id][] =
$row->user_id;
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
static _getInProgress($scorm_item_id, $a_obj_id, $a_blocked_user_ids=null)
◆ _getTrackedUsers()
static ilObjSCORMTracking::_getTrackedUsers |
( |
|
$a_obj_id | ) |
|
|
static |
◆ _insertTrackData()
static ilObjSCORMTracking::_insertTrackData |
( |
|
$a_sahs_id, |
|
|
|
$a_lval, |
|
|
|
$a_rval, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
Definition at line 370 of file class.ilObjSCORMTracking.php.
References $ilDB, $ilUser, ilLPStatusWrapper\_updateStatus(), array, and ilUtil\now().
Referenced by ilSCORMItem\insertTrackData(), ilAICCUnit\insertTrackData(), and ilAICCCourse\insertTrackData().
374 $ilDB->insert(
'scorm_tracking',
array(
375 'obj_id' =>
array(
'integer', $a_obj_id),
376 'user_id' =>
array(
'integer', $ilUser->getId()),
377 'sco_id' =>
array(
'integer', $a_sahs_id),
378 'lvalue' =>
array(
'text', $a_lval),
379 'rvalue' =>
array(
'clob', $a_rval),
383 if ($a_lval ==
"cmi.core.lesson_status")
385 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static now()
Return current timestamp in Y-m-d H:i:s format.
Create styles array
The data for the language used.
◆ _syncReadEvent()
static ilObjSCORMTracking::_syncReadEvent |
( |
|
$a_obj_id, |
|
|
|
$a_user_id, |
|
|
|
$a_type, |
|
|
|
$a_ref_id |
|
) |
| |
|
static |
Synch read event table.
- Parameters
-
Definition at line 324 of file class.ilObjSCORMTracking.php.
References $a_type, $ilDB, $ilLog, ilChangeEvent\_recordReadEvent(), and array.
Referenced by scorm12PlayerUnload(), and store().
327 $val_set = $ilDB->queryF(
'SELECT package_attempts, total_time_sec, sco_total_time_sec, time_from_lms FROM sahs_user, sahs_lm ' 328 .
'WHERE sahs_user.obj_id = %s AND sahs_user.user_id = %s AND sahs_user.obj_id = sahs_lm.id',
329 array(
'integer',
'integer'),
330 array($a_obj_id,$a_user_id));
332 $val_rec = $ilDB->fetchAssoc($val_set);
334 if ($val_rec[
"package_attempts"] == null) {
335 $val_rec[
"package_attempts"]=
"";
337 $attempts = $val_rec[
"package_attempts"];
343 $time = (int)$val_rec[
"sco_total_time_sec"];
348 $sco_set = $ilDB->queryF(
' 349 SELECT sco_id, rvalue FROM scorm_tracking 354 array(
'integer',
'integer',
'text',
'integer'),
355 array($a_obj_id,$a_user_id,
'cmi.core.total_time',0));
357 while($sco_rec = $ilDB->fetchAssoc($sco_set))
359 $tarr = explode(
":", $sco_rec[
"rvalue"]);
360 $sec = (int) $tarr[2] + (
int) $tarr[1] * 60 +
361 (int) substr($tarr[0], strlen($tarr[0]) - 3) * 60 * 60;
366 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.
Create styles array
The data for the language used.
◆ checkIfAllowed()
static ilObjSCORMTracking::checkIfAllowed |
( |
|
$packageId, |
|
|
|
$userId, |
|
|
|
$hash |
|
) |
| |
|
static |
Definition at line 751 of file class.ilObjSCORMTracking.php.
References $ilDB, $packageId, $res, array, and date.
753 $res = $ilDB->queryF(
'select hash from sahs_user where obj_id=%s AND user_id=%s AND hash_end>%s',
754 array(
'integer',
'integer',
'timestamp'),
757 $rowtmp=$ilDB->fetchAssoc(
$res);
758 if ($rowtmp[
'hash']==$hash)
return;
759 else die(
"not allowed");
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
◆ extractData()
ilObjSCORMTracking::extractData |
( |
| ) |
|
Definition at line 15 of file class.ilObjSCORMTracking.php.
References $_GET, $_POST, and array.
Referenced by store().
17 $this->insert =
array();
18 if (is_array(
$_GET[
"iL"]))
20 foreach(
$_GET[
"iL"] as $key => $value)
22 $this->insert[] =
array(
"left" => $value,
"right" =>
$_GET[
"iR"][$key]);
25 if (is_array(
$_POST[
"iL"]))
27 foreach(
$_POST[
"iL"] as $key => $value)
29 $this->insert[] =
array(
"left" => $value,
"right" =>
$_POST[
"iR"][$key]);
33 $this->update =
array();
34 if (is_array(
$_GET[
"uL"]))
36 foreach(
$_GET[
"uL"] as $key => $value)
38 $this->update[] =
array(
"left" => $value,
"right" =>
$_GET[
"uR"][$key]);
41 if (is_array(
$_POST[
"uL"]))
43 foreach(
$_POST[
"uL"] as $key => $value)
45 $this->update[] =
array(
"left" => $value,
"right" =>
$_POST[
"uR"][$key]);
Create styles array
The data for the language used.
◆ lookupLastAccessTimes()
static ilObjSCORMTracking::lookupLastAccessTimes |
( |
|
$a_obj_id | ) |
|
|
static |
◆ scorm12PlayerUnload()
static ilObjSCORMTracking::scorm12PlayerUnload |
( |
| ) |
|
|
static |
Definition at line 723 of file class.ilObjSCORMTracking.php.
References $_GET, $_POST, $GLOBALS, $ilDB, $ilUser, $ref_id, _syncReadEvent(), array, date, and header.
728 $user_id = (int)
$_GET[
"p"];
731 $obj_id = (int)
$_GET[
"package_id"];
733 $GLOBALS[
'ilLog']->write(__METHOD__.
' no valid obj_id');
735 $last_visited=
$_POST[
'last_visited'];
737 $ilDB->manipulateF(
'UPDATE sahs_user 738 SET last_visited = %s, hash_end =%s, last_access = %s 739 WHERE obj_id = %s AND user_id = %s',
740 array(
'text',
'timestamp',
'timestamp',
'integer',
'integer'),
741 array($last_visited, $endDate,
date(
'Y-m-d H:i:s'), $obj_id, $user_id)
747 header(
'Content-Type: text/plain; charset=UTF-8');
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Add a drawing to the header
static _syncReadEvent($a_obj_id, $a_user_id, $a_type, $a_ref_id)
Synch read event table.
Create styles array
The data for the language used.
◆ store()
ilObjSCORMTracking::store |
( |
|
$obj_id = 0 , |
|
|
|
$sahs_id = 0 , |
|
|
|
$extractData = 1 |
|
) |
| |
Definition at line 50 of file class.ilObjSCORMTracking.php.
References $_GET, $_POST, $ilDB, $ilUser, $insert, $ref_id, ilObject\_lookupObjId(), _syncReadEvent(), ilLPStatusWrapper\_updateStatus(), array, extractData(), and ilUtil\now().
61 $f = fopen(
"./Modules/ScormAicc/log/scorm.log",
"a");
62 fwrite($f,
"\nCALLING SCORM store()\n");
63 fwrite($f,
'POST: '.print_r(
$_POST,
true));
72 if (is_object($ilUser))
74 $user_id = $ilUser->getId();
81 fwrite($f,
"Error: No obj_id given.\n");
85 foreach($this->insert as
$insert)
87 $set = $ilDB->queryF(
' 88 SELECT * FROM scorm_tracking 93 array(
'integer',
'integer',
'text',
'integer'),
94 array($user_id,$sahs_id,$insert[
"left"],$obj_id));
95 if ($rec = $ilDB->fetchAssoc($set))
97 fwrite($f,
"Error Insert, left value already exists. L:".$insert[
"left"].
",R:".
98 $insert[
"right"].
",sahs_id:".$sahs_id.
",user_id:".$user_id.
"\n");
102 $ilDB->insert(
'scorm_tracking',
array(
103 'obj_id' =>
array(
'integer', $obj_id),
104 'user_id' =>
array(
'integer', $user_id),
105 'sco_id' =>
array(
'integer', $sahs_id),
106 'lvalue' =>
array(
'text', $insert[
"left"]),
107 'rvalue' =>
array(
'clob', $insert[
"right"]),
111 fwrite($f,
"Insert - L:".$insert[
"left"].
",R:".
112 $insert[
"right"].
",sahs_id:".$sahs_id.
",user_id:".$user_id.
"\n");
115 foreach($this->update as $update)
117 $set = $ilDB->queryF(
' 118 SELECT * FROM scorm_tracking 123 array(
'integer',
'integer',
'text',
'integer'),
124 array($user_id,$sahs_id,$update[
"left"],$obj_id));
126 if ($rec = $ilDB->fetchAssoc($set))
128 $ilDB->update(
'scorm_tracking',
130 'rvalue' =>
array(
'clob', $update[
"right"]),
134 'user_id' =>
array(
'integer', $user_id),
135 'sco_id' =>
array(
'integer', $sahs_id),
136 'lvalue' =>
array(
'text', $update[
"left"]),
137 'obj_id' =>
array(
'integer', $obj_id)
143 fwrite($f,
"ERROR Update, left value does not exist. L:".$update[
"left"].
",R:".
144 $update[
"right"].
",sahs_id:".$sahs_id.
",user_id:".$user_id.
"\n");
152 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static now()
Return current timestamp in Y-m-d H:i:s format.
static _lookupObjId($a_id)
static _syncReadEvent($a_obj_id, $a_user_id, $a_type, $a_ref_id)
Synch read event table.
Create styles array
The data for the language used.
◆ storeJsApi()
static ilObjSCORMTracking::storeJsApi |
( |
|
$obj_id = 0 | ) |
|
|
static |
Definition at line 160 of file class.ilObjSCORMTracking.php.
References $_GET, $data, $in, and header.
167 $obj_id = (int)
$_GET[
"package_id"];
168 $in = file_get_contents(
"php://input");
171 $user_id = (int)
$data->p;
173 header(
'Content-Type: text/plain; charset=UTF-8');
175 $rval=self::storeJsApiCmi($user_id,$obj_id,
$data);
177 print(
"storeJsApiCmi failed");
179 $rval=self::syncGlobalStatus($user_id, $obj_id,
$data,
$data->now_global_status);
180 if($rval!=
true) print(
"syncGlobalStatus failed");
182 if($rval==
true) print(
"ok");
Add a drawing to the header
if(php_sapi_name() !='cli') $in
◆ storeJsApiCmi()
static ilObjSCORMTracking::storeJsApiCmi |
( |
|
$user_id, |
|
|
|
$obj_id, |
|
|
|
$data |
|
) |
| |
|
static |
Definition at line 185 of file class.ilObjSCORMTracking.php.
References $_POST, $data, $ilDB, $ilLog, array, and ilUtil\now().
Referenced by ilSCORMOfflineMode\sop2il().
188 $b_updateStatus=
false;
191 if ($ilLog->current_log_level == 30)
195 $ilLog->write(
"ScormAicc: CALLING SCORM storeJsApi() ".
$_POST);
204 for ($i=0;$i<count(
$data->cmi);$i++) {
205 $aa_data[] =
array(
"sco_id" => (
int)
$data->cmi[$i][0],
"left" =>
$data->cmi[$i][1],
"right" =>
$data->cmi[$i][2]);
210 $ilLog->write(
"ScormAicc: storeJsApi: Error: No valid obj_id given.");
213 foreach($aa_data as $a_data) {
214 $set = $ilDB->queryF(
' 215 SELECT rvalue FROM scorm_tracking 220 array(
'integer',
'integer',
'text',
'integer'),
221 array($user_id,$a_data[
"sco_id"],$a_data[
"left"],$obj_id));
222 if ($rec = $ilDB->fetchAssoc($set)) {
223 if ($a_data[
"left"] ==
'cmi.core.lesson_status' && $a_data[
"right"] != $rec[
"rvalue"]) {
224 $b_updateStatus =
true;
226 $ilDB->update(
'scorm_tracking',
228 'rvalue' =>
array(
'clob', $a_data[
"right"]),
232 'user_id' =>
array(
'integer', $user_id),
233 'sco_id' =>
array(
'integer', $a_data[
"sco_id"]),
234 'lvalue' =>
array(
'text', $a_data[
"left"]),
235 'obj_id' =>
array(
'integer', $obj_id)
239 $ilLog->write(
"ScormAicc: storeJsApi Updated - L:".$a_data[
"left"].
",R:".
240 $a_data[
"right"].
" for obj_id:".$obj_id.
",sco_id:".$a_data[
"sco_id"].
",user_id:".$user_id);
244 if ($a_data[
"left"] ==
'cmi.core.lesson_status') {
245 $b_updateStatus =
true;
247 $ilDB->insert(
'scorm_tracking',
array(
248 'obj_id' =>
array(
'integer', $obj_id),
249 'user_id' =>
array(
'integer', $user_id),
250 'sco_id' =>
array(
'integer', $a_data[
"sco_id"]),
251 'lvalue' =>
array(
'text', $a_data[
"left"]),
252 'rvalue' =>
array(
'clob', $a_data[
"right"]),
256 $ilLog->write(
"ScormAicc: storeJsApi Inserted - L:".$a_data[
"left"].
",R:".
257 $a_data[
"right"].
" for obj_id:".$obj_id.
",sco_id:".$a_data[
"sco_id"].
",user_id:".$user_id);
static now()
Return current timestamp in Y-m-d H:i:s format.
Create styles array
The data for the language used.
◆ syncGlobalStatus()
static ilObjSCORMTracking::syncGlobalStatus |
( |
|
$userId, |
|
|
|
$packageId, |
|
|
|
$data, |
|
|
|
$new_global_status |
|
) |
| |
|
static |
Definition at line 273 of file class.ilObjSCORMTracking.php.
References $_GET, $data, $ilDB, $ilLog, $packageId, ilChangeEvent\_recordReadEvent(), array, and ilLPStatus\writeStatus().
Referenced by ilSCORMOfflineMode\sop2il().
276 $saved_global_status=
$data->saved_global_status;
277 $ilLog->write(
"saved_global_status=".$saved_global_status);
282 if (!
$data->packageAttempts) {
283 $val_set = $ilDB->queryF(
'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
285 $val_rec = $ilDB->fetchAssoc($val_set);
286 $attempts = $val_rec[
"package_attempts"];
288 $attempts=
$data->packageAttempts;
290 if ($attempts == null) $attempts = 1;
293 $totalTime=(int)
$data->totalTimeCentisec;
294 $totalTime=round($totalTime/100);
295 $ilDB->queryF(
'UPDATE sahs_user SET sco_total_time_sec=%s, status=%s, percentage_completed=%s, package_attempts=%s WHERE obj_id = %s AND user_id = %s',
296 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
297 array($totalTime, $new_global_status,
$data->percentageCompleted, $attempts,
$packageId, $userId));
300 global $ilObjDataCache;
301 include_once(
"./Services/Tracking/classes/class.ilChangeEvent.php");
307 if ($new_global_status != null) {
308 include_once(
"./Services/Tracking/classes/class.ilObjUserTracking.php");
309 include_once(
"./Services/Tracking/classes/class.ilLPStatus.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.
Create styles array
The data for the language used.
static writeStatus($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false)
Write status for user and object.
The documentation for this class was generated from the following file: