ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLearningProgress Class Reference
+ Collaboration diagram for ilLearningProgress:

Public Member Functions

 ilLearningProgress ()
 _tracProgress ($a_user_id, $a_obj_id, $a_obj_type= '')
 _getProgress ($a_user_id, $a_obj_id)
 _updateProgress ($data)

Static Public Member Functions

static _lookupProgressByObjId ($a_obj_id)
 lookup progress for a specific object

Data Fields

 $db = null

Detailed Description

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

Member Function Documentation

ilLearningProgress::_getProgress (   $a_user_id,
  $a_obj_id 
)

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

References ilChangeEvent\_lookupReadEvents().

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), ilLPObjectItemListGUI\__readUserStatusInfo(), ilLPItemListGUI\renderObjectInfoXML(), and ilInfoScreenGUI\showLearningProgress().

{
require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
$events = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
foreach($events as $row)
{
if ($progress)
{
$progress['spent_seconds'] += $row['spent_seconds'];
$progress['access_time'] = max($progress['access_time'], $row['last_access']);
}
else
{
$progress['obj_id'] = $row['obj_id'];
$progress['user_id'] = $row['usr_id'];
$progress['spent_seconds'] = $row['spent_seconds'];
$progress['access_time'] = $row['last_access'];
$progress['visits'] = $row['read_count'];
}
}
return $progress ? $progress : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLearningProgress::_lookupProgressByObjId (   $a_obj_id)
static

lookup progress for a specific object

public

Parameters
intobj_id
Returns
array of progress data

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

References ilChangeEvent\_lookupReadEvents().

Referenced by ilObjCourseGUI\fetchPrintMemberData(), ilObjCourseGUI\printMembersObject(), ilObjGroupGUI\readMemberData(), and ilObjCourseGUI\readMemberData().

{
include_once('./Services/Tracking/classes/class.ilChangeEvent.php');
foreach(ilChangeEvent::_lookupReadEvents($a_obj_id) as $row)
{
if(isset($progress[$row['usr_id']]))
{
$progress[$row['usr_id']]['spent_seconds'] += $row['spent_seconds'];
$progress[$row['usr_id']]['read_count'] += $row['read_count'];
$progress[$row['usr_id']]['ts'] = max($row['last_access'],$progress[$row['usr_id']]['ts']);
}
else
{
$progress[$row['usr_id']]['spent_seconds'] = $row['spent_seconds'];
$progress[$row['usr_id']]['read_count'] = $row['read_count'];
$progress[$row['usr_id']]['ts'] = $row['last_access'];
}
$progress[$row['usr_id']]['usr_id'] = $row['usr_id'];
$progress[$row['usr_id']]['obj_id'] = $row['obj_id'];
}
return $progress ? $progress : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLearningProgress::_tracProgress (   $a_user_id,
  $a_obj_id,
  $a_obj_type = '' 
)

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

References ilChangeEvent\_recordReadEvent().

Referenced by ilTracking\_trackAccess(), ilObjExerciseGUI\viewObject(), ilObjGroupGUI\viewObject(), and ilObjCourseGUI\viewObject().

{
global $ilDB;
require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
ilChangeEvent::_recordReadEvent($a_obj_id, $a_user_id);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLearningProgress::_updateProgress (   $data)

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

References $data, and ilChangeEvent\_recordReadEvent().

{
require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
}

+ Here is the call graph for this function:

ilLearningProgress::ilLearningProgress ( )

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

{
global $ilDB;
$this->db = $ilDB;
}

Field Documentation

ilLearningProgress::$db = null

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


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