20 if (
sizeof($obj_refs)) {
21 $obj_ids = array_keys($obj_refs);
22 self::refreshObjectsStatus($obj_ids, array($a_user_id));
24 include_once
"Services/Object/classes/class.ilObjectLP.php";
25 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
28 include_once
'Modules/Course/classes/class.ilObjCourse.php';
29 $view_modes = array();
30 $query =
"SELECT obj_id, view_mode FROM crs_settings" .
31 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
false,
"integer");
33 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);
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") .
51 while ($rec =
$ilDB->fetchAssoc($set)) {
52 $rec[
"comment"] = $rec[
"u_comment"];
53 unset($rec[
"u_comment"]);
55 $rec[
"ref_ids"] = $obj_refs[(int) $rec[
"obj_id"]];
56 $rec[
"status"] = (int) $rec[
"status"];
57 $rec[
"percentage"] = (int) $rec[
"percentage"];
58 $rec[
"read_count"] = (int) $rec[
"read_count"];
59 $rec[
"spent_seconds"] = (int) $rec[
"spent_seconds"];
60 $rec[
"u_mode"] = (int) $rec[
"u_mode"];
62 if ($rec[
"type"] ==
"sess") {
63 $session = $sessions[$rec[
"obj_id"]];
71 } elseif (!$rec[
"u_mode"]) {
73 $rec[
"u_mode"] = $olp->getCurrentMode();
91 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
94 $query =
"SELECT crs_id, crs_objectives.objective_id AS obj_id, title," .
$ilDB->quote(
"lobj",
"text") .
" AS type" .
95 " FROM crs_objectives" .
96 " WHERE " .
$ilDB->in(
"crs_objectives.objective_id", $a_objective_ids,
false,
"integer") .
97 " AND active = " .
$ilDB->quote(1,
"integer") .
101 while ($rec =
$ilDB->fetchAssoc($set)) {
102 if (array_key_exists($rec[
"obj_id"], $lo_lp_status)) {
103 $rec[
"status"] = $lo_lp_status[$rec[
"obj_id"]];
115 self::refreshObjectsStatus(array($a_parent_obj_id), array($a_user_id));
118 $scores_raw = $scores = array();
119 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
125 include_once
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
127 $scores_raw =
$module->getTrackingDataAgg($a_user_id);
131 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
133 $scores_raw =
$module->getTrackingDataAgg($a_user_id);
137 foreach ($scores_raw as $item) {
138 $scores[$item[
"sco_id"]] = $item[
"score"];
144 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
148 foreach ($a_sco_ids as $sco_id) {
150 if (in_array($a_user_id, $status_info[
"failed"][$sco_id])) {
152 } elseif (in_array($a_user_id, $status_info[
"completed"][$sco_id])) {
154 } elseif (in_array($a_user_id, $status_info[
"in_progress"][$sco_id])) {
160 $items[$sco_id] = array(
161 "title" => $status_info[
"scos_title"][$sco_id],
164 "score" => (
int) $scores[$sco_id]
180 self::refreshObjectsStatus(array($a_parent_obj_id), array($a_user_id));
185 include_once
'./Services/Object/classes/class.ilObjectLP.php';
187 $collection = $olp->getCollectionInstance();
190 $ref_id = end($ref_ids);
191 $item_data = $collection->getPossibleItems($ref_id);
199 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
203 foreach ($a_item_ids as $item_id) {
204 if (!isset($item_data[$item_id])) {
208 if (in_array($a_user_id, $status_info[
"completed"][$item_id])) {
210 } elseif (in_array($a_user_id, $status_info[
"in_progress"][$item_id])) {
216 $items[$item_id] = array(
217 "title" => $item_data[$item_id][
"title"],
219 "type" => self::getSubItemType($a_parent_obj_id)
246 array $a_filters = null,
247 array $a_additional_fields = null,
248 $check_agreement =
false,
249 $privacy_fields = null
253 $ilDB = $DIC[
'ilDB'];
255 $fields = array(
"usr_data.usr_id",
"login",
"active");
256 $udf = self::buildColumns($fields, $a_additional_fields);
259 $where[] =
"usr_data.usr_id <> " .
$ilDB->quote(ANONYMOUS_USER_ID,
"integer");
263 $a_users = self::getParticipantsForObject($a_ref_id);
266 self::refreshObjectsStatus(array($obj_id), $a_users);
268 if (is_array($a_users)) {
270 $where[] =
$ilDB->in(
"usr_data.usr_id", $a_users,
false,
"integer");
273 $query =
" FROM usr_data " . $left .
" JOIN read_event ON (read_event.usr_id = usr_data.usr_id" .
274 " AND read_event.obj_id = " .
$ilDB->quote($obj_id,
"integer") .
")" .
275 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = usr_data.usr_id " .
276 " AND ut_lp_marks.obj_id = " .
$ilDB->quote($obj_id,
"integer") .
")" .
277 " LEFT JOIN usr_pref ON (usr_pref.usr_id = usr_data.usr_id AND keyword = " .
$ilDB->quote(
"language",
"text") .
")" .
278 self::buildFilters($where, $a_filters);
280 $queries = array(array(
"fields" => $fields,
"query" =>
$query));
283 if ($a_order_field ==
"language") {
284 $a_order_field =
"usr_pref.value";
289 if (!$a_order_field) {
290 $a_order_field =
"login";
291 } elseif (substr($a_order_field, 0, 4) ==
"udf_") {
292 $udf_order = $a_order_field;
293 $a_order_field = null;
296 $result = self::executeQueries($queries, $a_order_field, $a_order_dir, $a_offset, $a_limit);
298 self::getUDFAndHandlePrivacy(
$result, $udf, $check_agreement, $privacy_fields, $a_filters);
303 include_once
"Services/Utilities/classes/class.ilStr.php";
326 $a_check_agreement = null,
327 array $a_privacy_fields = null,
328 array $a_filters = null
332 $ilDB = $DIC[
'ilDB'];
334 if (!$a_result[
"cnt"]) {
338 if (is_array($a_udf) && count($a_udf) > 0) {
339 $query =
"SELECT usr_id, field_id, value FROM udf_text WHERE " .
$ilDB->in(
"field_id", $a_udf,
false,
"integer");
343 $udf[
$row[
"usr_id"]][
"udf_" .
$row[
"field_id"]] =
$row[
"value"];
348 if ($a_check_agreement) {
350 include_once
"Services/Membership/classes/class.ilMemberAgreement.php";
354 $query =
"SELECT usr_id FROM usr_pref WHERE keyword = " .
$ilDB->quote(
"public_profile",
"text") .
355 " AND value = " .
$ilDB->quote(
"y",
"text") .
" OR value = " .
$ilDB->quote(
"g",
"text");
357 $all_public = array();
359 $all_public[] =
$row[
"usr_id"];
361 $query =
"SELECT usr_id,keyword FROM usr_pref WHERE " .
$ilDB->like(
"keyword",
"text",
"public_%",
false) .
362 " AND value = " .
$ilDB->quote(
"y",
"text") .
" AND " .
$ilDB->in(
"usr_id", $all_public,
"",
"integer");
366 $public[
$row[
"usr_id"]][] = substr($row[
"keyword"], 7);
371 foreach ($a_result[
"set"] as $idx =>
$row) {
373 if (isset($udf[
$row[
"usr_id"]])) {
374 $a_result[
"set"][$idx] = $row = array_merge($row, $udf[$row[
"usr_id"]]);
378 if (
sizeof($a_privacy_fields) && $a_check_agreement && !in_array($row[
"usr_id"], $agreements)) {
379 foreach ($a_privacy_fields as $field) {
381 if (isset($row[$field]) && (!isset($public[$row[
"usr_id"]]) ||
382 !in_array($field, $public[$row[
"usr_id"]]))) {
384 if (isset($a_filters[$field])) {
386 foreach (array_keys($row) as $col_id) {
387 $a_result[
"set"][$idx][$col_id] = null;
389 $a_result[
"set"][$idx][
"privacy_conflict"] =
true;
395 $a_result[
"set"][$idx][$field] =
false;
428 array $a_filters = null,
429 array $a_additional_fields = null,
430 $use_collection =
true 434 $ilDB = $DIC[
'ilDB'];
436 $fields = array(
"object_data.obj_id",
"title",
"type");
437 self::buildColumns($fields, $a_additional_fields);
439 $objects = self::getObjectIds($a_parent_obj_id, $a_parent_ref_id, $use_collection,
true, array($a_user_id));
441 $query =
" FROM object_data LEFT JOIN read_event ON (object_data.obj_id = read_event.obj_id AND" .
442 " read_event.usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
")" .
443 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
" AND" .
444 " ut_lp_marks.obj_id = object_data.obj_id)" .
445 " WHERE " .
$ilDB->in(
"object_data.obj_id", $objects[
"object_ids"],
false,
"integer") .
446 self::buildFilters(array(), $a_filters);
449 $queries[] = array(
"fields" => $fields,
"query" =>
$query);
451 if (!in_array($a_order_field, $fields)) {
452 $a_order_field =
"title";
455 $result = self::executeQueries($queries, $a_order_field, $a_order_dir, $a_offset, $a_limit);
458 $sessions = self::getSessionData($a_user_id, $objects[
"object_ids"]);
460 foreach (
$result[
"set"] as $idx => $item) {
461 if ($item[
"type"] ==
"sess") {
462 $session = $sessions[$item[
"obj_id"]];
468 $result[
"set"][$idx][
"ref_id"] = $objects[
"ref_ids"][$item[
"obj_id"]];
472 if ($objects[
"scorm"]) {
473 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
475 if ($subtype ==
"scorm2004") {
476 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
478 $scos_tracking = $sobj->getTrackingDataAgg($a_user_id,
true);
480 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
482 $scos_tracking = array();
483 foreach ($sobj->getTrackingDataAgg($a_user_id) as $item) {
486 $time = explode(
":", $item[
"time"]);
489 $scos_tracking[$item[
"sco_id"]] = array(
"session_time" => $item[
"time"]);
493 foreach ($objects[
"scorm"][
"scos"] as $sco) {
494 $row = array(
"title" => $objects[
"scorm"][
"scos_title"][$sco],
498 if (in_array($a_user_id, $objects[
"scorm"][
"completed"][$sco])) {
500 } elseif (in_array($a_user_id, $objects[
"scorm"][
"failed"][$sco])) {
502 } elseif (in_array($a_user_id, $objects[
"scorm"][
"in_progress"][$sco])) {
505 $row[
"status"] = $status;
508 if (isset($scos_tracking[$sco])) {
509 if (isset($scos_tracking[$sco][
"last_access"])) {
513 $row[
"spent_seconds"] = $scos_tracking[$sco][
"session_time"];
522 if ($objects[
"objectives_parent_id"]) {
523 include_once
"Modules/Course/classes/class.ilCourseObjective.php";
524 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
526 foreach (self::getObjectivesStatusForUser($a_user_id, $objects[
"objectives_parent_id"], $objtv_ids) as $item) {
533 if ($objects[
"subitems"]) {
534 $sub_type = self::getSubItemType($a_parent_obj_id);
535 foreach ($objects[
"subitems"][
"items"] as $item_id) {
536 $row = array(
"title" => $objects[
"subitems"][
"item_titles"][$item_id],
537 "type" => $sub_type);
540 if (in_array($a_user_id, $objects[
"subitems"][
"completed"][$item_id])) {
543 $row[
"status"] = $status;
580 $ilDB = $DIC[
'ilDB'];
582 $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," .
585 " JOIN event_appointment ON (event.obj_id = event_appointment.event_id)" .
586 " LEFT JOIN event_participants ON (event_participants.event_id = event.obj_id AND usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
")" .
587 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
false,
"integer");
590 while ($rec =
$ilDB->fetchAssoc($set)) {
591 $rec[
"comment"] = $rec[
"e_comment"];
592 unset($rec[
"e_comment"]);
600 $rec[
"title"] = $date .
': ' . $rec[
"title"];
602 $rec[
"title"] = $date;
604 $sessions[$rec[
"obj_id"]] = $rec;
632 array $a_filters = null,
633 array $a_additional_fields = null,
634 $a_preselected_obj_ids = null
638 $ilDB = $DIC[
'ilDB'];
641 self::buildColumns($fields, $a_additional_fields,
true);
644 if ($a_preselected_obj_ids === null) {
645 $objects = self::getObjectIds($a_parent_obj_id, $a_parent_ref_id,
false,
false);
647 foreach ($a_preselected_obj_ids as $obj_id => $ref_ids) {
648 $objects[
"object_ids"][] = $obj_id;
649 $objects[
"ref_ids"][$obj_id] = array_pop($ref_ids);
656 $set =
$ilDB->query(
"SELECT obj_id,title,type FROM object_data" .
657 " WHERE " .
$ilDB->in(
"obj_id", $objects[
"object_ids"],
false,
"integer"));
658 while ($rec =
$ilDB->fetchAssoc($set)) {
659 $object_data[$rec[
"obj_id"]] = $rec;
660 if ($a_preselected_obj_ids) {
661 $object_data[$rec[
"obj_id"]][
"ref_ids"] = $a_preselected_obj_ids[$rec[
"obj_id"]];
663 $object_data[$rec[
"obj_id"]][
"ref_ids"] = array($objects[
"ref_ids"][$rec[
"obj_id"]]);
667 foreach ($objects[
"ref_ids"] as $object_id => $ref_id) {
668 $object_result = self::getSummaryDataForObject($ref_id, $fields, $a_filters);
669 if (
sizeof($object_result)) {
670 if ($object_data[$object_id]) {
671 $result[] = array_merge($object_data[$object_id], $object_result);
677 if ($objects[
"objectives_parent_id"]) {
696 $ilDB = $DIC[
'ilDB'];
699 $where[] =
"usr_data.usr_id <> " .
$ilDB->quote(ANONYMOUS_USER_ID,
"integer");
702 $a_users = self::getParticipantsForObject($a_ref_id);
705 if (is_array($a_users)) {
707 $where[] =
$ilDB->in(
"usr_data.usr_id", $a_users,
false,
"integer");
711 self::refreshObjectsStatus(array($obj_id), $a_users);
713 $query =
" FROM usr_data " . $left .
" JOIN read_event ON (read_event.usr_id = usr_data.usr_id" .
714 " AND obj_id = " .
$ilDB->quote($obj_id,
"integer") .
")" .
715 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = usr_data.usr_id " .
716 " AND ut_lp_marks.obj_id = " .
$ilDB->quote($obj_id,
"integer") .
")" .
717 " LEFT JOIN usr_pref ON (usr_pref.usr_id = usr_data.usr_id AND keyword = " .
$ilDB->quote(
"language",
"text") .
")" .
718 self::buildFilters($where, $a_filters,
true);
720 $fields[] =
'COUNT(usr_data.usr_id) AS user_count';
723 $queries[] = array(
"fields" => $fields,
"query" =>
$query,
"count" =>
"*");
725 $result = self::executeQueries($queries);
727 $users_no =
$result[
"user_count"];
732 } elseif (isset($a_filters[
"user_total"])) {
733 if ($a_filters[
"user_total"][
"from"] && $users_no < $a_filters[
"user_total"][
"from"]) {
735 } elseif ($a_filters[
"user_total"][
"to"] && $users_no > $a_filters[
"user_total"][
"to"]) {
741 $result[
"country"] = self::getSummaryPercentages(
"country",
$query);
742 $result[
"sel_country"] = self::getSummaryPercentages(
"sel_country",
$query);
743 $result[
"city"] = self::getSummaryPercentages(
"city",
$query);
744 $result[
"gender"] = self::getSummaryPercentages(
"gender",
$query);
745 $result[
"language"] = self::getSummaryPercentages(
"usr_pref.value",
$query,
"language");
746 $result[
"status"] = self::getSummaryPercentages(
"status",
$query);
747 $result[
"mark"] = self::getSummaryPercentages(
"mark",
$query);
753 $result[
"user_total"] = $users_no;
771 $ilDB = $DIC[
'ilDB'];
774 $field_alias = $field;
776 $field_alias = $alias;
777 $alias =
" AS " . $alias;
782 if (preg_match(
"/" . preg_quote(
" [[--HAVING") .
"(.+)" . preg_quote(
"HAVING--]]") .
"/", $base_query, $hits)) {
783 $having =
" HAVING " . $hits[1];
784 $base_query = str_replace($hits[0],
"", $base_query);
787 $query =
"SELECT COUNT(*) AS counter, " . $field . $alias .
" " . $base_query .
" GROUP BY " . $field . $having .
" ORDER BY counter DESC";
790 while ($rec =
$ilDB->fetchAssoc($set)) {
791 $result[$rec[$field_alias]] = (int) $rec[
"counter"];
806 $tree = $DIC[
'tree'];
814 $members_read =
false;
818 $members_read =
true;
820 $members = $member_obj->getMembers();
828 $members_read =
true;
829 include_once(
"Modules/IndividualAssessment/classes/class.ilObjIndividualAssessment.php");
831 $members = $iass->loadMembers()->membersIds();
838 foreach (array_reverse(
$path) as $path_ref_id) {
841 $members_read =
true;
842 $members = self::getParticipantsForObject($path_ref_id);
850 return $GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
851 'read_learning_progress',
852 'read_learning_progress',
863 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
865 if ($subtype ==
"scorm2004") {
867 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
869 $all = $mod->getTrackedUsers(
"");
872 foreach ($all as $item) {
873 $a_users[] = $item[
"user_id"];
877 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
883 include_once(
"./Modules/Exercise/classes/class.ilExerciseMembers.php");
884 include_once(
"./Modules/Exercise/classes/class.ilObjExercise.php");
887 $a_users = $members->getMembers();
891 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
893 $a_users = $class::getParticipants($obj_id);
897 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
899 $a_users = $class::getParticipants($obj_id);
903 include_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
905 $a_users = $prg->getIdsOfUsersWithRelevantProgress();
912 if (is_null($a_users)) {
917 return $GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
918 'read_learning_progress',
919 'read_learning_progress',
933 protected static function buildFilters(array $where, array $a_filters = null, $a_aggregate =
false)
937 $ilDB = $DIC[
'ilDB'];
941 if (is_array($a_filters) &&
sizeof($a_filters) > 0) {
942 foreach ($a_filters as
$id => $value) {
951 case "matriculation":
955 $where[] =
$ilDB->like(
"usr_data." .
$id,
"text",
"%" . $value .
"%");
961 $where[] =
"usr_data." .
$id .
" = " .
$ilDB->quote($value,
"text");
965 $where[] =
$ilDB->like(
"ut_lp_marks." .
$id,
"text",
"%" . $value .
"%");
972 " OR ut_lp_marks.status IS NULL)";
979 $where[] =
"ut_lp_marks." .
$id .
" = " .
$ilDB->quote($value,
"text");
984 if ($value[
"from"]) {
985 $where[] =
"ut_lp_marks." .
$id .
" >= " .
$ilDB->quote($value[
"from"],
"integer");
988 $where[] =
"(ut_lp_marks." .
$id .
" <= " .
$ilDB->quote($value[
"to"],
"integer") .
989 " OR ut_lp_marks." .
$id .
" IS NULL)";
992 if ($value[
"from"]) {
993 $having[] =
"ROUND(AVG(ut_lp_marks." .
$id .
")) >= " .
$ilDB->quote($value[
"from"],
"integer");
996 $having[] =
"ROUND(AVG(ut_lp_marks." .
$id .
")) <= " .
$ilDB->quote($value[
"to"],
"integer");
1002 $where[] =
"usr_pref.value = " .
$ilDB->quote($value,
"text");
1007 if ($value[
"from"]) {
1008 $value[
"from"] = substr($value[
"from"], 0, -2) .
"00";
1010 $value[
"from"] = $value[
"from"]->get(
IL_CAL_UNIX);
1013 if (strlen($value[
"to"]) == 19) {
1014 $value[
"to"] = substr($value[
"to"], 0, -2) .
"59";
1022 case 'status_changed':
1025 case "registration":
1026 if (
$id ==
"registration") {
1027 $id =
"create_date";
1033 case "first_access":
1035 if ($value[
"from"]) {
1036 $where[] =
$id .
" >= " .
$ilDB->quote($value[
"from"],
"date");
1039 if (strlen($value[
"to"]) == 19) {
1040 $value[
"to"] = substr($value[
"to"], 0, -2) .
"59";
1042 $where[] =
$id .
" <= " .
$ilDB->quote($value[
"to"],
"date");
1047 if (!$a_aggregate) {
1048 if ($value[
"from"]) {
1049 $where[] =
"(read_event." .
$id .
"+read_event.childs_" .
$id .
") >= " .
$ilDB->quote($value[
"from"],
"integer");
1052 $where[] =
"((read_event." .
$id .
"+read_event.childs_" .
$id .
") <= " .
$ilDB->quote($value[
"to"],
"integer") .
1053 " OR (read_event." .
$id .
"+read_event.childs_" .
$id .
") IS NULL)";
1056 if ($value[
"from"]) {
1057 $having[] =
"SUM(read_event." .
$id .
"+read_event.childs_" .
$id .
") >= " .
$ilDB->quote($value[
"from"],
"integer");
1060 $having[] =
"SUM(read_event." .
$id .
"+read_event.childs_" .
$id .
") <= " .
$ilDB->quote($value[
"to"],
"integer");
1065 case "spent_seconds":
1066 if (!$a_aggregate) {
1067 if ($value[
"from"]) {
1068 $where[] =
"(read_event." .
$id .
"+read_event.childs_" .
$id .
") >= " .
$ilDB->quote($value[
"from"],
"integer");
1071 $where[] =
"((read_event." .
$id .
"+read_event.childs_" .
$id .
") <= " .
$ilDB->quote($value[
"to"],
"integer") .
1072 " OR (read_event." .
$id .
"+read_event.childs_" .
$id .
") IS NULL)";
1075 if ($value[
"from"]) {
1076 $having[] =
"ROUND(AVG(read_event." .
$id .
"+read_event.childs_" .
$id .
")) >= " .
$ilDB->quote($value[
"from"],
"integer");
1079 $having[] =
"ROUND(AVG(read_event." .
$id .
"+read_event.childs_" .
$id .
")) <= " .
$ilDB->quote($value[
"to"],
"integer");
1092 if (
sizeof($where)) {
1093 $sql .=
" WHERE " . implode(
" AND ", $where);
1095 if (
sizeof($having)) {
1097 $sql .=
" [[--HAVING " . implode(
" AND ", $having) .
"HAVING--]]";
1111 protected static function buildColumns(array &$a_fields, array $a_additional_fields = null, $a_aggregate =
false)
1113 if (
sizeof($a_additional_fields)) {
1115 foreach ($a_additional_fields as $field) {
1116 if (substr($field, 0, 4) !=
"udf_") {
1119 $pos = strrpos($field,
"_");
1120 if ($pos ===
false) {
1123 $function = strtoupper(substr($field, $pos + 1));
1124 $field = substr($field, 0, $pos);
1125 if (!in_array($function, array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT"))) {
1136 $a_fields[] = $function .
"(value) " . $field .
"_" . strtolower($function);
1138 $a_fields[] =
"value as " . $field;
1143 case "spent_seconds":
1145 $a_fields[] =
"(" . $field .
"+childs_" . $field .
") " . $field;
1147 if ($function ==
"AVG") {
1148 $a_fields[] =
"ROUND(AVG(" . $field .
"+childs_" . $field .
"), 2) " . $field .
"_" . strtolower($function);
1150 $a_fields[] = $function .
"(COALESCE(" . $field .
", 0) + COALESCE(childs_" . $field .
", 0)) " . $field .
"_" . strtolower($function);
1155 case "read_count_spent_seconds":
1156 if ($function ==
"AVG") {
1157 $a_fields[] =
"ROUND(AVG((spent_seconds+childs_spent_seconds)/(read_count+childs_read_count)), 2) " . $field .
"_" . strtolower($function);
1163 if ($function ==
"AVG") {
1164 $a_fields[] =
"ROUND(AVG(" . $field .
"), 2) " . $field .
"_" . strtolower($function);
1166 $a_fields[] = $function .
"(" . $field .
") " . $field .
"_" . strtolower($function);
1169 $a_fields[] = $field;
1174 $udf[] = substr($field, 4);
1179 $a_fields = array_unique($a_fields);
1180 if (is_array($udf)) {
1181 $udf = array_unique($udf);
1198 public static function getObjectIds($a_parent_obj_id, $a_parent_ref_id =
false, $use_collection =
true, $a_refresh_status =
true, $a_user_ids = null)
1200 include_once
"Services/Object/classes/class.ilObjectLP.php";
1202 $object_ids = array($a_parent_obj_id);
1203 $ref_ids = array($a_parent_obj_id => $a_parent_ref_id);
1204 $objectives_parent_id = $scorm = $subitems =
false;
1207 $mode = $olp->getCurrentMode();
1211 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
1213 $scorm = $status_scorm::_getStatusInfo($a_parent_obj_id);
1218 $objectives_parent_id = $a_parent_obj_id;
1225 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
1227 $subitems = $status_coll_tlt::_getStatusInfo($a_parent_obj_id);
1232 if ($use_collection) {
1233 $collection = $olp->getCollectionInstance();
1235 foreach ($collection->getItems() as $child_ref_id) {
1237 $object_ids[] = $child_id;
1238 $ref_ids[$child_id] = $child_ref_id;
1244 self::getSubTree($a_parent_ref_id, $object_ids, $ref_ids);
1245 $object_ids = array_unique($object_ids);
1248 foreach ($object_ids as $idx => $object_id) {
1250 unset($object_ids[$idx]);
1256 if ($a_refresh_status) {
1257 self::refreshObjectsStatus($object_ids, $a_user_ids);
1260 return array(
"object_ids" => $object_ids,
1261 "ref_ids" => $ref_ids,
1262 "objectives_parent_id" => $objectives_parent_id,
1264 "subitems" => $subitems);
1274 protected static function getSubTree($a_parent_ref_id, array &$a_object_ids, array &$a_ref_ids)
1278 $tree = $DIC[
'tree'];
1280 $children =
$tree->getChilds($a_parent_ref_id);
1282 foreach ($children as $child) {
1283 if ($child[
"type"] ==
"adm" || $child[
"type"] ==
"rolf") {
1291 $cmode = $olp->getCurrentMode();
1307 $a_object_ids[] = $child[
"obj_id"];
1308 $a_ref_ids[$child[
"obj_id"]] = $child[
"ref_id"];
1311 self::getSubTree($child[
"ref_id"], $a_object_ids, $a_ref_ids);
1326 public static function executeQueries(array $queries, $a_order_field =
"", $a_order_dir =
"", $a_offset = 0, $a_limit = 9999)
1330 $ilDB = $DIC[
'ilDB'];
1333 $subqueries = array();
1334 foreach ($queries as $item) {
1336 $item = str_replace(
"[[--HAVING",
"HAVING", $item);
1337 $item = str_replace(
"HAVING--]]",
"", $item);
1339 if (!isset($item[
"count"])) {
1340 $count_field = $item[
"fields"];
1341 $count_field = array_shift($count_field);
1343 $count_field = $item[
"count"];
1345 $count_query =
"SELECT COUNT(" . $count_field .
") AS cnt" . $item[
"query"];
1346 $set =
$ilDB->query($count_query);
1347 if ($rec =
$ilDB->fetchAssoc($set)) {
1348 $cnt += $rec[
"cnt"];
1351 $subqueries[] =
"SELECT " . implode(
",", $item[
"fields"]) . $item[
"query"];
1357 if (
sizeof($subqueries) > 1) {
1358 $base = array_shift($subqueries);
1359 $query =
$base .
" UNION (" . implode(
") UNION (", $subqueries) .
")";
1364 if ($a_order_dir !=
"asc" && $a_order_dir !=
"desc") {
1365 $a_order_dir =
"asc";
1367 if ($a_order_field) {
1368 $query .=
" ORDER BY " . $a_order_field .
" " . strtoupper($a_order_dir);
1371 $offset = (int) $a_offset;
1372 $limit = (int) $a_limit;
1373 $ilDB->setLimit($limit, $offset);
1376 while ($rec =
$ilDB->fetchAssoc($set)) {
1381 return array(
"cnt" => $cnt,
"set" =>
$result);
1398 $a_user_filter = null,
1399 array $a_additional_fields = null,
1400 array $a_privacy_fields = null,
1401 $a_check_agreement = null
1405 $ilDB = $DIC[
'ilDB'];
1407 $result = array(
"cnt" => 0,
"set" => null);
1408 if (
sizeof($a_obj_ids)) {
1410 $where[] =
"usr_data.usr_id <> " .
$ilDB->quote(ANONYMOUS_USER_ID,
"integer");
1411 if ($a_user_filter) {
1412 $where[] =
$ilDB->like(
"usr_data.login",
"text",
"%" . $a_user_filter .
"%");
1417 $a_users = self::getParticipantsForObject($a_parent_ref_id);
1418 if (is_array($a_users)) {
1420 $where[] =
$ilDB->in(
"usr_data.usr_id", $a_users,
false,
"integer");
1424 self::refreshObjectsStatus($a_obj_ids, $a_users);
1426 $fields = array(
"usr_data.usr_id",
"login",
"active");
1427 $udf = self::buildColumns($fields, $a_additional_fields);
1429 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
1432 $fields[] =
"percentage";
1435 foreach ($a_obj_ids as $obj_id) {
1437 $query =
" FROM usr_data " . $left .
" JOIN read_event ON (read_event.usr_id = usr_data.usr_id" .
1438 " AND read_event.obj_id = " .
$ilDB->quote($obj_id,
"integer") .
")" .
1439 " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = usr_data.usr_id " .
1440 " AND ut_lp_marks.obj_id = " .
$ilDB->quote($obj_id,
"integer") .
")" .
1441 " LEFT JOIN usr_pref ON (usr_pref.usr_id = usr_data.usr_id AND keyword = " .
$ilDB->quote(
"language",
"text") .
")" .
1442 self::buildFilters($where);
1444 $raw = self::executeQueries(array(array(
"fields" => $fields,
"query" =>
$query)),
"login");
1447 foreach ($raw[
"set"] as
$row) {
1448 $result[
"set"][$row[
"usr_id"]][
"login"] = $row[
"login"];
1449 $result[
"set"][$row[
"usr_id"]][
"usr_id"] = $row[
"usr_id"];
1452 $result[
"set"][$row[
"usr_id"]][
"obj_" . $obj_id] = $row[
"status"];
1453 $result[
"set"][$row[
"usr_id"]][
"obj_" . $obj_id .
"_perc"] = $row[
"percentage"];
1454 if ($obj_id == $parent_obj_id) {
1455 $result[
"set"][$row[
"usr_id"]][
"status_changed"] = $row[
"status_changed"];
1456 $result[
"set"][$row[
"usr_id"]][
"last_access"] = $row[
"last_access"];
1457 $result[
"set"][$row[
"usr_id"]][
"spent_seconds"] = $row[
"spent_seconds"];
1458 $result[
"set"][$row[
"usr_id"]][
"read_count"] = $row[
"read_count"];
1461 foreach ($fields as $field) {
1463 if (stristr($field,
"language")) {
1464 $field =
"language";
1467 if (isset($row[$field])) {
1469 if ($obj_id == $parent_obj_id ||
1470 !in_array($field, array(
"mark",
"u_comment"))) {
1471 $result[
"set"][$row[
"usr_id"]][$field] = $row[$field];
1480 if (is_array(
$result[
"set"])) {
1485 self::getUDFAndHandlePrivacy(
$result, $udf, $a_check_agreement, $a_privacy_fields, $a_additional_fields);
1494 $ilDB = $DIC[
'ilDB'];
1496 if ($a_parent_obj_id && $a_users) {
1499 include_once
"Services/Tracking/classes/class.ilLPStatus.php";
1500 include_once
"Modules/Course/classes/Objectives/class.ilLOUserResults.php";
1501 include_once
"Modules/Course/classes/class.ilCourseObjective.php";
1505 include_once
"Modules/Course/classes/Objectives/class.ilLOSettings.php";
1507 $initial_qualifying = $lo_set->isInitialTestQualifying();
1510 foreach ($objective_ids as $objective_id) {
1511 foreach ($a_users as $user_id) {
1516 $query =
"SELECT * FROM loc_user_results" .
1517 " WHERE " .
$ilDB->in(
"objective_id", $objective_ids,
"",
"integer") .
1518 " AND " .
$ilDB->in(
"user_id", $a_users,
"",
"integer");
1519 if (!(
bool) $initial_qualifying) {
1522 $query .=
" ORDER BY type";
1524 while (
$row =
$ilDB->fetchAssoc($set)) {
1525 $objective_id =
$row[
"objective_id"];
1526 $user_id =
$row[
"user_id"];
1534 $res[$user_id][$objective_id] =
$row[
"is_final"]
1548 $ilDB = $DIC[
'ilDB'];
1550 $obj_ids = array_keys($a_ref_ids);
1559 $sql =
"SELECT obj_id," . $column .
",SUM(read_count) read_count,SUM(childs_read_count) childs_read_count," .
1560 "SUM(spent_seconds) spent_seconds,SUM(childs_spent_seconds) childs_spent_seconds" .
1562 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
"",
"integer") .
1563 " AND yyyy = " .
$ilDB->quote($a_year,
"integer");
1565 $sql .=
" AND mm = " .
$ilDB->quote($a_month,
"integer");
1567 $sql .=
" GROUP BY obj_id," . $column;
1568 $set =
$ilDB->query($sql);
1569 while (
$row =
$ilDB->fetchAssoc($set)) {
1570 $row[
"read_count"] +=
$row[
"childs_read_count"];
1571 $row[
"spent_seconds"] +=
$row[
"childs_spent_seconds"];
1572 $res[
$row[
"obj_id"]][
$row[$column]][
"read_count"] += $row[
"read_count"];
1573 $res[$row[
"obj_id"]][$row[$column]][
"spent_seconds"] += $row[
"spent_seconds"];
1579 $sql =
"SELECT obj_id," . $column .
",SUM(counter) counter" .
1580 " FROM obj_user_stat" .
1581 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
"",
"integer") .
1582 " AND yyyy = " .
$ilDB->quote($a_year,
"integer");
1584 $sql .=
" AND mm = " .
$ilDB->quote($a_month,
"integer");
1586 $sql .=
" GROUP BY obj_id," . $column;
1587 $set =
$ilDB->query($sql);
1588 while (
$row =
$ilDB->fetchAssoc($set)) {
1589 $res[
$row[
"obj_id"]][
$row[$column]][
"users"] += $row[
"counter"];
1599 $ilDB = $DIC[
'ilDB'];
1600 $objDefinition = $DIC[
'objDefinition'];
1606 include_once
"Services/Tree/classes/class.ilTree.php";
1608 $sql =
"SELECT " .
$tree->table_obj_data .
".obj_id," .
$tree->table_obj_data .
".type," .
1609 $tree->table_tree .
"." .
$tree->tree_pk .
"," .
$tree->table_obj_reference .
".ref_id" .
1610 " FROM " .
$tree->table_tree .
1611 " " .
$tree->buildJoin() .
1612 " WHERE " .
$ilDB->in(
$tree->table_obj_data .
".type", $types,
"",
"text");
1613 $set =
$ilDB->query($sql);
1615 while (
$row =
$ilDB->fetchAssoc($set)) {
1616 $res[
$row[
"type"]][
"type"] = $row[
"type"];
1617 $res[$row[
"type"]][
"references"]++;
1618 $res[$row[
"type"]][
"objects"][] = $row[
"obj_id"];
1619 if ($row[
$tree->tree_pk] < 0) {
1620 $res[$row[
"type"]][
"deleted"]++;
1629 foreach (self::getPortfolios() as $obj_id) {
1630 $res[
"prtf"][
"type"] =
"prtf";
1631 $res[
"prtf"][
"references"]++;
1632 $res[
"prtf"][
"objects"]++;
1635 foreach (self::getWorkspaceBlogs() as $obj_id) {
1636 $res[
"blog"][
"type"] =
"blog";
1637 $res[
"blog"][
"references"]++;
1638 $res[
"blog"][
"objects"]++;
1648 $ilDB = $DIC[
'ilDB'];
1653 $sql =
"SELECT od.obj_id,oref.wsp_id,od.type" .
1654 " FROM tree_workspace wst" .
1655 " JOIN object_reference_ws oref ON (oref.wsp_id = wst.child)" .
1656 " JOIN object_data od ON (oref.obj_id = od.obj_id)" .
1657 " WHERE od.type = " .
$ilDB->quote(
"blog",
"text");
1660 $sql .=
" AND " .
$ilDB->like(
"od.title",
"text",
"%" . $a_title .
"%");
1663 $set =
$ilDB->query($sql);
1664 while (
$row =
$ilDB->fetchAssoc($set)) {
1675 $ilDB = $DIC[
'ilDB'];
1679 $sql =
"SELECT od.obj_id" .
1680 " FROM usr_portfolio prtf" .
1681 " JOIN object_data od ON (od.obj_id = prtf.id)";
1684 $sql .=
" WHERE " .
$ilDB->like(
"od.title",
"text",
"%" . $a_title .
"%");
1687 $set =
$ilDB->query($sql);
1688 while (
$row =
$ilDB->fetchAssoc($set)) {
1699 $ilDB = $DIC[
'ilDB'];
1701 $obj_ids = array_keys($a_ref_ids);
1704 $sql =
"SELECT obj_id,hh,SUM(read_count) read_count,SUM(childs_read_count) childs_read_count," .
1705 "SUM(spent_seconds) spent_seconds,SUM(childs_spent_seconds) childs_spent_seconds" .
1707 " WHERE " .
$ilDB->in(
"obj_id", $obj_ids,
"",
"integer") .
1708 " AND yyyy = " .
$ilDB->quote($a_year,
"integer");
1710 $sql .=
" AND mm = " .
$ilDB->quote($a_month,
"integer");
1712 $sql .=
" GROUP BY obj_id,hh";
1713 $set =
$ilDB->query($sql);
1714 while (
$row =
$ilDB->fetchAssoc($set)) {
1715 $row[
"read_count"] +=
$row[
"childs_read_count"];
1716 $row[
"spent_seconds"] +=
$row[
"childs_spent_seconds"];
1717 $res[
$row[
"obj_id"]][(int)
$row[
"hh"]][
"read_count"] +=
$row[
"read_count"];
1718 $res[
$row[
"obj_id"]][(int)
$row[
"hh"]][
"spent_seconds"] +=
$row[
"spent_seconds"];
1727 $ilDB = $DIC[
'ilDB'];
1729 $set =
$ilDB->query(
"SELECT COUNT(*) AS COUNTER,yyyy,mm" .
1731 " GROUP BY yyyy, mm" .
1732 " ORDER BY yyyy DESC, mm DESC");
1734 while (
$row =
$ilDB->fetchAssoc($set)) {
1735 $res[] = array(
"month" =>
$row[
"yyyy"] .
"-" .
$row[
"mm"],
1736 "count" => $row[
"counter"]);
1745 $ilDB = $DIC[
'ilDB'];
1748 $date_compare =
$ilDB->in(
$ilDB->concat(array(array(
"yyyy",
""),
1749 array(
$ilDB->quote(
"-",
"text"),
""),
1750 array(
"mm",
""))), $a_months,
"",
"text");
1751 $sql =
"DELETE FROM obj_stat" .
1752 " WHERE " . $date_compare;
1753 $ilDB->manipulate($sql);
1756 $tables = array(
"obj_lp_stat",
"obj_type_stat",
"obj_user_stat");
1757 foreach ($a_months as $month) {
1758 $year = substr($month, 0, 4);
1759 $month = substr($month, 5);
1760 $from = $year . str_pad($month, 2,
"0", STR_PAD_LEFT) .
"01";
1761 $to = $year . str_pad($month, 2,
"0", STR_PAD_LEFT) .
"31";
1763 foreach ($tables as
$table) {
1764 $sql =
"DELETE FROM " . $table .
1765 " WHERE fulldate >= " .
$ilDB->quote(
$from,
"integer") .
1766 " AND fulldate <= " .
$ilDB->quote($to,
"integer");
1767 $ilDB->manipulate($sql);
1772 public static function searchObjects(
$a_type, $a_title = null, $a_root = null, $a_hidden = null, $a_preset_obj_ids = null)
1776 $ilDB = $DIC[
'ilDB'];
1777 $tree = $DIC[
'tree'];
1780 $a_type = array(
'lm',
'sahs',
'htlm');
1783 $sql =
"SELECT r.ref_id,r.obj_id" .
1784 " FROM object_data o" .
1785 " JOIN object_reference r ON (o.obj_id = r.obj_id)" .
1786 " JOIN tree t ON (t.child = r.ref_id)" .
1787 " WHERE t.tree = " .
$ilDB->quote(1,
"integer");
1790 $sql .=
" AND o.type = " .
$ilDB->quote(
$a_type,
"text");
1792 $sql .=
" AND " .
$ilDB->in(
"o.type",
$a_type,
"",
"text");
1796 $sql .=
" AND (" .
$ilDB->like(
"o.title",
"text",
"%" . $a_title .
"%") .
1797 " OR " .
$ilDB->like(
"o.description",
"text",
"%" . $a_title .
"%") .
")";
1800 if (is_array($a_hidden)) {
1801 $sql .=
" AND " .
$ilDB->in(
"o.obj_id", $a_hidden,
true,
"integer");
1804 if (is_array($a_preset_obj_ids)) {
1805 $sql .=
" AND " .
$ilDB->in(
"o.obj_id", $a_preset_obj_ids,
false,
"integer");
1808 $set =
$ilDB->query($sql);
1810 while (
$row =
$ilDB->fetchAssoc($set)) {
1811 if ($a_root && $a_root != ROOT_FOLDER_ID) {
1813 if (
$tree->isGrandChild($a_root, $ref_id)) {
1814 $res[
$row[
"obj_id"]][] = $row[
"ref_id"];
1819 $res[
$row[
"obj_id"]][] = $row[
"ref_id"];
1833 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
1834 foreach ($a_obj_ids as $obj_id) {
1848 $ilDB = $DIC[
'ilDB'];
1850 $set =
$ilDB->query(
"SELECT COUNT(*) counter, MIN(tstamp) tstamp" .
1851 " FROM obj_stat_log");
1852 return $ilDB->fetchAssoc($set);
1859 $ilDB = $DIC[
'ilDB'];
1861 if ($a_group_by_day) {
1864 $column =
"mm,yyyy";
1868 $sql =
"SELECT obj_id," . $column .
"," .
1869 "MIN(mem_cnt) mem_cnt_min,AVG(mem_cnt) mem_cnt_avg, MAX(mem_cnt) mem_cnt_max," .
1870 "MIN(in_progress) in_progress_min,AVG(in_progress) in_progress_avg,MAX(in_progress) in_progress_max," .
1871 "MIN(completed) completed_min,AVG(completed) completed_avg,MAX(completed) completed_max," .
1872 "MIN(failed) failed_min,AVG(failed) failed_avg,MAX(failed) failed_max," .
1873 "MIN(not_attempted) not_attempted_min,AVG(not_attempted) not_attempted_avg,MAX(not_attempted) not_attempted_max" .
1874 " FROM obj_lp_stat" .
1875 " WHERE " .
$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer") .
1876 " AND yyyy = " .
$ilDB->quote($a_year,
"integer");
1878 $sql .=
" AND mm = " .
$ilDB->quote($a_month,
"integer");
1880 $sql .=
" GROUP BY obj_id," . $column;
1881 $set =
$ilDB->query($sql);
1882 while (
$row =
$ilDB->fetchAssoc($set)) {
1893 $ilDB = $DIC[
'ilDB'];
1896 $a_year = date(
"Y");
1899 $agg = strtoupper($a_aggregation);
1902 $sql =
"SELECT type,yyyy,mm," . $agg .
"(cnt_objects) cnt_objects," . $agg .
"(cnt_references) cnt_references," .
1903 "" . $agg .
"(cnt_deleted) cnt_deleted FROM obj_type_stat" .
1904 " WHERE yyyy = " .
$ilDB->quote($a_year,
"integer") .
1905 " GROUP BY type,yyyy,mm";
1906 $set =
$ilDB->query($sql);
1907 while (
$row =
$ilDB->fetchAssoc($set)) {
1908 $row[
"mm"] = str_pad(
$row[
"mm"], 2,
"0", STR_PAD_LEFT);
1910 "objects" => (
int)
$row[
"cnt_objects"],
1911 "references" => (
int) $row[
"cnt_references"],
1912 "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 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()
const LP_STATUS_NOT_ATTEMPTED
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 getSubItemType($a_parent_obj_id)
Get sub-item object type for parent.
static deleteObjectStatistics(array $a_months)
const LP_STATUS_IN_PROGRESS_NUM
if(!array_key_exists('StateId', $_REQUEST)) $id
const LP_MODE_COLLECTION_MANUAL
static _getObjectiveIds($course_id, $a_activated_only=false)
static getSummaryDataForObject($a_ref_id, array $fields, array $a_filters=null)
Get all aggregated tracking data for object.
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 getSummaryPercentages($field, $base_query, $alias=null)
Get aggregated data for field.
static _getInstance($a_obj_id, $a_mode=null)
static _getTrackedUsers($a_obj_id)
Get all tracked users.
const LP_MODE_TEST_FINISHED
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
static _getAllReferences($a_id)
get all reference ids of object
static _getClassById($a_obj_id, $a_mode=null)
const LP_STATUS_IN_PROGRESS
if($modEnd===false) $module
static _lookupObjectId($a_ref_id)
lookup object id
static getInstance($a_ref_id)
Get instance by ref_id.
static getObjectDailyStatistics(array $a_ref_ids, $a_year, $a_month=null)
static getSCOsStatusForUser($a_user_id, $a_parent_obj_id, array $a_sco_ids)
foreach($_POST as $key=> $value) $res
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 ha...
static buildColumns(array &$a_fields, array $a_additional_fields=null, $a_aggregate=false)
Build sql from field definition.
static getObjectAccessStatistics(array $a_ref_ids, $a_year, $a_month=null)
Class ilObjStudyProgramme.
static _lookupObjId($a_id)
const LP_MODE_SURVEY_FINISHED
static getSessionData($a_user_id, array $obj_ids)
Get session data for given objects and user.
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.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
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 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 getObjectivesStatusForUser($a_user_id, $a_obj_id, array $a_objective_ids)
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
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 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.
static getPortfolios($a_title=null)
Class ilObjSCORM2004LearningModule.
static getWorkspaceBlogs($a_title=null)
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 buildFilters(array $where, array $a_filters=null, $a_aggregate=false)
Build sql from filter definition.
static getObjectTypeStatistics()
if(empty($password)) $table
const LP_STATUS_COMPLETED
static getInstance($a_obj_id)
Class ilObjSCORMLearningModule.
static lookupAcceptedAgreements($a_obj_id)
Lookup users who have accepted the agreement.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
static getObjectStatisticsLogInfo()
Get last update info for object statistics.
const LP_STATUS_FAILED_NUM