48 static function _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type =
'')
52 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
55 require_once
'Services/Tracking/classes/class.ilLPStatus.php';
63 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
66 include_once
'./Services/Calendar/classes/class.ilDateTime.php';
68 foreach($events as
$row)
78 $progress[
'spent_seconds'] +=
$row[
'spent_seconds'];
79 $progress[
'access_time'] = max($progress[
'access_time'],
$row[
'last_access']);
80 $progress[
'access_time_min'] = min($progress[
'access_time_min'],
$row[
'first_access']);
84 $progress[
'obj_id'] =
$row[
'obj_id'];
85 $progress[
'user_id'] =
$row[
'usr_id'];
86 $progress[
'spent_seconds'] =
$row[
'spent_seconds'];
87 $progress[
'access_time'] =
$row[
'last_access'];
88 $progress[
'access_time_min'] =
$row[
'first_access'];
89 $progress[
'visits'] =
$row[
'read_count'];
92 return $progress ? $progress : array();
104 include_once(
'./Services/Tracking/classes/class.ilChangeEvent.php');
107 if(isset($progress[
$row[
'usr_id']]))
109 $progress[
$row[
'usr_id']][
'spent_seconds'] +=
$row[
'spent_seconds'];
110 $progress[
$row[
'usr_id']][
'read_count'] +=
$row[
'read_count'];
111 $progress[
$row[
'usr_id']][
'ts'] = max(
$row[
'last_access'],$progress[
$row[
'usr_id']][
'ts']);
115 $progress[
$row[
'usr_id']][
'spent_seconds'] =
$row[
'spent_seconds'];
116 $progress[
$row[
'usr_id']][
'read_count'] =
$row[
'read_count'];
117 $progress[
$row[
'usr_id']][
'ts'] =
$row[
'last_access'];
120 $progress[
$row[
'usr_id']][
'usr_id'] =
$row[
'usr_id'];
121 $progress[
$row[
'usr_id']][
'obj_id'] =
$row[
'obj_id'];
123 return $progress ? $progress : array();
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object which happened after the last time the user caught ...
_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.
@classDescription Date and time handling
static setInProgressIfNotAttempted($a_obj_id, $a_user_id)
This function shoudl be clalled for normal "read events".
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
static _lookupProgressByObjId($a_obj_id)
lookup progress for a specific object
_getProgress($a_user_id, $a_obj_id)