ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLPStatusExerciseReturned Class Reference
+ Inheritance diagram for ilLPStatusExerciseReturned:
+ Collaboration diagram for ilLPStatusExerciseReturned:

Public Member Functions

 __construct ($a_obj_id)
 
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status. More...
 
- Public Member Functions inherited from ilLPStatus
 __construct ($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...
 

Static Public Member Functions

static _getNotAttempted ($a_obj_id)
 
static _getInProgress ($a_obj_id)
 
static _getCompleted ($a_obj_id)
 
static _getFailed ($a_obj_id)
 
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 _getCountNotAttempted ($a_obj_id)
 
static _getNotAttempted ($a_obj_id)
 
static _getCountInProgress ($a_obj_id)
 
static _getInProgress ($a_obj_id)
 
static _getCountCompleted ($a_obj_id)
 
static _getCompleted ($a_obj_id)
 
static _getFailed ($a_obj_id)
 
static _getCountFailed ()
 
static _getStatusInfo ($a_obj_id)
 
static _getTypicalLearningTime ($a_obj_id)
 
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 _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed. 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 raiseEvent ($a_obj_id, $a_usr_id, $a_status, $a_percentage)
 
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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLPStatusExerciseReturned::__construct (   $a_obj_id)

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

References $ilDB.

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

Member Function Documentation

◆ _getCompleted()

static ilLPStatusExerciseReturned::_getCompleted (   $a_obj_id)
static

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

References $ret, ilExerciseMembers\_getPassedUsers(), and array.

83  {
84  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
86  return $ret ? $ret : array();
87  }
Create styles array
The data for the language used.
static _getPassedUsers($a_obj_id)
Get all users that passed the exercise.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusExerciseReturned::_getFailed (   $a_obj_id)
static

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

References $failed, ilExerciseMembers\_getFailedUsers(), and array.

90  {
91  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
93  return $failed ? $failed : array();
94  }
static _getFailedUsers($a_obj_id)
Get all users that failed the exercise.
$failed
Definition: Utf8Test.php:85
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusExerciseReturned::_getInProgress (   $a_obj_id)
static

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

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

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);
67  $all = ilChangeEvent::lookupUsersInProgress($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 _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getReturned($a_obj_id)
Get returned status for all members (if they have anything returned for any assignment) ...
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
Create styles array
The data for the language used.
static lookupUsersInProgress($a_obj_id)
Lookup users in progress.
+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusExerciseReturned::_getNotAttempted (   $a_obj_id)
static

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

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

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 _getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
Create styles array
The data for the language used.
+ 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

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

References array.

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  }
Create styles array
The data for the language used.

◆ _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

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

References array.

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  }
Create styles array
The data for the language used.

◆ _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

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

References array.

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  }
Create styles array
The data for the language used.

◆ 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

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

References ilExerciseMembers\_hasReturned(), ilExerciseMembers\_lookupStatus(), and ilChangeEvent\hasAccessed().

105  {
106  global $ilObjDataCache;
107 
108  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
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  {
117  $status = self::LP_STATUS_IN_PROGRESS_NUM;
118  }
119  $ex_stat = ilExerciseMembers::_lookupStatus($a_obj_id, $a_user_id);
120  if ($ex_stat == "passed")
121  {
122  $status = self::LP_STATUS_COMPLETED_NUM;
123  }
124  if ($ex_stat == "failed")
125  {
126  $status = self::LP_STATUS_FAILED_NUM;
127  }
128  break;
129  }
130  return $status;
131  }
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
static _hasReturned($a_obj_id, $a_user_id)
Has user returned anything in any assignment?
static _lookupStatus($a_obj_id, $a_user_id)
Lookup current status (notgraded|passed|failed)
+ 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.

References ilExerciseMembers\_getMembers().

139  {
140  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
141  return ilExerciseMembers::_getMembers($a_obj_id);
142  }
static _getMembers($a_obj_id)
+ Here is the call graph for this function:

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