ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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=true)
 

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)

Reimplemented from ilLPStatus.

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

39 {
40 global $DIC;
41
42 $ilDB = $DIC['ilDB'];
43
44 parent::__construct($a_obj_id);
45 $this->db = $ilDB;
46 }
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, and $ilDB.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusExerciseReturned::_getCompleted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

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

References $ret, and ilExerciseMembers\_getPassedUsers().

+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusExerciseReturned::_getFailed (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

89 {
90 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
92 return $failed ? $failed : array();
93 }
$failed
Definition: Utf8Test.php:85
static _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()

static ilLPStatusExerciseReturned::_getInProgress (   $a_obj_id)
static

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';
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 // Exclude all non members
75 $users = array_intersect(self::getMembers($a_obj_id), (array) $users);
76 }
77
78 return $users;
79 }
$users
Definition: authpage.php:44
static lookupUsersInProgress($a_obj_id)
Lookup users in progress.
static _getReturned($a_obj_id)
Get returned status for all members (if they have anything returned for any assignment)
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'.

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

+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusExerciseReturned::_getNotAttempted (   $a_obj_id)
static

Reimplemented from ilLPStatus.

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

49 {
50 $users = array();
51
52 $members = self::getMembers($a_obj_id);
53 if ($members) {
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.
static _getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.

References $users, 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 148 of file class.ilLPStatusExerciseReturned.php.

149 {
150 if (!$a_user_ids) {
151 $a_user_ids = self::getMembers($a_obj_id);
152 if (!$a_user_ids) {
153 return array();
154 }
155 }
156 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
157 }
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 166 of file class.ilLPStatusExerciseReturned.php.

167 {
168 if (!$a_user_ids) {
169 $a_user_ids = self::getMembers($a_obj_id);
170 if (!$a_user_ids) {
171 return array();
172 }
173 }
174 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_FAILED_NUM, $a_user_ids);
175 }

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

185 {
186 if (!$a_user_ids) {
187 $a_user_ids = self::getMembers($a_obj_id);
188 if (!$a_user_ids) {
189 return array();
190 }
191 }
192 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
193 }

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

104 {
105 global $DIC;
106
107 $ilObjDataCache = $DIC['ilObjDataCache'];
108
110 switch ($ilObjDataCache->lookupType($a_obj_id)) {
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)) {
117 }
118 $ex_stat = ilExerciseMembers::_lookupStatus($a_obj_id, $a_user_id);
119 if ($ex_stat == "passed") {
121 }
122 if ($ex_stat == "failed") {
124 }
125 break;
126 }
127 return $status;
128 }
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)
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM

References $DIC, 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 135 of file class.ilLPStatusExerciseReturned.php.

136 {
137 include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
138 return ilExerciseMembers::_getMembers($a_obj_id);
139 }
static _getMembers($a_obj_id)

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:

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