ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLPStatusContentVisited.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=0);
25{
29 public static function _getCompleted(int $a_obj_id): array
30 {
31 $userIds = [];
32
33 $allReadEvents = \ilChangeEvent::_lookupReadEvents($a_obj_id);
34 foreach ($allReadEvents as $event) {
35 $userIds[] = $event['usr_id'];
36 }
37
38 return $userIds;
39 }
40
44 public function determineStatus(
45 int $a_obj_id,
46 int $a_usr_id,
47 ?object $a_obj = null
48 ): int {
52 global $DIC;
53
54 $ilObjDataCache = $DIC['ilObjDataCache'];
55
57
58 switch ($this->ilObjDataCache->lookupType($a_obj_id)) {
59 case 'file':
60 case 'copa':
61 case 'htlm':
62 if (\ilChangeEvent::hasAccessed($a_obj_id, $a_usr_id)) {
64 }
65 break;
66 }
67
68 return $status;
69 }
70}
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
static _getCompleted(int $a_obj_id)
int[]
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_COMPLETED_NUM
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
const LP_STATUS_NOT_ATTEMPTED_NUM
ilObjectDataCache $ilObjDataCache
global $DIC
Definition: shib_login.php:26