33 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
34 include_once
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
43 parent::__construct($a_obj_id);
51 $members = self::getMembers($a_obj_id);
65 include_once
'./Services/Tracking/classes/class.ilChangeEvent.php';
68 include_once
'./Services/Object/classes/class.ilObjectLP.php';
70 $collection = $olp->getCollectionInstance();
73 foreach($collection->getItems() as $item_id)
91 $users = array_intersect(self::getMembers($a_obj_id), (
array)$users);
106 global $ilObjDataCache;
108 include_once
'./Services/Object/classes/class.ilObjectLP.php';
110 $collection = $olp->getCollectionInstance();
113 $grouped_items = $collection->getGroupedItemsForLPStatus();
115 if(!
sizeof($grouped_items))
125 foreach($grouped_items as $grouping_id => $grouping)
127 $isGrouping = $grouping_id ? true :
false;
128 $grouping_completed =
array();
129 $grouping_completed_users_num =
array();
130 foreach((
array) $grouping[
'items'] as $item)
132 $item_id = $ilObjDataCache->lookupObjId($item);
137 foreach($tmp_users as $tmp_user_id)
139 ++$grouping_completed_users_num[$tmp_user_id];
150 $users = array_intersect($users,$tmp_users);
158 foreach($grouping_completed_users_num as $tmp_user_id => $grouping_num_completed)
160 if($grouping_num_completed >= $grouping[
'num_obligatory'])
162 $grouping_completed[] = $tmp_user_id;
169 $users = $grouping_completed;
173 $users = array_intersect($users,$grouping_completed);
184 $users = array_intersect(self::getMembers($a_obj_id), (
array)$users);
187 return (
array) $users;
192 global $ilObjDataCache;
196 include_once
'./Services/Object/classes/class.ilObjectLP.php';
198 $collection = $olp->getCollectionInstance();
201 foreach($collection->getGroupedItemsForLPStatus() as $grouping_id => $grouping)
203 $isGrouping = $grouping_id ? true :
false;
205 $gr_failed =
array();
206 $gr_failed_users_num =
array();
208 foreach((
array) $grouping[
'items'] as $item)
210 $item_id = $ilObjDataCache->lookupObjId($item);
215 foreach($tmp_users as $tmp_user_id)
217 ++$gr_failed_users_num[$tmp_user_id];
223 $gr_failed = array_merge($gr_failed,$tmp_users);
229 $allowed_failed = count($grouping[
'items']) - $grouping[
'num_obligatory'];
231 foreach($gr_failed_users_num as $tmp_user_id => $num_failed)
233 if($num_failed > $allowed_failed)
235 $gr_failed[] = $tmp_user_id;
240 $users = array_unique(array_merge($users, $gr_failed));
247 $users = array_intersect(self::getMembers($a_obj_id), (
array)$users);
250 return array_unique($users);
255 $status_info =
array();
257 include_once
'./Services/Object/classes/class.ilObjectLP.php';
259 $collection = $olp->getCollectionInstance();
262 $status_info[
'collections'] = $collection->getItems();
263 $status_info[
'num_collections'] = count($status_info[
'collections']);
271 global $ilObjDataCache;
273 if($ilObjDataCache->lookupType($a_obj_id) ==
'sahs')
275 return parent::_getTypicalLearningTime($a_obj_id);
280 foreach($status_info[
'collections'] as $item)
297 global $ilObjDataCache;
299 $status[
'completed'] =
true;
300 $status[
'failed'] =
false;
301 $status[
'in_progress'] =
false;
303 switch ($ilObjDataCache->lookupType($a_obj_id))
308 include_once
"./Services/Tracking/classes/class.ilChangeEvent.php";
311 $status[
'in_progress'] =
true;
314 include_once
'./Services/Object/classes/class.ilObjectLP.php';
316 $collection = $olp->getCollectionInstance();
319 $grouped_items = $collection->getGroupedItemsForLPStatus();
321 if(!
sizeof($grouped_items))
324 $status[
'completed'] =
false;
328 foreach($grouped_items as $grouping_id => $grouping)
330 $isGrouping = $grouping_id ? true :
false;
331 $status = self::determineGroupingStatus($status,$grouping,$a_user_id,$isGrouping);
335 if($status[
'completed'])
337 return self::LP_STATUS_COMPLETED_NUM;
339 if($status[
'failed'])
341 return self::LP_STATUS_FAILED_NUM;
343 if($status[
'in_progress'])
345 return self::LP_STATUS_IN_PROGRESS_NUM;
349 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
363 global $ilObjDataCache;
365 $items = $gr_info[
'items'];
368 $max_allowed_failed = count($items) - $gr_info[
'num_obligatory'];
369 $required_completed = $gr_info[
'num_obligatory'];
373 $max_allowed_failed = 0;
374 $required_completed = count($items);
381 foreach($items as $item_id)
383 $item_id = $ilObjDataCache->lookupObjId($item_id);
386 if($gr_status == self::LP_STATUS_FAILED_NUM)
388 if(++$num_failed > $max_allowed_failed)
390 $status[
'failed'] =
true;
391 $status[
'completed'] =
false;
395 if($gr_status == self::LP_STATUS_COMPLETED_NUM)
397 if(++$num_completed >= $required_completed)
404 $status[
'completed'] =
false;
415 global $ilObjDataCache, $tree;
417 switch($ilObjDataCache->lookupType($a_obj_id))
420 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
422 return $member_obj->getMembers();
425 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
427 return $member_obj->getMembers();
431 $folder_ref_id = current($folder_ref_ids);
432 if($crs_id = $tree->checkForParentType($folder_ref_id,
'crs'))
434 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
436 return $member_obj->getMembers();
455 $a_user_ids = self::getMembers($a_obj_id);
461 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
475 $a_user_ids = self::getMembers($a_obj_id);
481 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_FAILED_NUM, $a_user_ids);
495 $a_user_ids = self::getMembers($a_obj_id);
501 return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
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 determineGroupingStatus($status, $gr_info, $user_id, $is_grouping)
Determine grouping status $ilObjDataCache.
static getMembers($a_obj_id)
Get members for object.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getNotAttempted($a_obj_id)
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Determine status.
static _getAllReferences($a_id)
get all reference ids of object
static _getFailed($a_obj_id)
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getTypicalLearningTime($a_obj_id)
static _getStatusInfo($a_obj_id)
static _lookupObjId($a_id)
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
static _getCompleted($a_obj_id)
Get completed users New handling for optional grouped assignments.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
static _getInProgress($a_obj_id)
static _getTypicalLearningTime($a_obj_id)
Reads Typical learning time.
static getInstance($a_obj_id)
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
static _determineStatus($a_obj_id, $a_usr_id)
Determine status.
static lookupUsersInProgress($a_obj_id)
Lookup users in progress.