4 require_once
'Services/Tracking/classes/class.ilLPStatus.php';
5 require_once
'Services/Tracking/classes/class.ilLearningProgress.php';
18 if(is_array($status_info[
"user_status"][
"in_progress"]))
20 $users = $status_info[
"user_status"][
"in_progress"];
31 if(is_array($status_info[
"user_status"][
"completed"]))
33 $users = $status_info[
"user_status"][
"completed"];
45 $coll_items = self::getCollectionItems($a_parent_obj_id,
true);
47 $res[
"items"] = array_keys($coll_items);
48 if(
sizeof(
$res[
"items"]))
51 foreach($coll_items as $mob_id => $item)
53 $res[
"item_titles"][$mob_id] = $item[
"title"];
57 foreach(
$res[
"items"] as $mob_id)
63 $set = $ilDB->query(
"SELECT obj_id, usr_id FROM read_event".
64 " WHERE ".$ilDB->in(
"obj_id",
$res[
"items"],
"",
"integer"));
65 while(
$row = $ilDB->fetchAssoc($set))
67 $res[
"completed"][
$row[
"obj_id"]][] = $row[
"usr_id"];
72 foreach(
$res[
"items"] as $mob_id)
74 foreach(
$res[
"completed"][$mob_id] as $user_id)
76 $tmp[$user_id][] = $mob_id;
79 foreach($tmp as $user_id => $completed_items)
81 if(
sizeof($completed_items) ==
sizeof(
$res[
"items"]))
83 $res[
"user_status"][
"completed"][] = $user_id;
87 $res[
"user_status"][
"in_progress"][] = $user_id;
99 include_once
'./Services/Object/classes/class.ilObjectLP.php';
101 $collection = $olp->getCollectionInstance();
104 $possible = $collection->getPossibleItems();
107 $valid = array_intersect($collection->getItems(),
108 array_keys($possible));
110 if($a_include_titles)
112 foreach(
$valid as $item_id)
114 $res[$item_id] = $possible[$item_id];
130 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
133 $items = self::getCollectionItems($a_obj_id);
140 $set = $ilDB->query(
"SELECT obj_id FROM read_event".
141 " WHERE usr_id = ".$ilDB->quote($a_user_id,
"integer").
142 " AND ".$ilDB->in(
"obj_id", $items,
"",
"integer"));
143 while(
$row = $ilDB->fetchAssoc($set))
145 $found[] =
$row[
"obj_id"];
150 $status = self::LP_STATUS_IN_PROGRESS_NUM;
152 if(
sizeof($found) ==
sizeof($items))
154 $status = self::LP_STATUS_COMPLETED_NUM;
static _getCompleted($a_obj_id)
static getCollectionItems($a_obj_id, $a_include_titles=false)
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
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 _getStatusInfo($a_parent_obj_id)
static _getInProgress($a_obj_id)
static getInstance($a_obj_id)