3declare(strict_types=0);
 
   17        if (isset($status_info[
"user_status"][
"in_progress"])) {
 
   18            $users = $status_info[
"user_status"][
"in_progress"];
 
   28        if (isset($status_info[
"user_status"][
"completed"])) {
 
   29            $users = $status_info[
"user_status"][
"completed"];
 
   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) {
 
   54                $res[
"completed"][$mob_id] = array();
 
   55                $res[
"in_progress"][$mob_id] = array();
 
   59                "SELECT obj_id, usr_id FROM read_event" .
 
   60                " WHERE " . 
$ilDB->in(
"obj_id", 
$res[
"items"], 
"", 
"integer")
 
   62            while ($row = 
$ilDB->fetchAssoc($set)) {
 
   63                $res[
"completed"][(
int) $row[
"obj_id"]][] = (
int) $row[
"usr_id"];
 
   68            foreach (
$res[
"items"] as $mob_id) {
 
   69                foreach (
$res[
"completed"][$mob_id] as $user_id) {
 
   70                    $tmp[$user_id][] = (
int) $mob_id;
 
   73            foreach ($tmp as $user_id => $completed_items) {
 
   74                if (
sizeof($completed_items) == 
sizeof(
$res[
"items"])) {
 
   75                    $res[
"user_status"][
"completed"][] = (
int) $user_id;
 
   77                    $res[
"user_status"][
"in_progress"][] = (
int) $user_id;
 
   83        foreach ($users as $user_id) {
 
   84            if ((!isset(
$res[
"user_status"][
"in_progress"]) || !in_array(
 
   86                $res[
"user_status"][
"in_progress"]
 
   88                (!isset(
$res[
"user_status"][
"completed"]) || !in_array(
 
   90                    $res[
"user_status"][
"completed"]
 
   92                $res[
"user_status"][
"in_progress"][] = (
int) $user_id;
 
  101        $a_include_titles = 
false 
  106        $collection = $olp->getCollectionInstance();
 
  108            $possible = $collection->getPossibleItems();
 
  112                $collection->getItems(),
 
  113                array_keys($possible)
 
  116            if ($a_include_titles) {
 
  117                foreach (
$valid as $item_id) {
 
  118                    $res[$item_id] = $possible[$item_id];
 
  139        if (count($items) > 0) {
 
  144            $set = $this->db->query(
 
  145                "SELECT obj_id FROM read_event" .
 
  146                " WHERE usr_id = " . $this->db->quote($a_usr_id, 
"integer") .
 
  147                " AND " . $this->db->in(
"obj_id", $items, 
false, 
"integer")
 
  149            while ($row = $this->db->fetchAssoc($set)) {
 
  150                $found[] = (
int) $row[
"obj_id"];
 
  153            if (count($found) > 0) {
 
  156                if (count($found) == count($items)) {
 
  167        ?
object $a_obj = 
null 
  173        $items = self::getCollectionItems($a_obj_id);
 
  174        if (count($items) > 0) {
 
  178            $set = $this->db->query(
 
  179                "SELECT obj_id FROM read_event" .
 
  180                " WHERE usr_id = " . $this->db->quote($a_usr_id, 
"integer") .
 
  181                " AND " . $this->db->in(
"obj_id", $items, 
false, 
"integer")
 
  183            while ($row = $this->db->fetchAssoc($set)) {
 
  184                $found[] = (
int) $row[
"obj_id"];
 
  187            if (count($found) > 0 && count($items) > 0) {
 
  188                $per = round(100 / count($items) * count($found));
 
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
 
static lookupUsersInProgress(int $a_obj_id)
 
static _getCompleted(int $a_obj_id)
 
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
 
static _getInProgress(int $a_obj_id)
 
static getCollectionItems( $a_obj_id, $a_include_titles=false)
 
static _getStatusInfo(int $a_obj_id)
 
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
static _getStatusInfo(int $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 ...
 
const LP_STATUS_COMPLETED_NUM
 
const LP_STATUS_IN_PROGRESS_NUM
 
const LP_STATUS_NOT_ATTEMPTED_NUM
 
static getInstance(int $obj_id)