ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilLPStatusTypicalLearningTime Class Reference
+ Inheritance diagram for ilLPStatusTypicalLearningTime:
+ Collaboration diagram for ilLPStatusTypicalLearningTime:

Public Member Functions

 ilLPStatusTypicalLearningTime ($a_obj_id)
 
 _getInProgress ($a_obj_id)
 
 _getCompleted ($a_obj_id)
 
 _getStatusInfo ($a_obj_id)
 
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status. More...
 
 determinePercentage ($a_obj_id, $a_user_id, $a_obj=null)
 Determine percentage. More...
 
- Public Member Functions inherited from ilLPStatus
 ilLPStatus ($a_obj_id)
 
 _getCountNotAttempted ($a_obj_id)
 
 _getNotAttempted ($a_obj_id)
 
 _getCountInProgress ($a_obj_id)
 
 _getInProgress ($a_obj_id)
 
 _getCountCompleted ($a_obj_id)
 
 _getCompleted ($a_obj_id)
 
 _getFailed ($a_obj_id)
 
 _getCountFailed ()
 
 _getStatusInfo ($a_obj_id)
 
 _getTypicalLearningTime ($a_obj_id)
 
 _updateStatus ($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) More...
 
 determinePercentage ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine percentage. More...
 
 determineStatus ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine status. More...
 
 refreshStatus ($a_obj_id, $a_users=null)
 Refresh status. More...
 
 _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLPStatus
static checkStatusForObject ($a_obj_id, $a_users=false)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus ($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted ($a_obj_id, $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty ($a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus ($a_obj_id, $a_user_id, $a_create=true)
 Lookup status. More...
 
static _lookupPercentage ($a_obj_id, $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted ($a_obj_id, $a_user_id)
 Lookup user object completion. More...
 
static _lookupCompletedForObject ($a_obj_id, $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject ($a_obj_id, $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject ($a_obj_id, $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData ($a_obj_ids)
 
static getListGUIStatus ($a_obj_id)
 
- Data Fields inherited from ilLPStatus
 $obj_id = null
 
 $db = null
 
const LP_STATUS_NOT_ATTEMPTED = 'trac_no_attempted'
 
const LP_STATUS_IN_PROGRESS = 'trac_in_progress'
 
const LP_STATUS_COMPLETED = 'trac_completed'
 
const LP_STATUS_FAILED = 'trac_failed'
 
const LP_STATUS_NOT_ATTEMPTED_NUM = 0
 
const LP_STATUS_IN_PROGRESS_NUM = 1
 
const LP_STATUS_COMPLETED_NUM = 2
 
const LP_STATUS_FAILED_NUM = 3
 
const LP_STATUS_REGISTERED = 'trac_registered'
 
const LP_STATUS_NOT_REGISTERED = 'trac_not_registered'
 
const LP_STATUS_PARTICIPATED = 'trac_participated'
 
const LP_STATUS_NOT_PARTICIPATED = 'trac_not_participated'
 
- Static Public Attributes inherited from ilLPStatus
static $list_gui_cache
 
- Protected Member Functions inherited from ilLPStatus
 raiseEvent ($a_obj_id, $a_usr_id, $a_status, $a_percentage)
 
- Static Protected Member Functions inherited from ilLPStatus
static _lookupStatusForObject ($a_obj_id, $a_status, $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects ($a_user_id, $a_obj_ids, $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects ($a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects ($a_user_id, $a_obj_ids)
 Get LP status for given objects (and user) More...
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 16 of file class.ilLPStatusTypicalLearningTime.php.

Member Function Documentation

◆ _getCompleted()

ilLPStatusTypicalLearningTime::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 47 of file class.ilLPStatusTypicalLearningTime.php.

48 {
49 global $ilDB;
50
51 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
52 $tlt = $status_info['tlt'];
53
54 // TODO: move to status info
55 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
56 $all = ilChangeEvent::_lookupReadEvents($a_obj_id);
57
58 foreach($all as $event)
59 {
60 if($event['spent_seconds'] >= $tlt)
61 {
62 $user_ids[] = $event['usr_id'];
63 }
64 }
65 return $user_ids ? $user_ids : array();
66 }
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object which happened after the last time the user caught ...
_getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
global $ilDB

References $ilDB, ilLPStatusWrapper\_getStatusInfo(), and ilChangeEvent\_lookupReadEvents().

+ Here is the call graph for this function:

◆ _getInProgress()

ilLPStatusTypicalLearningTime::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

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

28 {
29 global $ilDB;
30
31 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
32 $tlt = $status_info['tlt'];
33
34 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
35 $all = ilChangeEvent::_lookupReadEvents($a_obj_id);
36
37 foreach($all as $event)
38 {
39 if($event['spent_seconds'] < $tlt)
40 {
41 $user_ids[] = $event['usr_id'];
42 }
43 }
44 return $user_ids ? $user_ids : array();
45 }

References $ilDB, ilLPStatusWrapper\_getStatusInfo(), and ilChangeEvent\_lookupReadEvents().

+ Here is the call graph for this function:

◆ _getStatusInfo()

ilLPStatusTypicalLearningTime::_getStatusInfo (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 68 of file class.ilLPStatusTypicalLearningTime.php.

69 {
70 $status_info['tlt'] = ilMDEducational::_getTypicalLearningTimeSeconds($a_obj_id);
71
72 return $status_info;
73 }
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)

References ilMDEducational\_getTypicalLearningTimeSeconds().

+ Here is the call graph for this function:

◆ determinePercentage()

ilLPStatusTypicalLearningTime::determinePercentage (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine percentage.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer percentage

Reimplemented from ilLPStatus.

Definition at line 119 of file class.ilLPStatusTypicalLearningTime.php.

120 {
122 $re = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
123 $spent = (int) $re[0]["spent_seconds"];
124
125 if ($tlt > 0)
126 {
127 $per = min(100, 100 / $tlt * $spent);
128 }
129 else
130 {
131 $per = 100;
132 }
133
134 return $per;
135 }

References ilMDEducational\_getTypicalLearningTimeSeconds(), and ilChangeEvent\_lookupReadEvents().

+ Here is the call graph for this function:

◆ determineStatus()

ilLPStatusTypicalLearningTime::determineStatus (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine status.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer status

Reimplemented from ilLPStatus.

Definition at line 83 of file class.ilLPStatusTypicalLearningTime.php.

84 {
85 global $ilObjDataCache, $ilDB;
86
88 switch ($ilObjDataCache->lookupType($a_obj_id))
89 {
90 case 'lm':
91 if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id))
92 {
94
95 // completed?
96 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
97 $tlt = $status_info['tlt'];
98
99 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
100 $re = ilChangeEvent::_lookupReadEvents($a_obj_id, $a_user_id);
101 if ($re[0]['spent_seconds'] >= $tlt)
102 {
104 }
105 }
106 break;
107 }
108 return $status;
109 }
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM

References $ilDB, ilLPStatusWrapper\_getStatusInfo(), ilChangeEvent\_lookupReadEvents(), ilChangeEvent\hasAccessed(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

+ Here is the call graph for this function:

◆ ilLPStatusTypicalLearningTime()

ilLPStatusTypicalLearningTime::ilLPStatusTypicalLearningTime (   $a_obj_id)

Definition at line 19 of file class.ilLPStatusTypicalLearningTime.php.

20 {
21 global $ilDB;
22
23 parent::ilLPStatus($a_obj_id);
24 $this->db =& $ilDB;
25 }

References $ilDB.


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