ILIAS  release_8 Revision v8.23
class.ilLPStatusContentVisited.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=0);
4 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
5 
11 {
15  public static function _getCompleted(int $a_obj_id): array
16  {
17  $userIds = [];
18 
19  $allReadEvents = \ilChangeEvent::_lookupReadEvents($a_obj_id);
20  foreach ($allReadEvents as $event) {
21  $userIds[] = $event['usr_id'];
22  }
23 
24  return $userIds;
25  }
26 
30  public function determineStatus(
31  int $a_obj_id,
32  int $a_usr_id,
33  object $a_obj = null
34  ): int {
38  global $DIC;
39 
40  $ilObjDataCache = $DIC['ilObjDataCache'];
41 
42  $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
43 
44  switch ($this->ilObjDataCache->lookupType($a_obj_id)) {
45  case 'file':
46  case 'copa':
47  case 'htlm':
48  if (\ilChangeEvent::hasAccessed($a_obj_id, $a_usr_id)) {
49  $status = self::LP_STATUS_COMPLETED_NUM;
50  }
51  break;
52  }
53 
54  return $status;
55  }
56 }
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
global $DIC
Definition: feed.php:28
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
ilObjectDataCache $ilObjDataCache