ILIAS  Release_4_4_x_branch Revision 61816
 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_ref_id, $a_obj_type= '')
 _getProgress ($a_user_id, $a_obj_id)

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 61 of file class.ilLearningProgress.php.

References $row, ilChangeEvent\_lookupReadEvents(), IL_CAL_TIMESTAMP, and IL_CAL_UNIX.

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), and ilInfoScreenGUI\showLearningProgress().

{
require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
$events = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
include_once './Services/Calendar/classes/class.ilDateTime.php';
foreach($events as $row)
{
$tmp_date = new ilDateTime($row['last_access'],IL_CAL_UNIX);
$row['last_access'] = $tmp_date->get(IL_CAL_TIMESTAMP);
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 97 of file class.ilLearningProgress.php.

References $row, and ilChangeEvent\_lookupReadEvents().

Referenced by ilObjCourseGUI\fetchPrintMemberData(), 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_ref_id,
  $a_obj_type = '' 
)

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

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

Referenced by ilLMPresentationGUI\ilPage(), ilTestSessionDynamicQuestionSet\saveToDb(), ilTestSession\saveToDb(), ilObjFileBasedLMGUI\showLearningModule(), ilObjExerciseGUI\showOverviewObject(), ilObjCourseGUI\viewObject(), and ilObjGroupGUI\viewObject().

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

+ Here is the call graph for this function:

+ Here is the caller 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: