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

Public Member Functions

 ilLPStatusVisits ($a_obj_id)
 
 _getNotAttempted ($a_obj_id)
 
 _getInProgress ($a_obj_id)
 
 _getCompleted ($a_obj_id)
 
 _getFailed ($a_obj_id)
 
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status. 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...
 

Static Public Member Functions

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 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)
 

Static Protected Member Functions

static getMembers ($a_obj_id)
 Get members for object. More...
 
- 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...
 

Additional Inherited Members

- 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)
 

Detailed Description

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

Member Function Documentation

◆ _getCompleted()

ilLPStatusExerciseReturned::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

83 {
84 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
86 return $ret ? $ret : array();
87 }
_getPassedUsers($a_obj_id)
Get all users that passed the exercise.

References $ret, and ilExerciseMembers\_getPassedUsers().

+ Here is the call graph for this function:

◆ _getFailed()

ilLPStatusExerciseReturned::_getFailed (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 89 of file class.ilLPStatusExerciseReturned.php.

90 {
91 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
93 return $failed ? $failed : array();
94 }
$failed
Definition: Utf8Test.php:86
_getFailedUsers($a_obj_id)
Get all users that failed the exercise.

References $failed, and ilExerciseMembers\_getFailedUsers().

+ Here is the call graph for this function:

◆ _getInProgress()

ilLPStatusExerciseReturned::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 62 of file class.ilLPStatusExerciseReturned.php.

63 {
64 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
65 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
66 $users = ilExerciseMembers::_getReturned($a_obj_id);
68 $users = $users + $all;
69
70 $users = array_diff($users, ilLPStatusWrapper::_getCompleted($a_obj_id));
71 $users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
72
73 if($users)
74 {
75 // Exclude all non members
76 $users = array_intersect(self::getMembers($a_obj_id), (array)$users);
77 }
78
79 return $users;
80 }
static lookupUsersInProgress($a_obj_id)
Lookup users in progress.
_getReturned($a_obj_id)
Get returned status for all members (if they have anything returned for any assignment)
_getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
_getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilExerciseMembers\_getReturned(), and ilChangeEvent\lookupUsersInProgress().

+ Here is the call graph for this function:

◆ _getNotAttempted()

ilLPStatusExerciseReturned::_getNotAttempted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

48 {
49 $users = array();
50
51 $members = self::getMembers($a_obj_id);
52 if($members)
53 {
54 $users = array_diff($members, ilLPStatusWrapper::_getInProgress($a_obj_id));
55 $users = array_diff($users, ilLPStatusWrapper::_getCompleted($a_obj_id));
56 $users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
57 }
58
59 return $users;
60 }
static getMembers($a_obj_id)
Get members for object.
_getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), and getMembers().

+ Here is the call graph for this function:

◆ _lookupCompletedForObject()

static ilLPStatusExerciseReturned::_lookupCompletedForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get completed users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Reimplemented from ilLPStatus.

Definition at line 151 of file class.ilLPStatusExerciseReturned.php.

152 {
153 if(!$a_user_ids)
154 {
155 $a_user_ids = self::getMembers($a_obj_id);
156 if(!$a_user_ids)
157 {
158 return array();
159 }
160 }
161 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
162 }
static _lookupStatusForObject($a_obj_id, $a_status, $a_user_ids=null)
Get users with given status for object.

References ilLPStatus\_lookupStatusForObject(), and getMembers().

+ Here is the call graph for this function:

◆ _lookupFailedForObject()

static ilLPStatusExerciseReturned::_lookupFailedForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get failed users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Reimplemented from ilLPStatus.

Definition at line 171 of file class.ilLPStatusExerciseReturned.php.

172 {
173 if(!$a_user_ids)
174 {
175 $a_user_ids = self::getMembers($a_obj_id);
176 if(!$a_user_ids)
177 {
178 return array();
179 }
180 }
181 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_FAILED_NUM, $a_user_ids);
182 }

References ilLPStatus\_lookupStatusForObject(), and getMembers().

+ Here is the call graph for this function:

◆ _lookupInProgressForObject()

static ilLPStatusExerciseReturned::_lookupInProgressForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get in progress users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Reimplemented from ilLPStatus.

Definition at line 191 of file class.ilLPStatusExerciseReturned.php.

192 {
193 if(!$a_user_ids)
194 {
195 $a_user_ids = self::getMembers($a_obj_id);
196 if(!$a_user_ids)
197 {
198 return array();
199 }
200 }
201 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
202 }

References ilLPStatus\_lookupStatusForObject(), and getMembers().

+ Here is the call graph for this function:

◆ determineStatus()

ilLPStatusExerciseReturned::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 104 of file class.ilLPStatusExerciseReturned.php.

105 {
106 global $ilObjDataCache;
107
109 switch ($ilObjDataCache->lookupType($a_obj_id))
110 {
111 case 'exc':
112 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
113 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
114 if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id) ||
115 ilExerciseMembers::_hasReturned($a_obj_id, $a_user_id))
116 {
118 }
119 $ex_stat = ilExerciseMembers::_lookupStatus($a_obj_id, $a_user_id);
120 if ($ex_stat == "passed")
121 {
123 }
124 if ($ex_stat == "failed")
125 {
127 }
128 break;
129 }
130 return $status;
131 }
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
_hasReturned($a_obj_id, $a_user_id)
Has user returned anything in any assignment?
_lookupStatus($a_obj_id, $a_user_id)
Lookup current status (notgraded|passed|failed)
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM

References ilExerciseMembers\_hasReturned(), ilExerciseMembers\_lookupStatus(), ilChangeEvent\hasAccessed(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

+ Here is the call graph for this function:

◆ getMembers()

static ilLPStatusExerciseReturned::getMembers (   $a_obj_id)
staticprotected

Get members for object.

Parameters
int$a_obj_id
Returns
array

Definition at line 138 of file class.ilLPStatusExerciseReturned.php.

139 {
140 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
141 return ilExerciseMembers::_getMembers($a_obj_id);
142 }

References ilExerciseMembers\_getMembers().

Referenced by _getNotAttempted(), _lookupCompletedForObject(), _lookupFailedForObject(), and _lookupInProgressForObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilLPStatusVisits()

ilLPStatusExerciseReturned::ilLPStatusVisits (   $a_obj_id)

Definition at line 39 of file class.ilLPStatusExerciseReturned.php.

40 {
41 global $ilDB;
42
43 parent::ilLPStatus($a_obj_id);
44 $this->db =& $ilDB;
45 }
global $ilDB

References $ilDB.


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