ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $a_image_only=false)
 

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

References $ilDB.

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

Member Function Documentation

◆ _getCompleted()

static ilLPStatusExerciseReturned::_getCompleted (   $a_obj_id)
static

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

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

80  {
81  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
83  return $ret ? $ret : array();
84  }
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 86 of file class.ilLPStatusExerciseReturned.php.

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

87  {
88  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
90  return $failed ? $failed : array();
91  }
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 60 of file class.ilLPStatusExerciseReturned.php.

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

61  {
62  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
63  include_once './Services/Tracking/classes/class.ilChangeEvent.php';
65  $all = ilChangeEvent::lookupUsersInProgress($a_obj_id);
66  $users = $users + $all;
67 
68  $users = array_diff($users, ilLPStatusWrapper::_getCompleted($a_obj_id));
69  $users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
70 
71  if ($users) {
72  // Exclude all non members
73  $users = array_intersect(self::getMembers($a_obj_id), (array) $users);
74  }
75 
76  return $users;
77  }
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.
$users
Definition: authpage.php:44
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 46 of file class.ilLPStatusExerciseReturned.php.

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

47  {
48  $users = array();
49 
50  $members = self::getMembers($a_obj_id);
51  if ($members) {
52  $users = array_diff($members, ilLPStatusWrapper::_getInProgress($a_obj_id));
53  $users = array_diff($users, ilLPStatusWrapper::_getCompleted($a_obj_id));
54  $users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
55  }
56 
57  return $users;
58  }
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.
$users
Definition: authpage.php:44
+ 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 144 of file class.ilLPStatusExerciseReturned.php.

References array.

145  {
146  if (!$a_user_ids) {
147  $a_user_ids = self::getMembers($a_obj_id);
148  if (!$a_user_ids) {
149  return array();
150  }
151  }
152  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
153  }
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 162 of file class.ilLPStatusExerciseReturned.php.

References array.

163  {
164  if (!$a_user_ids) {
165  $a_user_ids = self::getMembers($a_obj_id);
166  if (!$a_user_ids) {
167  return array();
168  }
169  }
170  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_FAILED_NUM, $a_user_ids);
171  }
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 180 of file class.ilLPStatusExerciseReturned.php.

References array.

181  {
182  if (!$a_user_ids) {
183  $a_user_ids = self::getMembers($a_obj_id);
184  if (!$a_user_ids) {
185  return array();
186  }
187  }
188  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
189  }
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 101 of file class.ilLPStatusExerciseReturned.php.

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

102  {
103  global $ilObjDataCache;
104 
105  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
106  switch ($ilObjDataCache->lookupType($a_obj_id)) {
107  case 'exc':
108  include_once './Services/Tracking/classes/class.ilChangeEvent.php';
109  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
110  if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id) ||
111  ilExerciseMembers::_hasReturned($a_obj_id, $a_user_id)) {
112  $status = self::LP_STATUS_IN_PROGRESS_NUM;
113  }
114  $ex_stat = ilExerciseMembers::_lookupStatus($a_obj_id, $a_user_id);
115  if ($ex_stat == "passed") {
116  $status = self::LP_STATUS_COMPLETED_NUM;
117  }
118  if ($ex_stat == "failed") {
119  $status = self::LP_STATUS_FAILED_NUM;
120  }
121  break;
122  }
123  return $status;
124  }
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 131 of file class.ilLPStatusExerciseReturned.php.

References ilExerciseMembers\_getMembers().

132  {
133  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
134  return ilExerciseMembers::_getMembers($a_obj_id);
135  }
static _getMembers($a_obj_id)
+ Here is the call graph for this function:

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