ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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, &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 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_old_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
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 Attributes inherited from ilLPStatus
 $obj_id = null
 
 $db = null
 

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 $DIC, $ilDB, and ILIAS\GlobalScreen\Provider\__construct().

39  {
40  global $DIC;
41 
42  $ilDB = $DIC['ilDB'];
43 
44  parent::__construct($a_obj_id);
45  $this->db = $ilDB;
46  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ _getCompleted()

static ilLPStatusExerciseReturned::_getCompleted (   $a_obj_id)
static

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

References $ret, and ilExerciseMembers\_getPassedUsers().

81  {
83  return $ret ? $ret : array();
84  }
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, and ilExerciseMembers\_getFailedUsers().

87  {
89  return $failed ? $failed : array();
90  }
static _getFailedUsers($a_obj_id)
Get all users that failed the exercise.
$failed
Definition: Utf8Test.php:85
+ 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(), and ilChangeEvent\lookupUsersInProgress().

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

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

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 _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'.
+ 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 143 of file class.ilLPStatusExerciseReturned.php.

144  {
145  if (!$a_user_ids) {
146  $a_user_ids = self::getMembers($a_obj_id);
147  if (!$a_user_ids) {
148  return array();
149  }
150  }
151  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
152  }

◆ _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 161 of file class.ilLPStatusExerciseReturned.php.

162  {
163  if (!$a_user_ids) {
164  $a_user_ids = self::getMembers($a_obj_id);
165  if (!$a_user_ids) {
166  return array();
167  }
168  }
169  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_FAILED_NUM, $a_user_ids);
170  }

◆ _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 179 of file class.ilLPStatusExerciseReturned.php.

180  {
181  if (!$a_user_ids) {
182  $a_user_ids = self::getMembers($a_obj_id);
183  if (!$a_user_ids) {
184  return array();
185  }
186  }
187  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
188  }

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

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

101  {
102  global $DIC;
103 
104  $ilObjDataCache = $DIC['ilObjDataCache'];
105 
106  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
107  switch ($ilObjDataCache->lookupType($a_obj_id)) {
108  case 'exc':
109  include_once './Services/Tracking/classes/class.ilChangeEvent.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)
global $DIC
Definition: goto.php:24
+ 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  return ilExerciseMembers::_getMembers($a_obj_id);
134  }
static _getMembers($a_obj_id)
+ Here is the call graph for this function:

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