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"])) {
19 $users = $status_info[
"user_status"][
"in_progress"];
30 if (is_array($status_info[
"user_status"][
"completed"])) {
31 $users = $status_info[
"user_status"][
"completed"];
43 $coll_items = self::getCollectionItems($a_parent_obj_id,
true);
45 $res[
"items"] = array_keys($coll_items);
46 if (
sizeof(
$res[
"items"])) {
48 foreach ($coll_items as $mob_id => $item) {
49 $res[
"item_titles"][$mob_id] = $item[
"title"];
53 foreach (
$res[
"items"] as $mob_id) {
58 $set = $ilDB->query(
"SELECT obj_id, usr_id FROM read_event" .
59 " WHERE " . $ilDB->in(
"obj_id",
$res[
"items"],
"",
"integer"));
60 while (
$row = $ilDB->fetchAssoc($set)) {
61 $res[
"completed"][
$row[
"obj_id"]][] = $row[
"usr_id"];
66 foreach (
$res[
"items"] as $mob_id) {
67 foreach (
$res[
"completed"][$mob_id] as $user_id) {
68 $tmp[$user_id][] = $mob_id;
71 foreach ($tmp as $user_id => $completed_items) {
72 if (
sizeof($completed_items) ==
sizeof(
$res[
"items"])) {
73 $res[
"user_status"][
"completed"][] = $user_id;
75 $res[
"user_status"][
"in_progress"][] = $user_id;
87 include_once
'./Services/Object/classes/class.ilObjectLP.php';
89 $collection = $olp->getCollectionInstance();
91 $possible = $collection->getPossibleItems();
95 $collection->getItems(),
99 if ($a_include_titles) {
100 foreach (
$valid as $item_id) {
101 $res[$item_id] = $possible[$item_id];
115 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
118 $items = self::getCollectionItems($a_obj_id);
119 if (
sizeof($items)) {
124 $set = $ilDB->query(
"SELECT obj_id FROM read_event" .
125 " WHERE usr_id = " . $ilDB->quote($a_user_id,
"integer") .
126 " AND " . $ilDB->in(
"obj_id", $items,
"",
"integer"));
127 while (
$row = $ilDB->fetchAssoc($set)) {
128 $found[] =
$row[
"obj_id"];
131 if (
sizeof($found)) {
132 $status = self::LP_STATUS_IN_PROGRESS_NUM;
134 if (
sizeof($found) ==
sizeof($items)) {
135 $status = self::LP_STATUS_COMPLETED_NUM;
static _getCompleted($a_obj_id)
static getCollectionItems($a_obj_id, $a_include_titles=false)
foreach($_POST as $key=> $value) $res
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)