ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 30 of file class.ilLearningProgress.php.

Member Function Documentation

◆ _getProgress()

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

Definition at line 51 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().

51  : array
52  {
53  $events = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
54 
55  $progress = [];
56  foreach ($events as $row) {
57  $tmp_date = new ilDateTime($row['last_access'], IL_CAL_UNIX);
58  $row['last_access'] = $tmp_date->get(IL_CAL_UNIX);
59 
60  $tmp_date = new ilDateTime($row['first_access'], IL_CAL_DATETIME);
61  $row['first_access'] = $tmp_date->get(IL_CAL_UNIX);
62 
63  if ($progress) {
64  $progress['spent_seconds'] += (int) $row['spent_seconds'];
65  $progress['access_time'] = max(
66  $progress['access_time'],
67  (int) $row['last_access']
68  );
69  $progress['access_time_min'] = min(
70  $progress['access_time_min'],
71  (int) $row['first_access']
72  );
73  } else {
74  $progress['obj_id'] = (int) $row['obj_id'];
75  $progress['user_id'] = (int) $row['usr_id'];
76  $progress['spent_seconds'] = (int) $row['spent_seconds'];
77  $progress['access_time'] = (int) $row['last_access'];
78  $progress['access_time_min'] = (int) $row['first_access'];
79  $progress['visits'] = (int) $row['read_count'];
80  }
81  }
82  return $progress;
83  }
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 88 of file class.ilLearningProgress.php.

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

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

88  : array
89  {
90  $progress = [];
91  foreach (ilChangeEvent::_lookupReadEvents($a_obj_id) as $row) {
92  if (isset($progress[$row['usr_id']])) {
93  $progress[$row['usr_id']]['spent_seconds'] += (int) $row['spent_seconds'];
94  $progress[$row['usr_id']]['read_count'] += (int) $row['read_count'];
95  $progress[$row['usr_id']]['ts'] = max(
96  (int) $row['last_access'],
97  (int) $progress[$row['usr_id']]['ts']
98  );
99  } else {
100  $progress[$row['usr_id']]['spent_seconds'] = (int) $row['spent_seconds'];
101  $progress[$row['usr_id']]['read_count'] = (int) $row['read_count'];
102  $progress[$row['usr_id']]['ts'] = (int) $row['last_access'];
103  }
104  $progress[$row['usr_id']]['usr_id'] = (int) $row['usr_id'];
105  $progress[$row['usr_id']]['obj_id'] = (int) $row['obj_id'];
106  }
107  return $progress;
108  }
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 33 of file class.ilLearningProgress.php.

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

Referenced by ilObjExerciseGUI\addLocatorItems(), ilObjGroupGUI\executeCommand(), ilObjCourseGUI\executeCommand(), ilSurveyExecutionGUI\outSurveyPage(), ilContentPageKioskModeView\render(), ilObjCourseGUI\renderObject(), ilInfoScreenGUI\saveProgress(), ilTestSessionDynamicQuestionSet\saveToDb(), ilObjFileBasedLMGUI\showLearningModule(), ilLMTracker\trackAccess(), ilObjContentPage\trackProgress(), ilObjFolderGUI\viewObject(), and ilObjGroupGUI\viewObject().

38  : bool {
40  $a_obj_type,
41  $a_ref_id,
42  $a_obj_id,
43  $a_user_id
44  );
45 
46  ilLPStatus::setInProgressIfNotAttempted($a_obj_id, $a_user_id);
47 
48  return true;
49  }
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: