ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilLPStatusContentVisited.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 
56  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
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)) {
63  $status = self::LP_STATUS_COMPLETED_NUM;
64  }
65  break;
66  }
67 
68  return $status;
69  }
70 }
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
global $DIC
Definition: shib_login.php:22
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
ilObjectDataCache $ilObjDataCache