ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLearningProgress Class Reference
+ Collaboration diagram for ilLearningProgress:

Static Public Member Functions

static _tracProgress (int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
 
static _getProgress (int $a_user_id, int $a_obj_id)
 
static _lookupProgressByObjId (int $a_obj_id)
 lookup progress for a specific object More...
 

Detailed Description

Definition at line 24 of file class.ilLearningProgress.php.

Member Function Documentation

◆ _getProgress()

static ilLearningProgress::_getProgress ( int  $a_user_id,
int  $a_obj_id 
)
static

Definition at line 45 of file class.ilLearningProgress.php.

References ilChangeEvent\_lookupReadEvents(), IL_CAL_DATETIME, IL_CAL_UNIX, and ILIAS\Repository\int().

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), ilCourseMailTemplateTutorContext\getCachedPeriodByObjId(), and ilScormMailTemplateLPContext\getDescription().

45  : array
46  {
47  $events = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
48 
49  $progress = [];
50  foreach ($events as $row) {
51  $tmp_date = new ilDateTime($row['last_access'], IL_CAL_UNIX);
52  $row['last_access'] = $tmp_date->get(IL_CAL_UNIX);
53 
54  $tmp_date = new ilDateTime($row['first_access'], IL_CAL_DATETIME);
55  $row['first_access'] = $tmp_date->get(IL_CAL_UNIX);
56 
57  if ($progress) {
58  $progress['spent_seconds'] += (int) $row['spent_seconds'];
59  $progress['access_time'] = max(
60  $progress['access_time'],
61  (int) $row['last_access']
62  );
63  $progress['access_time_min'] = min(
64  $progress['access_time_min'],
65  (int) $row['first_access']
66  );
67  } else {
68  $progress['obj_id'] = (int) $row['obj_id'];
69  $progress['user_id'] = (int) $row['usr_id'];
70  $progress['spent_seconds'] = (int) $row['spent_seconds'];
71  $progress['access_time'] = (int) $row['last_access'];
72  $progress['access_time_min'] = (int) $row['first_access'];
73  $progress['visits'] = (int) $row['read_count'];
74  }
75  }
76  return $progress;
77  }
const IL_CAL_DATETIME
const IL_CAL_UNIX
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupProgressByObjId()

static ilLearningProgress::_lookupProgressByObjId ( int  $a_obj_id)
static

lookup progress for a specific object

Definition at line 82 of file class.ilLearningProgress.php.

References ilChangeEvent\_lookupReadEvents(), and ILIAS\Repository\int().

Referenced by ilCourseMembershipGUI\getPrintMemberData(), ilLearningSequenceRoles\readMemberData(), ilObjGroupGUI\readMemberData(), and ilObjCourseGUI\readMemberData().

82  : array
83  {
84  $progress = [];
85  foreach (ilChangeEvent::_lookupReadEvents($a_obj_id) as $row) {
86  if (isset($progress[$row['usr_id']])) {
87  $progress[$row['usr_id']]['spent_seconds'] += (int) $row['spent_seconds'];
88  $progress[$row['usr_id']]['read_count'] += (int) $row['read_count'];
89  $progress[$row['usr_id']]['ts'] = max(
90  (int) $row['last_access'],
91  (int) $progress[$row['usr_id']]['ts']
92  );
93  } else {
94  $progress[$row['usr_id']]['spent_seconds'] = (int) $row['spent_seconds'];
95  $progress[$row['usr_id']]['read_count'] = (int) $row['read_count'];
96  $progress[$row['usr_id']]['ts'] = (int) $row['last_access'];
97  }
98  $progress[$row['usr_id']]['usr_id'] = (int) $row['usr_id'];
99  $progress[$row['usr_id']]['obj_id'] = (int) $row['obj_id'];
100  }
101  return $progress;
102  }
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _tracProgress()

static ilLearningProgress::_tracProgress ( int  $a_user_id,
int  $a_obj_id,
int  $a_ref_id,
string  $a_obj_type = '' 
)
static

Definition at line 27 of file class.ilLearningProgress.php.

References ilChangeEvent\_recordReadEvent(), and ilLPStatus\setInProgressIfNotAttempted().

Referenced by ilObjGroupGUI\executeCommand(), ilObjCourseGUI\executeCommand(), ilSurveyExecutionGUI\outSurveyPage(), ilContentPageKioskModeView\render(), ilObjCourseGUI\renderObject(), ilInfoScreenGUI\saveProgress(), ilObjFileBasedLMGUI\setStartFile(), ilObjExerciseGUI\showOverviewObject(), ilObjFileGUI\toggleLearningProgress(), ilLMTracker\trackAccess(), ilObjContentPage\trackProgress(), ilObjFolderGUI\viewObject(), and ilObjGroupGUI\viewObject().

32  : bool {
34  $a_obj_type,
35  $a_ref_id,
36  $a_obj_id,
37  $a_user_id
38  );
39 
40  ilLPStatus::setInProgressIfNotAttempted($a_obj_id, $a_user_id);
41 
42  return true;
43  }
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 setInProgressIfNotAttempted(int $a_obj_id, int $a_user_id)
This function shoudl be clalled for normal "read events".
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: