33 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
34 include_once
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
49 global $ilObjDataCache,$tree;
51 switch($ilObjDataCache->lookupType($a_obj_id))
54 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
56 $members = $member_obj->getMembers();
65 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
67 $members = $member_obj->getMembers();
77 $folder_ref_id = current($folder_ref_ids);
78 if($crs_id = $tree->checkForParentType($folder_ref_id,
'crs'))
80 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
82 $members = $member_obj->getMembers();
101 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
104 $ilBench->start(
'LearningProgress',
'9172_LPStatusCollection_inProgress');
108 include_once
'./Services/Tracking/classes/class.ilChangeEvent.php';
112 $item_id = $ilObjDataCache->lookupObjId($item_id);
124 switch($ilObjDataCache->lookupType($a_obj_id))
128 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
130 $members = $members_obj->getMembers();
131 $users = array_intersect($members,(array) $users);
135 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
137 $members = $member_obj->getMembers();
138 $users = array_intersect($members,(array) $users);
143 $folder_ref_id = current($folder_ref_ids);
144 if($crs_id = $tree->checkForParentType($folder_ref_id,
'crs'))
146 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
148 $members = $members_obj->getMembers();
149 $users = array_intersect($members,(array) $users);
154 $ilBench->stop(
'LearningProgress',
'9172_LPStatusCollection_inProgress');
169 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
171 global
$ilBench,$ilObjDataCache,$tree;
172 $ilBench->start(
'LearningProgress',
'9173_LPStatusCollection_completed');
179 $isGrouping = $grouping_id ?
true :
false;
180 $grouping_completed = array();
181 $grouping_completed_users_num = array();
182 foreach((array) $grouping[
'items'] as $item)
184 $item_id = $ilObjDataCache->lookupObjId($item);
189 foreach($tmp_users as $tmp_user_id)
191 ++$grouping_completed_users_num[$tmp_user_id];
202 $users = array_intersect($users,$tmp_users);
210 foreach($grouping_completed_users_num as $tmp_user_id => $grouping_num_completed)
212 if($grouping_num_completed >= $grouping[
'num_obligatory'])
214 $grouping_completed[] = $tmp_user_id;
221 $users = $grouping_completed;
225 $users = array_intersect($users,$grouping_completed);
230 switch($ilObjDataCache->lookupType($a_obj_id))
234 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
236 $users = array_intersect($member_obj->getMembers(),(array) $users);
240 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
242 $members = $member_obj->getMembers();
243 $users = array_intersect($members,(array) $users);
248 $folder_ref_id = current($folder_ref_ids);
249 if($crs_id = $tree->checkForParentType($folder_ref_id,
'crs'))
251 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
253 $users = array_intersect($members_obj->getMembers(),(array) $users);
259 $ilBench->stop(
'LearningProgress',
'9173_LPStatusCollection_completed');
260 return (array) $users;
265 global $ilObjDataCache,$tree;
267 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
272 $isGrouping = $grouping_id ?
true :
false;
274 $gr_failed = array();
275 $gr_failed_users_num = array();
277 foreach((array) $grouping[
'items'] as $item)
279 $item_id = $ilObjDataCache->lookupObjId($item);
284 foreach($tmp_users as $tmp_user_id)
286 ++$gr_failed_users_num[$tmp_user_id];
292 $gr_failed = array_merge($gr_failed,$tmp_users);
298 $allowed_failed = count($grouping[
'items']) - $grouping[
'num_obligatory'];
300 foreach($gr_failed_users_num as $tmp_user_id => $num_failed)
302 if($num_failed > $allowed_failed)
304 $gr_failed[] = $tmp_user_id;
309 $users = array_unique(array_merge($users, $gr_failed));
313 switch($ilObjDataCache->lookupType($a_obj_id))
317 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
319 $members = $members_obj->getMembers();
320 $users = array_intersect($members,(array) $users);
324 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
326 $members = $member_obj->getMembers();
327 $users = array_intersect($members,(array) $users);
332 $folder_ref_id = current($folder_ref_ids);
333 if($crs_id = $tree->checkForParentType($folder_ref_id,
'crs'))
336 $members = $members_obj->getMembers();
337 $users = array_intersect($members,(array) $users);
342 return array_unique($users);
348 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
351 $status_info[
'num_collections'] = count($status_info[
'collections']);
357 global $ilObjDataCache;
359 if($ilObjDataCache->lookupType($a_obj_id) ==
'sahs')
365 foreach($status_info[
'collections'] as $item)
382 global $ilObjDataCache,
$ilDB;
384 $status[
'completed'] =
true;
385 $status[
'failed'] =
false;
386 $status[
'in_progress'] =
false;
387 $status[
'not_attempted'] =
true;
389 switch ($ilObjDataCache->lookupType($a_obj_id))
394 include_once
"./Services/Tracking/classes/class.ilChangeEvent.php";
397 $status[
'in_progress'] =
true;
400 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
403 $isGrouping = $grouping_id ?
true :
false;
406 if($status[
'completed'])
410 if($status[
'failed'])
414 if($status[
'in_progress'])
434 global $ilObjDataCache;
436 $items = $gr_info[
'items'];
439 $max_allowed_failed = count($items) - $gr_info[
'num_obligatory'];
440 $required_completed = $gr_info[
'num_obligatory'];
444 $max_allowed_failed = 0;
445 $required_completed = count($items);
452 include_once(
"./Services/Tracking/classes/class.ilLPCollectionCache.php");
453 foreach($items as $item_id)
455 $item_id = $ilObjDataCache->lookupObjId($item_id);
460 if(++
$failed > $max_allowed_failed)
462 $status[
'failed'] =
true;
463 $status[
'completed'] =
false;
469 if(++$num_completed >= $required_completed)
476 $status[
'completed'] =
false;