ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLPStatusEvent Class Reference
+ Inheritance diagram for ilLPStatusEvent:
+ Collaboration diagram for ilLPStatusEvent:

Public Member Functions

 determineStatus (int $a_obj_id, int $a_usr_id, object $a_obj=null)
 
- Public Member Functions inherited from ilLPStatus
 __construct (int $a_obj_id)
 
 _updateStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) Learning progress: More...
 
 determinePercentage (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
 determineStatus (int $a_obj_id, int $a_usr_id, object $a_obj=null)
 
 refreshStatus (int $a_obj_id, ?array $a_users=null)
 Refresh status. More...
 

Static Public Member Functions

static _getNotAttempted (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
static _getCountInProgress (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCountCompleted (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _getCountFailed (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
static _getTypicalLearningTime (int $a_obj_id)
 
static checkStatusForObject (int $a_obj_id, ?array $a_users=null)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus (int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted (int $a_obj_id, int $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty (int $a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus (int $a_obj_id, int $a_user_id, bool $a_create=true)
 Lookup status. More...
 
static _lookupPercentage (int $a_obj_id, int $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted (int $a_obj_id, int $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged (int $a_obj_id, int $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData (array $a_obj_ids)
 
static getListGUIStatus (int $a_obj_id, bool $a_image_only=true)
 
static hasListGUIStatus (int $a_obj_id)
 

Static Protected Member Functions

static getMembers (int $a_obj_id, bool $a_is_crs_id=false)
 Get members for object. More...
 
- Static Protected Member Functions inherited from ilLPStatus
static raiseEvent (int $a_obj_id, int $a_usr_id, int $a_status, int $a_old_status, int $a_percentage)
 
static _lookupStatusForObject (int $a_obj_id, int $a_status, ?array $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects (int $a_user_id, array $a_obj_ids, int $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects (array $a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects (int $a_user_id, array $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
int $obj_id
 
ilDBInterface $db
 
ilObjectDataCache $ilObjDataCache
 

Detailed Description

Definition at line 30 of file class.ilLPStatusEvent.php.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusEvent::_getCompleted ( int  $a_obj_id)
static

Definition at line 71 of file class.ilLPStatusEvent.php.

References ilLPStatusWrapper\_getStatusInfo().

71  : array
72  {
73  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
74  return $status_info['participated_users'] ?: array();
75  }
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusEvent::_getInProgress ( int  $a_obj_id)
static

Definition at line 54 of file class.ilLPStatusEvent.php.

References ilLPStatusWrapper\_getStatusInfo().

54  : array
55  {
56  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
57 
58  // If registration is disabled in_progress is not available
59  if (!$status_info['registration']) {
60  return array();
61  }
62  // If event has occured in_progress is impossible
63  if ($status_info['starting_time'] < time()) {
64  return array();
65  }
66 
67  // Otherwise all users who registered will get the status in progress
68  return $status_info['registered_users'] ?: array();
69  }
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusEvent::_getNotAttempted ( int  $a_obj_id)
static

Definition at line 32 of file class.ilLPStatusEvent.php.

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

32  : array
33  {
34  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
35 
36  $users = array();
37 
38  $members = self::getMembers($status_info['crs_id'], true);
39  if ($members) {
40  // diff in progress and completed (use stored result in LPStatusWrapper)
41  $users = array_diff(
42  $members,
44  );
45  $users = array_diff(
46  $users,
48  );
49  }
50 
51  return $users;
52  }
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status &#39;completed&#39;.
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
static _getInProgress(int $a_obj_id)
Static function to read users who have the status &#39;in_progress&#39;.
+ Here is the call graph for this function:

◆ _getStatusInfo()

static ilLPStatusEvent::_getStatusInfo ( int  $a_obj_id)
static

Definition at line 77 of file class.ilLPStatusEvent.php.

References $GLOBALS, $id, $ref_id, ilObject\_getAllReferences(), ilEventParticipants\_getParticipated(), ilEventParticipants\_getRegistered(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilObjSession\_lookupRegistrationEnabled(), and ilObject\_lookupTitle().

77  : array
78  {
79  $tree = $GLOBALS['DIC']->repositoryTree();
80 
81  $references = ilObject::_getAllReferences($a_obj_id);
82  $ref_id = end($references);
83 
84  $member_ref_id = null;
85  if ($id = $tree->checkForParentType($ref_id, 'grp')) {
86  $member_ref_id = $id;
87  } elseif ($id = $tree->checkForParentType($ref_id, 'crs')) {
88  $member_ref_id = $id;
89  }
90 
91  $status_info = array();
92  $status_info['crs_id'] = ilObject::_lookupObjId($member_ref_id);
93  $status_info['registration'] = ilObjSession::_lookupRegistrationEnabled(
94  $a_obj_id
95  );
96  $status_info['title'] = ilObject::_lookupTitle($a_obj_id);
97  $status_info['description'] = ilObject::_lookupDescription($a_obj_id);
98 
99  $time_info = ilSessionAppointment::_lookupAppointment($a_obj_id);
100  $status_info['starting_time'] = $time_info['start'];
101  $status_info['ending_time'] = $time_info['end'];
102  $status_info['fullday'] = $time_info['fullday'];
103 
104  $status_info['registered_users'] = ilEventParticipants::_getRegistered(
105  $a_obj_id
106  );
107  $status_info['participated_users'] = ilEventParticipants::_getParticipated(
108  $a_obj_id
109  );
110 
111  return $status_info;
112  }
static _getParticipated(int $a_event_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupRegistrationEnabled(int $a_obj_id)
static _lookupObjId(int $ref_id)
static _lookupAppointment(int $a_obj_id)
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _lookupDescription(int $obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getRegistered(int $a_event_id)
+ Here is the call graph for this function:

◆ _lookupCompletedForObject()

static ilLPStatusEvent::_lookupCompletedForObject ( int  $a_obj_id,
?array  $a_user_ids = null 
)
static

Get completed users for object.

Definition at line 188 of file class.ilLPStatusEvent.php.

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

◆ _lookupFailedForObject()

static ilLPStatusEvent::_lookupFailedForObject ( int  $a_obj_id,
?array  $a_user_ids = null 
)
static

Get failed users for object.

Definition at line 208 of file class.ilLPStatusEvent.php.

211  : array {
212  return array();
213  }

◆ _lookupInProgressForObject()

static ilLPStatusEvent::_lookupInProgressForObject ( int  $a_obj_id,
?array  $a_user_ids = null 
)
static

Get in progress users for object.

Definition at line 218 of file class.ilLPStatusEvent.php.

221  : array {
222  if (!$a_user_ids) {
223  $a_user_ids = self::getMembers($a_obj_id);
224  if (!$a_user_ids) {
225  return array();
226  }
227  }
228  return self::_lookupStatusForObject(
229  $a_obj_id,
230  self::LP_STATUS_IN_PROGRESS_NUM,
231  $a_user_ids
232  );
233  }

◆ determineStatus()

ilLPStatusEvent::determineStatus ( int  $a_obj_id,
int  $a_usr_id,
object  $a_obj = null 
)

Definition at line 114 of file class.ilLPStatusEvent.php.

References $DIC, ilLPStatus\$ilObjDataCache, ilEventParticipants\_hasParticipated(), ilEventParticipants\_isRegistered(), ilSessionAppointment\_lookupAppointment(), and ilObjSession\_lookupRegistrationEnabled().

118  : int {
119  global $DIC;
120 
121  $ilObjDataCache = $DIC['ilObjDataCache'];
122 
123  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
124  switch ($this->ilObjDataCache->lookupType($a_obj_id)) {
125  case 'sess':
126 
128  $a_obj_id
129  );
131  $a_obj_id
132  );
133 
134  // If registration is disabled in_progress is not available
135  // If event has occured in_progress is impossible
136  if ($registration && $time_info['start'] >= time()) {
137  // is user registered -> in progress
139  $a_usr_id,
140  $a_obj_id
141  )) {
142  $status = self::LP_STATUS_IN_PROGRESS_NUM;
143  }
144  }
146  $a_usr_id,
147  $a_obj_id
148  )) {
149  $status = self::LP_STATUS_COMPLETED_NUM;
150  }
151  break;
152  }
153  return $status;
154  }
static _lookupRegistrationEnabled(int $a_obj_id)
static _hasParticipated(int $a_usr_id, int $a_event_id)
global $DIC
Definition: feed.php:28
static _lookupAppointment(int $a_obj_id)
static _isRegistered(int $a_usr_id, int $a_event_id)
ilObjectDataCache $ilObjDataCache
+ Here is the call graph for this function:

◆ getMembers()

static ilLPStatusEvent::getMembers ( int  $a_obj_id,
bool  $a_is_crs_id = false 
)
staticprotected

Get members for object.

Definition at line 159 of file class.ilLPStatusEvent.php.

References $GLOBALS, $id, $ref_id, ilObject\_getAllReferences(), ilObject\_lookupObjId(), and ilParticipants\getInstanceByObjId().

162  : array {
163  if (!$a_is_crs_id) {
164  $tree = $GLOBALS['DIC']->repositoryTree();
165  $references = ilObject::_getAllReferences($a_obj_id);
166  $ref_id = end($references);
167 
168  $member_ref_id = null;
169  if ($id = $tree->checkForParentType($ref_id, 'grp')) {
170  $member_ref_id = $id;
171  } elseif ($id = $tree->checkForParentType($ref_id, 'crs')) {
172  $member_ref_id = $id;
173  } else {
174  return [];
175  }
176  $member_obj_id = ilObject::_lookupObjId($member_ref_id);
177  } else {
178  $member_obj_id = $a_obj_id;
179  }
180 
181  $member_obj = ilParticipants::getInstanceByObjId($member_obj_id);
182  return $member_obj->getMembers();
183  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:67
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

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