3 declare(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"];
    43         $coll_items = self::getCollectionItems($a_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) {
    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) {
    73             foreach ($tmp as 
$user_id => $completed_items) {
    74                 if (
sizeof($completed_items) == 
sizeof(
$res[
"items"])) {
    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];
   132         $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
   134             $status = self::LP_STATUS_IN_PROGRESS_NUM;
   138         $items = self::getCollectionItems($a_obj_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) {
   154                 $status = self::LP_STATUS_IN_PROGRESS_NUM;
   156                 if (count($found) == count($items)) {
   157                     $status = self::LP_STATUS_COMPLETED_NUM;
   167         ?
object $a_obj = null
   172         $items = self::getCollectionItems($a_obj_id);
   173         if (count($items) > 0) {
   177             $set = $this->db->query(
   178                 "SELECT obj_id FROM read_event" .
   179                 " WHERE usr_id = " . $this->db->quote($a_usr_id, 
"integer") .
   180                 " AND " . $this->db->in(
"obj_id", $items, 
false, 
"integer")
   182             while ($row = $this->db->fetchAssoc($set)) {
   183                 $found[] = (
int) $row[
"obj_id"];
   186             if (count($found) > 0 && count($items) > 0) {
   187                 $per = (
int) round(100 / count($items) * count($found));
 
static _getStatusInfo(int $a_obj_id)
 
static _getInProgress(int $a_obj_id)
 
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits. 
 
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed. 
 
static getCollectionItems( $a_obj_id, $a_include_titles=false)
 
static _getCompleted(int $a_obj_id)
 
static lookupUsersInProgress(int $a_obj_id)
 
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
static getInstance(int $obj_id)
 
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)