32 string $a_obj_type =
''
46 public static function _getProgress(
int $a_user_id,
int $a_obj_id): array
51 foreach ($events as $row) {
59 $progress[
'spent_seconds'] += (
int) $row[
'spent_seconds'];
60 $progress[
'access_time'] = max(
61 $progress[
'access_time'],
62 (
int) $row[
'last_access']
64 $progress[
'access_time_min'] = min(
65 $progress[
'access_time_min'],
66 (
int) $row[
'first_access']
69 $progress[
'obj_id'] = (
int) $row[
'obj_id'];
70 $progress[
'user_id'] = (
int) $row[
'usr_id'];
71 $progress[
'spent_seconds'] = (
int) $row[
'spent_seconds'];
72 $progress[
'access_time'] = (
int) $row[
'last_access'];
73 $progress[
'access_time_min'] = (
int) $row[
'first_access'];
74 $progress[
'visits'] = (
int) $row[
'read_count'];
87 if (isset($progress[$row[
'usr_id']])) {
88 $progress[$row[
'usr_id']][
'spent_seconds'] += (
int) $row[
'spent_seconds'];
89 $progress[$row[
'usr_id']][
'read_count'] += (
int) $row[
'read_count'];
90 $progress[$row[
'usr_id']][
'ts'] = max(
91 (
int) $row[
'last_access'],
92 (
int) $progress[$row[
'usr_id']][
'ts']
95 $progress[$row[
'usr_id']][
'spent_seconds'] = (
int) $row[
'spent_seconds'];
96 $progress[$row[
'usr_id']][
'read_count'] = (
int) $row[
'read_count'];
97 $progress[$row[
'usr_id']][
'ts'] = (
int) $row[
'last_access'];
99 $progress[$row[
'usr_id']][
'usr_id'] = (
int) $row[
'usr_id'];
100 $progress[$row[
'usr_id']][
'obj_id'] = (
int) $row[
'obj_id'];
Class ilChangeEvent tracks change events on repository objects.
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
@classDescription Date and time handling
static setInProgressIfNotAttempted(int $a_obj_id, int $a_user_id)
This function shoudl be clalled for normal "read events".
static _getProgress(int $a_user_id, int $a_obj_id)
static _lookupProgressByObjId(int $a_obj_id)
lookup progress for a specific object
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')