20 $obj_ids = array_keys($obj_refs);
21 self::refreshObjectsStatus($obj_ids,
array($a_user_id));
23 include_once
"Services/Object/classes/class.ilObjectLP.php";
24 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
27 include_once
'Modules/Course/classes/class.ilObjCourse.php';
28 $view_modes =
array();
29 $query =
"SELECT obj_id, view_mode FROM crs_settings".
30 " WHERE ".$ilDB->in(
"obj_id", $obj_ids ,
false,
"integer");
31 $set = $ilDB->query(
$query);
32 while($rec = $ilDB->fetchAssoc($set))
34 $view_modes[(int)$rec[
"obj_id"]] = (
int)$rec[
"view_mode"];
37 $sessions = self::getSessionData($a_user_id, $obj_ids);
39 $query =
"SELECT object_data.obj_id, title, CASE WHEN status IS NULL THEN ".ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM.
" ELSE status END AS status,".
40 " status_changed, percentage, read_count+childs_read_count AS read_count, spent_seconds+childs_spent_seconds AS spent_seconds,".
41 " u_mode, type, visits, mark, u_comment".
43 " LEFT JOIN ut_lp_settings ON (ut_lp_settings.obj_id = object_data.obj_id)".
44 " LEFT JOIN read_event ON (read_event.obj_id = object_data.obj_id AND read_event.usr_id = ".$ilDB->quote($a_user_id,
"integer").
")".
45 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.obj_id = object_data.obj_id AND ut_lp_marks.usr_id = ".$ilDB->quote($a_user_id,
"integer").
")".
47 " WHERE ".$ilDB->in(
"object_data.obj_id", $obj_ids,
false,
"integer").
49 $set = $ilDB->query(
$query);
51 while($rec = $ilDB->fetchAssoc($set))
53 $rec[
"comment"] = $rec[
"u_comment"];
54 unset($rec[
"u_comment"]);
56 $rec[
"ref_ids"] = $obj_refs[(int)$rec[
"obj_id"]];
57 $rec[
"status"] = (int)$rec[
"status"];
58 $rec[
"percentage"] = (int)$rec[
"percentage"];
59 $rec[
"read_count"] = (int)$rec[
"read_count"];
60 $rec[
"spent_seconds"] = (int)$rec[
"spent_seconds"];
61 $rec[
"u_mode"] = (int)$rec[
"u_mode"];
63 if($rec[
"type"] ==
"sess")
65 $session = $sessions[$rec[
"obj_id"]];
66 $rec[
"title"] = $session[
"title"];
75 else if(!$rec[
"u_mode"])
78 $rec[
"u_mode"] = $olp->getCurrentMode();
95 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
98 $query =
"SELECT crs_id, crs_objectives.objective_id AS obj_id, title,".$ilDB->quote(
"lobj",
"text").
" AS type".
99 " FROM crs_objectives".
100 " WHERE ".$ilDB->in(
"crs_objectives.objective_id", $a_objective_ids,
false,
"integer").
101 " AND active = ".$ilDB->quote(1,
"integer").
102 " ORDER BY position";
103 $set = $ilDB->query(
$query);
105 while($rec = $ilDB->fetchAssoc($set))
107 if(array_key_exists($rec[
"obj_id"], $lo_lp_status))
109 $rec[
"status"] = $lo_lp_status[$rec[
"obj_id"]];
123 self::refreshObjectsStatus(
array($a_parent_obj_id),
array($a_user_id));
126 $scores_raw = $scores =
array();
127 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
134 include_once
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
136 $scores_raw = $module->getTrackingDataAgg($a_user_id);
140 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
142 $scores_raw = $module->getTrackingDataAgg($a_user_id);
147 foreach($scores_raw as $item)
149 $scores[$item[
"sco_id"]] = $item[
"score"];
155 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
159 foreach($a_sco_ids as $sco_id)
162 if(in_array($a_user_id, $status_info[
"failed"][$sco_id]))
166 elseif(in_array($a_user_id, $status_info[
"completed"][$sco_id]))
170 elseif(in_array($a_user_id, $status_info[
"in_progress"][$sco_id]))
179 $items[$sco_id] =
array(
180 "title" => $status_info[
"scos_title"][$sco_id],
183 "score" => (
int)$scores[$sco_id]
199 self::refreshObjectsStatus(
array($a_parent_obj_id),
array($a_user_id));
205 include_once
'./Services/Object/classes/class.ilObjectLP.php';
207 $collection = $olp->getCollectionInstance();
212 $item_data = $collection->getPossibleItems(
$ref_id);
220 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
224 foreach($a_item_ids as $item_id)
226 if(!isset($item_data[$item_id]))
231 if(in_array($a_user_id, $status_info[
"completed"][$item_id]))
235 elseif(in_array($a_user_id, $status_info[
"in_progress"][$item_id]))
244 $items[$item_id] =
array(
245 "title" => $item_data[$item_id][
"title"],
247 "type" => self::getSubItemType($a_parent_obj_id)
269 $a_offset = 0, $a_limit = 9999,
array $a_filters = NULL,
array $a_additional_fields = NULL,
270 $check_agreement =
false, $privacy_fields = NULL)
274 $fields =
array(
"usr_data.usr_id",
"login",
"active");
275 $udf = self::buildColumns($fields, $a_additional_fields);
278 $where[] =
"usr_data.usr_id <> ".$ilDB->quote(ANONYMOUS_USER_ID,
"integer");
282 $a_users = self::getParticipantsForObject($a_ref_id);
285 self::refreshObjectsStatus(
array($obj_id), $a_users);
287 if (is_array($a_users))
290 $where[] = $ilDB->in(
"usr_data.usr_id", $a_users,
false,
"integer");
293 $query =
" FROM usr_data ".$left.
" JOIN read_event ON (read_event.usr_id = usr_data.usr_id".
294 " AND read_event.obj_id = ".$ilDB->quote($obj_id,
"integer").
")".
295 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = usr_data.usr_id ".
296 " AND ut_lp_marks.obj_id = ".$ilDB->quote($obj_id,
"integer").
")".
297 " LEFT JOIN usr_pref ON (usr_pref.usr_id = usr_data.usr_id AND keyword = ".$ilDB->quote(
"language",
"text").
")".
298 self::buildFilters($where, $a_filters);
303 if($a_order_field ==
"language")
305 $a_order_field =
"usr_pref.value";
312 $a_order_field =
"login";
314 else if(substr($a_order_field, 0, 4) ==
"udf_")
316 $udf_order = $a_order_field;
317 $a_order_field = null;
320 $result = self::executeQueries($queries, $a_order_field, $a_order_dir, $a_offset, $a_limit);
322 self::getUDFAndHandlePrivacy(
$result, $udf, $check_agreement, $privacy_fields, $a_filters);
328 include_once
"Services/Utilities/classes/class.ilStr.php";
330 $udf_order, $a_order_dir);
346 $a_check_agreement = null,
array $a_privacy_fields = null,
array $a_filters = null)
350 if(!$a_result[
"cnt"])
357 $query =
"SELECT usr_id, field_id, value FROM udf_text WHERE ".$ilDB->in(
"field_id", $a_udf,
false,
"integer");
358 $set = $ilDB->query(
$query);
360 while(
$row = $ilDB->fetchAssoc($set))
362 $udf[
$row[
"usr_id"]][
"udf_".$row[
"field_id"]] =
$row[
"value"];
367 if($a_check_agreement)
370 include_once
"Services/Membership/classes/class.ilMemberAgreement.php";
374 $query =
"SELECT usr_id FROM usr_pref WHERE keyword = ".$ilDB->quote(
"public_profile",
"text").
375 " AND value = ".$ilDB->quote(
"y",
"text").
" OR value = ".$ilDB->quote(
"g",
"text");
376 $set = $ilDB->query(
$query);
377 $all_public =
array();
378 while(
$row = $ilDB->fetchAssoc($set))
380 $all_public[] =
$row[
"usr_id"];
382 $query =
"SELECT usr_id,keyword FROM usr_pref WHERE ".$ilDB->like(
"keyword",
"text",
"public_%",
false).
383 " AND value = ".$ilDB->quote(
"y",
"text").
" AND ".$ilDB->in(
"usr_id", $all_public,
"",
"integer");
384 $set = $ilDB->query(
$query);
386 while(
$row = $ilDB->fetchAssoc($set))
388 $public[
$row[
"usr_id"]][] = substr($row[
"keyword"], 7);
393 foreach($a_result[
"set"] as $idx =>
$row)
396 if(isset($udf[
$row[
"usr_id"]]))
398 $a_result[
"set"][$idx] = $row = array_merge($row, $udf[$row[
"usr_id"]]);
402 if(
sizeof($a_privacy_fields) && $a_check_agreement && !in_array($row[
"usr_id"], $agreements))
404 foreach($a_privacy_fields as $field)
407 if(isset($row[$field]) && (!isset($public[$row[
"usr_id"]]) ||
408 !in_array($field, $public[$row[
"usr_id"]])))
411 if(isset($a_filters[$field]))
414 foreach(array_keys($row) as $col_id)
416 $a_result[
"set"][$idx][$col_id] = null;
418 $a_result[
"set"][$idx][
"privacy_conflict"] =
true;
425 $a_result[
"set"][$idx][$field] =
false;
450 static function getObjectsDataForUser($a_user_id, $a_parent_obj_id, $a_parent_ref_id, $a_order_field =
"", $a_order_dir =
"", $a_offset = 0, $a_limit = 9999,
451 array $a_filters = NULL,
array $a_additional_fields = NULL, $use_collection =
true)
455 $fields =
array(
"object_data.obj_id",
"title",
"type");
456 self::buildColumns($fields, $a_additional_fields);
458 $objects = self::getObjectIds($a_parent_obj_id, $a_parent_ref_id, $use_collection,
true,
array($a_user_id));
460 $query =
" FROM object_data LEFT JOIN read_event ON (object_data.obj_id = read_event.obj_id AND".
461 " read_event.usr_id = ".$ilDB->quote($a_user_id,
"integer").
")".
462 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = ".$ilDB->quote($a_user_id,
"integer").
" AND".
463 " ut_lp_marks.obj_id = object_data.obj_id)".
464 " WHERE ".$ilDB->in(
"object_data.obj_id", $objects[
"object_ids"],
false,
"integer").
465 self::buildFilters(
array(), $a_filters);
468 $queries[] =
array(
"fields"=>$fields,
"query"=>
$query);
470 if(!in_array($a_order_field, $fields))
472 $a_order_field =
"title";
475 $result = self::executeQueries($queries, $a_order_field, $a_order_dir, $a_offset, $a_limit);
479 $sessions = self::getSessionData($a_user_id, $objects[
"object_ids"]);
481 foreach(
$result[
"set"] as $idx => $item)
483 if($item[
"type"] ==
"sess")
485 $session = $sessions[$item[
"obj_id"]];
486 $result[
"set"][$idx][
"title"] = $session[
"title"];
487 $result[
"set"][$idx][
"sort_title"] = $session[
"e_start"];
491 $result[
"set"][$idx][
"ref_id"] = $objects[
"ref_ids"][$item[
"obj_id"]];
495 if($objects[
"scorm"])
497 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
499 if($subtype ==
"scorm2004")
501 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
503 $scos_tracking = $sobj->getTrackingDataAgg($a_user_id,
true);
507 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
509 $scos_tracking =
array();
510 foreach($sobj->getTrackingDataAgg($a_user_id) as $item)
515 $time = explode(
":", $item[
"time"]);
516 $item[
"time"] = $time[0]*60*60+$time[1]*60+$time[2];
518 $scos_tracking[$item[
"sco_id"]] =
array(
"session_time"=>$item[
"time"]);
522 foreach($objects[
"scorm"][
"scos"] as $sco)
524 $row =
array(
"title" => $objects[
"scorm"][
"scos_title"][$sco],
528 if(in_array($a_user_id, $objects[
"scorm"][
"completed"][$sco]))
532 else if(in_array($a_user_id, $objects[
"scorm"][
"failed"][$sco]))
536 else if(in_array($a_user_id, $objects[
"scorm"][
"in_progress"][$sco]))
540 $row[
"status"] = $status;
543 if(isset($scos_tracking[$sco]))
545 if(isset($scos_tracking[$sco][
"last_access"]))
550 $row[
"spent_seconds"] = $scos_tracking[$sco][
"session_time"];
559 if($objects[
"objectives_parent_id"])
561 include_once
"Modules/Course/classes/class.ilCourseObjective.php";
562 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
564 foreach(self::getObjectivesStatusForUser($a_user_id, $objects[
"objectives_parent_id"], $objtv_ids) as $item)
572 if($objects[
"subitems"])
574 $sub_type = self::getSubItemType($a_parent_obj_id);
575 foreach($objects[
"subitems"][
"items"] as $item_id)
577 $row =
array(
"title" => $objects[
"subitems"][
"item_titles"][$item_id],
578 "type" => $sub_type);
581 if(in_array($a_user_id, $objects[
"subitems"][
"completed"][$item_id]))
585 $row[
"status"] = $status;
623 $query =
"SELECT obj_id, title, e_start, e_end, CASE WHEN participated = 1 THEN 2 WHEN registered = 1 THEN 1 ELSE NULL END AS status,".
626 " JOIN event_appointment ON (event.obj_id = event_appointment.event_id)".
627 " LEFT JOIN event_participants ON (event_participants.event_id = event.obj_id AND usr_id = ".$ilDB->quote($a_user_id,
"integer").
")".
628 " WHERE ".$ilDB->in(
"obj_id", $obj_ids ,
false,
"integer");
629 $set = $ilDB->query(
$query);
631 while($rec = $ilDB->fetchAssoc($set))
633 $rec[
"comment"] = $rec[
"e_comment"];
634 unset($rec[
"e_comment"]);
642 $rec[
"title"] = $date.
': '.$rec[
"title"];
646 $rec[
"title"] = $date;
648 $sessions[$rec[
"obj_id"]] = $rec;
669 static function getObjectsSummaryForObject($a_parent_obj_id, $a_parent_ref_id, $a_order_field =
"", $a_order_dir =
"", $a_offset = 0, $a_limit = 9999,
670 array $a_filters = NULL,
array $a_additional_fields = NULL, $a_preselected_obj_ids = NULL)
675 self::buildColumns($fields, $a_additional_fields,
true);
678 if($a_preselected_obj_ids === NULL)
680 $objects = self::getObjectIds($a_parent_obj_id, $a_parent_ref_id,
false,
false);
684 foreach($a_preselected_obj_ids as $obj_id => $ref_ids)
686 $objects[
"object_ids"][] = $obj_id;
687 $objects[
"ref_ids"][$obj_id] = array_pop($ref_ids);
695 $set = $ilDB->query(
"SELECT obj_id,title,type FROM object_data".
696 " WHERE ".$ilDB->in(
"obj_id", $objects[
"object_ids"],
false,
"integer"));
697 while($rec = $ilDB->fetchAssoc($set))
699 $object_data[$rec[
"obj_id"]] = $rec;
700 if($a_preselected_obj_ids)
702 $object_data[$rec[
"obj_id"]][
"ref_ids"] = $a_preselected_obj_ids[$rec[
"obj_id"]];
706 $object_data[$rec[
"obj_id"]][
"ref_ids"] =
array($objects[
"ref_ids"][$rec[
"obj_id"]]);
710 foreach($objects[
"ref_ids"] as $object_id =>
$ref_id)
712 $object_result = self::getSummaryDataForObject(
$ref_id, $fields, $a_filters);
713 if(
sizeof($object_result))
715 if($object_data[$object_id])
717 $result[] = array_merge($object_data[$object_id], $object_result);
723 if($objects[
"objectives_parent_id"])
745 $where[] =
"usr_data.usr_id <> ".$ilDB->quote(ANONYMOUS_USER_ID,
"integer");
748 $a_users = self::getParticipantsForObject($a_ref_id);
750 if (is_array($a_users))
753 $where[] = $ilDB->in(
"usr_data.usr_id", $a_users,
false,
"integer");
757 self::refreshObjectsStatus(
array($obj_id), $a_users);
759 $query =
" FROM usr_data ".$left.
" JOIN read_event ON (read_event.usr_id = usr_data.usr_id".
760 " AND obj_id = ".$ilDB->quote($obj_id,
"integer").
")".
761 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = usr_data.usr_id ".
762 " AND ut_lp_marks.obj_id = ".$ilDB->quote($obj_id,
"integer").
")".
763 " LEFT JOIN usr_pref ON (usr_pref.usr_id = usr_data.usr_id AND keyword = ".$ilDB->quote(
"language",
"text").
")".
764 self::buildFilters($where, $a_filters,
true);
766 $fields[] =
'COUNT(usr_data.usr_id) AS user_count';
769 $queries[] =
array(
"fields"=>$fields,
"query"=>
$query,
"count"=>
"*");
771 $result = self::executeQueries($queries);
773 $users_no =
$result[
"user_count"];
780 else if(isset($a_filters[
"user_total"]))
782 if($a_filters[
"user_total"][
"from"] && $users_no < $a_filters[
"user_total"][
"from"])
786 else if($a_filters[
"user_total"][
"to"] && $users_no > $a_filters[
"user_total"][
"to"])
794 $result[
"country"] = self::getSummaryPercentages(
"country",
$query);
795 $result[
"sel_country"] = self::getSummaryPercentages(
"sel_country",
$query);
796 $result[
"city"] = self::getSummaryPercentages(
"city",
$query);
797 $result[
"gender"] = self::getSummaryPercentages(
"gender",
$query);
798 $result[
"language"] = self::getSummaryPercentages(
"usr_pref.value",
$query,
"language");
799 $result[
"status"] = self::getSummaryPercentages(
"status",
$query);
800 $result[
"mark"] = self::getSummaryPercentages(
"mark",
$query);
809 $result[
"user_total"] = $users_no;
829 $field_alias = $field;
833 $field_alias = $alias;
834 $alias =
" AS ".$alias;
839 if(preg_match(
"/".preg_quote(
" [[--HAVING").
"(.+)".preg_quote(
"HAVING--]]").
"/", $base_query, $hits))
841 $having =
" HAVING ".$hits[1];
842 $base_query = str_replace($hits[0],
"", $base_query);
845 $query =
"SELECT COUNT(*) AS counter, ".$field.$alias.
" ".$base_query.
" GROUP BY ".$field.$having.
" ORDER BY counter DESC";
846 $set = $ilDB->query(
$query);
848 while($rec = $ilDB->fetchAssoc($set))
850 $result[$rec[$field_alias]] = (int)$rec[
"counter"];
872 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
874 return $member_obj->getMembers();
877 include_once
"Modules/Group/classes/class.ilGroupParticipants.php";
879 return $member_obj->getMembers();
885 include_once(
"Modules/IndividualAssessment/classes/class.ilObjIndividualAssessment.php");
887 return $iass->loadMembers()->membersIds();
892 $path = $tree->getPathId($a_ref_id);
894 foreach(array_reverse(
$path) as $path_ref_id)
897 if($type ==
"crs" || $type ==
"grp")
899 return self::getParticipantsForObject($path_ref_id);
911 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
913 if ($subtype ==
"scorm2004")
916 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
918 $all = $mod->getTrackedUsers(
"");
922 foreach($all as $item)
924 $a_users[] = $item[
"user_id"];
930 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
936 include_once(
"./Modules/Exercise/classes/class.ilExerciseMembers.php");
937 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
940 $a_users = $members->getMembers();
944 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
946 $a_users = $class::getParticipants($obj_id);
950 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
952 $a_users = $class::getParticipants($obj_id);
956 include_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
958 $a_users = $prg->getIdsOfUsersWithRelevantProgress();
982 if(
sizeof($a_filters))
984 foreach($a_filters as $id => $value)
995 case "matriculation":
999 $where[] = $ilDB->like(
"usr_data.".$id,
"text",
"%".$value.
"%");
1005 $where[] =
"usr_data.".$id.
" = ".$ilDB->quote($value ,
"text");
1009 $where[] = $ilDB->like(
"ut_lp_marks.".$id,
"text",
"%".$value.
"%");
1017 " OR ut_lp_marks.status IS NULL)";
1023 $where[] =
"ut_lp_marks.".$id.
" = ".$ilDB->quote($value ,
"text");
1031 $where[] =
"ut_lp_marks.".$id.
" >= ".$ilDB->quote($value[
"from"] ,
"integer");
1035 $where[] =
"(ut_lp_marks.".$id.
" <= ".$ilDB->quote($value[
"to"] ,
"integer").
1036 " OR ut_lp_marks.".$id.
" IS NULL)";
1043 $having[] =
"ROUND(AVG(ut_lp_marks.".$id.
")) >= ".$ilDB->quote($value[
"from"] ,
"integer");
1047 $having[] =
"ROUND(AVG(ut_lp_marks.".$id.
")) <= ".$ilDB->quote($value[
"to"] ,
"integer");
1053 $where[] =
"usr_pref.value = ".$ilDB->quote($value ,
"text");
1060 $value[
"from"] = substr($value[
"from"], 0, -2).
"00";
1062 $value[
"from"] = $value[
"from"]->get(
IL_CAL_UNIX);
1066 if(strlen($value[
"to"]) == 19)
1068 $value[
"to"] = substr($value[
"to"], 0, -2).
"59";
1075 case 'status_changed':
1078 case "registration":
1079 if($id ==
"registration")
1081 $id =
"create_date";
1086 case "first_access":
1090 $where[] = $id.
" >= ".$ilDB->quote($value[
"from"] ,
"date");
1094 if(strlen($value[
"to"]) == 19)
1096 $value[
"to"] = substr($value[
"to"], 0, -2).
"59";
1098 $where[] = $id.
" <= ".$ilDB->quote($value[
"to"] ,
"date");
1107 $where[] =
"(read_event.".$id.
"+read_event.childs_".$id.
") >= ".$ilDB->quote($value[
"from"] ,
"integer");
1111 $where[] =
"((read_event.".$id.
"+read_event.childs_".$id.
") <= ".$ilDB->quote($value[
"to"] ,
"integer").
1112 " OR (read_event.".$id.
"+read_event.childs_".$id.
") IS NULL)";
1119 $having[] =
"SUM(read_event.".$id.
"+read_event.childs_".$id.
") >= ".$ilDB->quote($value[
"from"] ,
"integer");
1123 $having[] =
"SUM(read_event.".$id.
"+read_event.childs_".$id.
") <= ".$ilDB->quote($value[
"to"] ,
"integer");
1128 case "spent_seconds":
1133 $where[] =
"(read_event.".$id.
"+read_event.childs_".$id.
") >= ".$ilDB->quote($value[
"from"] ,
"integer");
1137 $where[] =
"((read_event.".$id.
"+read_event.childs_".$id.
") <= ".$ilDB->quote($value[
"to"] ,
"integer").
1138 " OR (read_event.".$id.
"+read_event.childs_".$id.
") IS NULL)";
1145 $having[] =
"ROUND(AVG(read_event.".$id.
"+read_event.childs_".$id.
")) >= ".$ilDB->quote($value[
"from"] ,
"integer");
1149 $having[] =
"ROUND(AVG(read_event.".$id.
"+read_event.childs_".$id.
")) <= ".$ilDB->quote($value[
"to"] ,
"integer");
1164 $sql .=
" WHERE ".implode(
" AND ", $where);
1169 $sql .=
" [[--HAVING ".implode(
" AND ", $having).
"HAVING--]]";
1185 if(
sizeof($a_additional_fields))
1188 foreach($a_additional_fields as $field)
1190 if(substr($field, 0, 4) !=
"udf_")
1195 $pos = strrpos($field,
"_");
1200 $function = strtoupper(substr($field, $pos+1));
1201 $field = substr($field, 0, $pos);
1202 if(!in_array($function,
array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")))
1216 $a_fields[] = $function.
"(value) ".$field.
"_".strtolower($function);
1220 $a_fields[] =
"value as ".$field;
1225 case "spent_seconds":
1228 $a_fields[] =
"(".$field.
"+childs_".$field.
") ".$field;
1232 if($function ==
"AVG")
1234 $a_fields[] =
"ROUND(AVG(".$field.
"+childs_".$field.
"), 2) ".$field.
"_".strtolower($function);
1238 $a_fields[] = $function.
"(".$field.
"+childs_".$field.
") ".$field.
"_".strtolower($function);
1243 case "read_count_spent_seconds":
1244 if($function ==
"AVG")
1246 $a_fields[] =
"ROUND(AVG((spent_seconds+childs_spent_seconds)/(read_count+childs_read_count)), 2) ".$field.
"_".strtolower($function);
1253 if($function ==
"AVG")
1255 $a_fields[] =
"ROUND(AVG(".$field.
"), 2) ".$field.
"_".strtolower($function);
1259 $a_fields[] = $function.
"(".$field.
") ".$field.
"_".strtolower($function);
1264 $a_fields[] = $field;
1271 $udf[] = substr($field, 4);
1276 $a_fields = array_unique($a_fields);
1279 $udf = array_unique($udf);
1296 static public function getObjectIds($a_parent_obj_id, $a_parent_ref_id =
false, $use_collection =
true, $a_refresh_status =
true, $a_user_ids = null)
1298 include_once
"Services/Object/classes/class.ilObjectLP.php";
1300 $object_ids =
array($a_parent_obj_id);
1301 $ref_ids =
array($a_parent_obj_id => $a_parent_ref_id);
1302 $objectives_parent_id = $scorm = $subitems =
false;
1305 $mode = $olp->getCurrentMode();
1310 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
1312 $scorm = $status_scorm::_getStatusInfo($a_parent_obj_id);
1318 $objectives_parent_id = $a_parent_obj_id;
1325 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
1327 $subitems = $status_coll_tlt::_getStatusInfo($a_parent_obj_id);
1334 $collection = $olp->getCollectionInstance();
1337 foreach($collection->getItems() as $child_ref_id)
1340 $object_ids[] = $child_id;
1341 $ref_ids[$child_id] = $child_ref_id;
1348 self::getSubTree($a_parent_ref_id, $object_ids, $ref_ids);
1349 $object_ids = array_unique($object_ids);
1352 foreach($object_ids as $idx => $object_id)
1356 unset($object_ids[$idx]);
1362 if($a_refresh_status)
1364 self::refreshObjectsStatus($object_ids, $a_user_ids);
1367 return array(
"object_ids" => $object_ids,
1368 "ref_ids" => $ref_ids,
1369 "objectives_parent_id" => $objectives_parent_id,
1371 "subitems" => $subitems);
1385 $children = $tree->getChilds($a_parent_ref_id);
1388 foreach($children as $child)
1390 if($child[
"type"] ==
"adm" || $child[
"type"] ==
"rolf")
1399 $cmode = $olp->getCurrentMode();
1416 $a_object_ids[] = $child[
"obj_id"];
1417 $a_ref_ids[$child[
"obj_id"]] = $child[
"ref_id"];
1420 self::getSubTree($child[
"ref_id"], $a_object_ids, $a_ref_ids);
1435 static function executeQueries(
array $queries, $a_order_field =
"", $a_order_dir =
"", $a_offset = 0, $a_limit = 9999)
1440 $subqueries =
array();
1441 foreach($queries as $item)
1444 $item = str_replace(
"[[--HAVING",
"HAVING", $item);
1445 $item = str_replace(
"HAVING--]]",
"", $item);
1447 if(!isset($item[
"count"]))
1449 $count_field = $item[
"fields"];
1450 $count_field = array_shift($count_field);
1454 $count_field = $item[
"count"];
1456 $count_query =
"SELECT COUNT(".$count_field.
") AS cnt".$item[
"query"];
1457 $set = $ilDB->query($count_query);
1458 if ($rec = $ilDB->fetchAssoc($set))
1460 $cnt += $rec[
"cnt"];
1463 $subqueries[] =
"SELECT ".implode(
",", $item[
"fields"]).$item[
"query"];
1470 if(
sizeof($subqueries) > 1)
1472 $base = array_shift($subqueries);
1473 $query = $base.
" UNION (".implode(
") UNION (", $subqueries).
")";
1480 if ($a_order_dir !=
"asc" && $a_order_dir !=
"desc")
1482 $a_order_dir =
"asc";
1486 $query.=
" ORDER BY ".$a_order_field.
" ".strtoupper($a_order_dir);
1489 $offset = (int) $a_offset;
1490 $limit = (int) $a_limit;
1491 $ilDB->setLimit($limit, $offset);
1493 $set = $ilDB->query(
$query);
1494 while($rec = $ilDB->fetchAssoc($set))
1515 array $a_additional_fields = null,
array $a_privacy_fields = null, $a_check_agreement = null)
1520 if(
sizeof($a_obj_ids))
1523 $where[] =
"usr_data.usr_id <> ".$ilDB->quote(ANONYMOUS_USER_ID,
"integer");
1526 $where[] = $ilDB->like(
"usr_data.login",
"text",
"%".$a_user_filter.
"%");
1531 $a_users = self::getParticipantsForObject($a_parent_ref_id);
1532 if (is_array($a_users))
1535 $where[] = $ilDB->in(
"usr_data.usr_id", $a_users,
false,
"integer");
1539 self::refreshObjectsStatus($a_obj_ids, $a_users);
1541 $fields =
array(
"usr_data.usr_id",
"login",
"active");
1542 $udf = self::buildColumns($fields, $a_additional_fields);
1544 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
1547 $fields[] =
"percentage";
1550 foreach($a_obj_ids as $obj_id)
1553 $query =
" FROM usr_data ".$left.
" JOIN read_event ON (read_event.usr_id = usr_data.usr_id".
1554 " AND read_event.obj_id = ".$ilDB->quote($obj_id,
"integer").
")".
1555 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = usr_data.usr_id ".
1556 " AND ut_lp_marks.obj_id = ".$ilDB->quote($obj_id,
"integer").
")".
1557 " LEFT JOIN usr_pref ON (usr_pref.usr_id = usr_data.usr_id AND keyword = ".$ilDB->quote(
"language",
"text").
")".
1558 self::buildFilters($where);
1560 $raw = self::executeQueries(
array(
array(
"fields"=>$fields,
"query"=>
$query)),
"login");
1564 foreach($raw[
"set"] as
$row)
1566 $result[
"set"][$row[
"usr_id"]][
"login"] = $row[
"login"];
1567 $result[
"set"][$row[
"usr_id"]][
"usr_id"] = $row[
"usr_id"];
1570 $result[
"set"][$row[
"usr_id"]][
"obj_".$obj_id] = $row[
"status"];
1571 $result[
"set"][$row[
"usr_id"]][
"obj_".$obj_id.
"_perc"] = $row[
"percentage"];
1573 if($obj_id == $parent_obj_id)
1575 $result[
"set"][$row[
"usr_id"]][
"status_changed"] = $row[
"status_changed"];
1576 $result[
"set"][$row[
"usr_id"]][
"last_access"] = $row[
"last_access"];
1577 $result[
"set"][$row[
"usr_id"]][
"spent_seconds"] = $row[
"spent_seconds"];
1578 $result[
"set"][$row[
"usr_id"]][
"read_count"] = $row[
"read_count"];
1581 foreach($fields as $field)
1584 if(stristr($field,
"language"))
1586 $field =
"language";
1589 if(isset($row[$field]))
1592 if($obj_id == $parent_obj_id ||
1593 !in_array($field,
array(
"mark",
"u_comment")))
1595 $result[
"set"][$row[
"usr_id"]][$field] = $row[$field];
1606 self::getUDFAndHandlePrivacy(
$result, $udf, $a_check_agreement, $a_privacy_fields, $a_additional_fields);
1615 if($a_parent_obj_id && $a_users)
1619 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
1620 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1621 include_once
"Modules/Course/classes/class.ilCourseObjective.php";
1625 include_once
"Modules/Course/classes/Objectives/class.ilLOSettings.php";
1627 $initial_qualifying = $lo_set->isInitialTestQualifying();
1630 foreach($objective_ids as $objective_id)
1632 foreach($a_users as $user_id)
1638 $query =
"SELECT * FROM loc_user_results".
1639 " WHERE ".$ilDB->in(
"objective_id", $objective_ids,
"",
"integer").
1640 " AND ".$ilDB->in(
"user_id", $a_users,
"",
"integer");
1641 if(!(
bool)$initial_qualifying)
1645 $query .=
" ORDER BY type";
1646 $set = $ilDB->query(
$query);
1647 while(
$row = $ilDB->fetchAssoc($set))
1649 $objective_id =
$row[
"objective_id"];
1650 $user_id =
$row[
"user_id"];
1661 $res[$user_id][$objective_id] =
$row[
"is_final"]
1675 $obj_ids = array_keys($a_ref_ids);
1687 $sql =
"SELECT obj_id,".$column.
",SUM(read_count) read_count,SUM(childs_read_count) childs_read_count,".
1688 "SUM(spent_seconds) spent_seconds,SUM(childs_spent_seconds) childs_spent_seconds".
1690 " WHERE ".$ilDB->in(
"obj_id", $obj_ids,
"",
"integer").
1691 " AND yyyy = ".$ilDB->quote($a_year,
"integer");
1694 $sql .=
" AND mm = ".$ilDB->quote($a_month,
"integer");
1696 $sql .=
" GROUP BY obj_id,".$column;
1697 $set = $ilDB->query($sql);
1698 while(
$row = $ilDB->fetchAssoc($set))
1700 $row[
"read_count"] +=
$row[
"childs_read_count"];
1701 $row[
"spent_seconds"] +=
$row[
"childs_spent_seconds"];
1703 $res[$row[
"obj_id"]][$row[
$column]][
"spent_seconds"] += $row[
"spent_seconds"];
1709 $sql =
"SELECT obj_id,".$column.
",SUM(counter) counter".
1710 " FROM obj_user_stat".
1711 " WHERE ".$ilDB->in(
"obj_id", $obj_ids,
"",
"integer").
1712 " AND yyyy = ".$ilDB->quote($a_year,
"integer");
1715 $sql .=
" AND mm = ".$ilDB->quote($a_month,
"integer");
1717 $sql .=
" GROUP BY obj_id,".$column;
1718 $set = $ilDB->query($sql);
1719 while(
$row = $ilDB->fetchAssoc($set))
1729 global
$ilDB, $objDefinition;
1735 include_once
"Services/Tree/classes/class.ilTree.php";
1737 $sql =
"SELECT ".$tree->table_obj_data.
".obj_id,".$tree->table_obj_data.
".type,".
1738 $tree->table_tree.
".".$tree->tree_pk.
",".$tree->table_obj_reference.
".ref_id".
1739 " FROM ".$tree->table_tree.
1740 " ".$tree->buildJoin().
1741 " WHERE ".$ilDB->in($tree->table_obj_data.
".type", $types,
"",
"text");
1742 $set = $ilDB->query($sql);
1744 while(
$row = $ilDB->fetchAssoc($set))
1746 $res[
$row[
"type"]][
"type"] = $row[
"type"];
1747 $res[$row[
"type"]][
"references"]++;
1748 $res[$row[
"type"]][
"objects"][] = $row[
"obj_id"];
1749 if($row[$tree->tree_pk] < 0)
1751 $res[$row[
"type"]][
"deleted"]++;
1755 foreach(
$res as $type => $values)
1757 $res[$type][
"objects"] =
sizeof(array_unique($values[
"objects"]));
1761 foreach(self::getPortfolios() as $obj_id)
1763 $res[
"prtf"][
"type"] =
"prtf";
1764 $res[
"prtf"][
"references"]++;
1765 $res[
"prtf"][
"objects"]++;
1768 foreach(self::getWorkspaceBlogs() as $obj_id)
1770 $res[
"blog"][
"type"] =
"blog";
1771 $res[
"blog"][
"references"]++;
1772 $res[
"blog"][
"objects"]++;
1785 $sql =
"SELECT od.obj_id,oref.wsp_id,od.type".
1786 " FROM tree_workspace wst".
1787 " JOIN object_reference_ws oref ON (oref.wsp_id = wst.child)".
1788 " JOIN object_data od ON (oref.obj_id = od.obj_id)".
1789 " WHERE od.type = ".$ilDB->quote(
"blog",
"text");
1793 $sql .=
" AND ".$ilDB->like(
"od.title",
"text",
"%".$a_title.
"%");
1796 $set = $ilDB->query($sql);
1797 while(
$row = $ilDB->fetchAssoc($set))
1811 $sql =
"SELECT od.obj_id".
1812 " FROM usr_portfolio prtf".
1813 " JOIN object_data od ON (od.obj_id = prtf.id)";
1817 $sql .=
" WHERE ".$ilDB->like(
"od.title",
"text",
"%".$a_title.
"%");
1820 $set = $ilDB->query($sql);
1821 while(
$row = $ilDB->fetchAssoc($set))
1833 $obj_ids = array_keys($a_ref_ids);
1836 $sql =
"SELECT obj_id,hh,SUM(read_count) read_count,SUM(childs_read_count) childs_read_count,".
1837 "SUM(spent_seconds) spent_seconds,SUM(childs_spent_seconds) childs_spent_seconds".
1839 " WHERE ".$ilDB->in(
"obj_id", $obj_ids,
"",
"integer").
1840 " AND yyyy = ".$ilDB->quote($a_year,
"integer");
1843 $sql .=
" AND mm = ".$ilDB->quote($a_month,
"integer");
1845 $sql .=
" GROUP BY obj_id,hh";
1846 $set = $ilDB->query($sql);
1847 while(
$row = $ilDB->fetchAssoc($set))
1849 $row[
"read_count"] +=
$row[
"childs_read_count"];
1850 $row[
"spent_seconds"] +=
$row[
"childs_spent_seconds"];
1852 $res[
$row[
"obj_id"]][(int)
$row[
"hh"]][
"spent_seconds"] +=
$row[
"spent_seconds"];
1861 $set = $ilDB->query(
"SELECT COUNT(*) AS COUNTER,yyyy,mm".
1863 " GROUP BY yyyy, mm".
1864 " ORDER BY yyyy DESC, mm DESC");
1866 while(
$row = $ilDB->fetchAssoc($set))
1869 "count"=>$row[
"counter"]);
1879 $date_compare = $ilDB->in($ilDB->concat(
array(
array(
"yyyy",
""),
1880 array($ilDB->quote(
"-",
"text"),
""),
1881 array(
"mm",
""))), $a_months,
"",
"text");
1882 $sql =
"DELETE FROM obj_stat".
1883 " WHERE ".$date_compare;
1884 $ilDB->manipulate($sql);
1887 $tables =
array(
"obj_lp_stat",
"obj_type_stat",
"obj_user_stat");
1888 foreach($a_months as $month)
1890 $year = substr($month, 0, 4);
1891 $month = substr($month, 5);
1892 $from = $year.str_pad($month, 2,
"0", STR_PAD_LEFT).
"01";
1893 $to = $year.str_pad($month, 2,
"0", STR_PAD_LEFT).
"31";
1895 foreach($tables as $table)
1897 $sql =
"DELETE FROM ".$table.
1898 " WHERE fulldate >= ".$ilDB->quote($from,
"integer").
1899 " AND fulldate <= ".$ilDB->quote($to,
"integer");
1900 $ilDB->manipulate($sql);
1905 static public function searchObjects(
$a_type, $a_title = null, $a_root = null, $a_hidden = null, $a_preset_obj_ids = null)
1907 global
$ilDB, $tree;
1914 $sql =
"SELECT r.ref_id,r.obj_id".
1915 " FROM object_data o".
1916 " JOIN object_reference r ON (o.obj_id = r.obj_id)".
1917 " JOIN tree t ON (t.child = r.ref_id)".
1918 " WHERE t.tree = ".$ilDB->quote(1,
"integer");
1922 $sql .=
" AND o.type = ".$ilDB->quote(
$a_type,
"text");
1926 $sql .=
" AND ".$ilDB->in(
"o.type",
$a_type,
"",
"text");
1931 $sql .=
" AND (".$ilDB->like(
"o.title",
"text",
"%".$a_title.
"%").
1932 " OR ".$ilDB->like(
"o.description",
"text",
"%".$a_title.
"%").
")";
1935 if(is_array($a_hidden))
1937 $sql .=
" AND ".$ilDB->in(
"o.obj_id", $a_hidden,
true,
"integer");
1940 if(is_array($a_preset_obj_ids))
1942 $sql .=
" AND ".$ilDB->in(
"o.obj_id", $a_preset_obj_ids,
false,
"integer");
1945 $set = $ilDB->query($sql);
1947 while(
$row = $ilDB->fetchAssoc($set))
1949 if($a_root && $a_root != ROOT_FOLDER_ID)
1953 if($tree->isGrandChild($a_root,
$ref_id))
1955 $res[
$row[
"obj_id"]][] = $row[
"ref_id"];
1962 $res[
$row[
"obj_id"]][] = $row[
"ref_id"];
1976 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
1977 foreach($a_obj_ids as $obj_id)
1992 $set = $ilDB->query(
"SELECT COUNT(*) counter, MIN(tstamp) tstamp".
1993 " FROM obj_stat_log");
1994 return $ilDB->fetchAssoc($set);
2011 $sql =
"SELECT obj_id,".$column.
",".
2012 "MIN(mem_cnt) mem_cnt_min,AVG(mem_cnt) mem_cnt_avg, MAX(mem_cnt) mem_cnt_max,".
2013 "MIN(in_progress) in_progress_min,AVG(in_progress) in_progress_avg,MAX(in_progress) in_progress_max,".
2014 "MIN(completed) completed_min,AVG(completed) completed_avg,MAX(completed) completed_max,".
2015 "MIN(failed) failed_min,AVG(failed) failed_avg,MAX(failed) failed_max,".
2016 "MIN(not_attempted) not_attempted_min,AVG(not_attempted) not_attempted_avg,MAX(not_attempted) not_attempted_max".
2017 " FROM obj_lp_stat".
2018 " WHERE ".$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer").
2019 " AND yyyy = ".$ilDB->quote($a_year,
"integer");
2022 $sql .=
" AND mm = ".$ilDB->quote($a_month,
"integer");
2024 $sql .=
" GROUP BY obj_id,".$column;
2025 $set = $ilDB->query($sql);
2026 while(
$row = $ilDB->fetchAssoc($set))
2040 $a_year =
date(
"Y");
2043 $agg = strtoupper($a_aggregation);
2046 $sql =
"SELECT type,yyyy,mm,".$agg.
"(cnt_objects) cnt_objects,".$agg.
"(cnt_references) cnt_references,".
2047 "".$agg.
"(cnt_deleted) cnt_deleted FROM obj_type_stat".
2048 " WHERE yyyy = ".$ilDB->quote($a_year,
"integer").
2049 " GROUP BY type,yyyy,mm";
2050 $set = $ilDB->query($sql);
2051 while(
$row = $ilDB->fetchAssoc($set))
2053 $row[
"mm"] = str_pad(
$row[
"mm"], 2,
"0", STR_PAD_LEFT);
2055 "objects" => (
int)
$row[
"cnt_objects"],
2056 "references" => (
int)$row[
"cnt_references"],
2057 "deleted" => (
int)$row[
"cnt_deleted"]
const LP_STATUS_COMPLETED_NUM
static getObjectiveStatusForLP($a_user_id, $a_obj_id, array $a_objective_ids)
static refreshObjectsStatus(array $a_obj_ids, $a_users=null)
check whether status (for all relevant users) exists
static getInstanceByObjId($a_obj_id)
get singleton instance
static getObjectLPStatistics(array $a_obj_ids, $a_year, $a_month=null, $a_group_by_day=false)
const IL_CRS_VIEW_OBJECTIVE
For the purpose of streamlining the grading and learning-process status definition outside of tests...
static buildColumns(array &$a_fields, array $a_additional_fields=NULL, $a_aggregate=false)
Build sql from field definition.
static buildFilters(array $where, array $a_filters=NULL, $a_aggregate=false)
Build sql from filter definition.
static executeQueries(array $queries, $a_order_field="", $a_order_dir="", $a_offset=0, $a_limit=9999)
Execute given queries, including count query.
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...
static getObjectStatisticsMonthlySummary()
static getSummaryPercentages($field, $base_query, $alias=NULL)
Get aggregated data for field.
const LP_STATUS_NOT_ATTEMPTED
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
static getSubItemType($a_parent_obj_id)
Get sub-item object type for parent.
static deleteObjectStatistics(array $a_months)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
const LP_STATUS_IN_PROGRESS_NUM
const LP_MODE_COLLECTION_MANUAL
static _getObjectiveIds($course_id, $a_activated_only=false)
static getUDFAndHandlePrivacy(array &$a_result, array $a_udf=null, $a_check_agreement=null, array $a_privacy_fields=null, array $a_filters=null)
Handle privacy and add udf data to (user) result data.
const LP_MODE_COLLECTION_TLT
static getObjectsStatusForUser($a_user_id, array $obj_refs)
static _getTrackedUsers($a_obj_id)
Get all tracked users.
const LP_MODE_TEST_FINISHED
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
static _getAllReferences($a_id)
get all reference ids of object
const LP_STATUS_IN_PROGRESS
static _lookupObjectId($a_ref_id)
lookup object id
static _getClassById($a_obj_id, $a_mode=NULL)
static getObjectDailyStatistics(array $a_ref_ids, $a_year, $a_month=null)
static getSCOsStatusForUser($a_user_id, $a_parent_obj_id, array $a_sco_ids)
static getSubTree($a_parent_ref_id, array &$a_object_ids, array &$a_ref_ids)
Get complete branch of tree (recursively)
static getSubItemsStatusForUser($a_user_id, $a_parent_obj_id, array $a_item_ids)
Get subitems status.
static stableSortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false)
Sort an aray using a stable sort algorithm, which preveserves the sequence of array elements which h...
static getObjectAccessStatistics(array $a_ref_ids, $a_year, $a_month=null)
static getObjectsDataForUser($a_user_id, $a_parent_obj_id, $a_parent_ref_id, $a_order_field="", $a_order_dir="", $a_offset=0, $a_limit=9999, array $a_filters=NULL, array $a_additional_fields=NULL, $use_collection=true)
Get all object-based tracking data for user and parent object.
Class ilObjStudyProgramme.
static _lookupObjId($a_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static getObjectsSummaryForObject($a_parent_obj_id, $a_parent_ref_id, $a_order_field="", $a_order_dir="", $a_offset=0, $a_limit=9999, array $a_filters=NULL, array $a_additional_fields=NULL, $a_preselected_obj_ids=NULL)
Get all aggregated tracking data for parent object.
const LP_MODE_SURVEY_FINISHED
static getSessionData($a_user_id, array $obj_ids)
Get session data for given objects and user.
static _getInstance($a_obj_id, $a_mode=NULL)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
static getSummaryDataForObject($a_ref_id, array $fields, array $a_filters=NULL)
Get all aggregated tracking data for object.
static getObjectIds($a_parent_obj_id, $a_parent_ref_id=false, $use_collection=true, $a_refresh_status=true, $a_user_ids=null)
Get (sub)objects for given object, also handles learning objectives (course only) ...
static getUserObjectiveMatrix($a_parent_obj_id, $a_users)
const LP_STATUS_NOT_ATTEMPTED_NUM
static getUserDataForObject($a_ref_id, $a_order_field="", $a_order_dir="", $a_offset=0, $a_limit=9999, array $a_filters=NULL, array $a_additional_fields=NULL, $check_agreement=false, $privacy_fields=NULL)
Get all user-based tracking data for object.
static getObjectivesStatusForUser($a_user_id, $a_obj_id, array $a_objective_ids)
static getObjectTypeStatisticsPerMonth($a_aggregation, $a_year=null)
static getParticipantsForObject($a_ref_id)
Get participant ids for given object.
static searchObjects($a_type, $a_title=null, $a_root=null, $a_hidden=null, $a_preset_obj_ids=null)
const LP_MODE_COLLECTION_MOBS
static getPortfolios($a_title=null)
Class ilObjSCORM2004LearningModule.
static getUserObjectMatrix($a_parent_ref_id, $a_obj_ids, $a_user_filter=NULL, array $a_additional_fields=null, array $a_privacy_fields=null, $a_check_agreement=null)
Get status matrix for users on objects.
static getWorkspaceBlogs($a_title=null)
static getObjectTypeStatistics()
const LP_STATUS_COMPLETED
static getInstance($a_obj_id)
Class ilObjSCORMLearningModule.
static lookupAcceptedAgreements($a_obj_id)
Lookup users who have accepted the agreement.
static getObjectStatisticsLogInfo()
Get last update info for object statistics.
const LP_STATUS_FAILED_NUM