4 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
22 if(is_array($status_info[
'in_progress']))
24 foreach($status_info[
'in_progress'] as $in_progress)
26 $users = array_merge($users,$in_progress);
28 $users = array_unique($users);
42 foreach($status_info[
'items'] as $item_id)
44 $tmp_users = $status_info[
'completed'][$item_id];
52 $users = array_intersect($users,$tmp_users);
55 $users = array_unique($users);
64 $status_info = array();
66 include_once
"Services/Object/classes/class.ilObjectLP.php";
68 $collection = $olp->getCollectionInstance();
71 $status_info[
"items"] = $collection->getItems($a_obj_id);
73 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
74 foreach($status_info[
"items"] as $item_id)
76 $status_info[
"in_progress"][$item_id] = array();
77 $status_info[
"completed"][$item_id] = array();
84 $possible_items = $collection->getPossibleItems(
$ref_id);
85 $chapter_ids = array_intersect(array_keys($possible_items),
86 $status_info[
"items"]);
89 $status_info[
"items"] = $chapter_ids;
93 foreach($chapter_ids as $item_id)
95 $status_info[
"item_titles"][$item_id] = $possible_items[$item_id][
"title"];
98 $set = $ilDB->query(
"SELECT obj_id,usr_id,spent_seconds".
99 " FROM lm_read_event".
100 " WHERE ".$ilDB->in(
"obj_id", $chapter_ids,
"",
"integer"));
101 while(
$row = $ilDB->fetchAssoc($set))
103 if(
$row[
"spent_seconds"] < $status_info[
"tlt"][
$row[
"obj_id"]])
105 $status_info[
"in_progress"][$row[
"obj_id"]][] = $row[
"usr_id"];
109 $status_info[
"completed"][$row[
"obj_id"]][] = $row[
"usr_id"];
112 if($a_include_tlt_data)
114 $status_info[
"tlt_users"][$row[
"obj_id"]][$row[
"usr_id"]] = $row[
"spent_seconds"];
120 if(!$a_include_tlt_data)
122 unset($status_info[
"tlt"]);
132 if(is_array($info[
"completed"]))
135 foreach($info[
"completed"] as $user_ids)
138 if(!in_array($a_user_id, $user_ids))
150 if(is_array($info[
"in_progress"]))
152 foreach($info[
"in_progress"] as $user_ids)
154 if(in_array($a_user_id, $user_ids))