ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilLPStatusDownloaded.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
5require_once 'Services/Tracking/classes/class.ilLPStatus.php';
6require_once 'Services/Tracking/classes/class.ilLearningProgress.php';
7
13{
17 public function __construct($a_obj_id)
18 {
19 global $ilDB;
20
21 parent::__construct($a_obj_id);
22 $this->db = $ilDB;
23 }
24
25 public static function _getCompleted($a_obj_id)
26 {
27 $usr_ids = array();
28 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
29 $all_read_events = ilChangeEvent::_lookupReadEvents($a_obj_id);
30 foreach ($all_read_events as $event) {
31 $usr_ids[] = $event['usr_id'];
32 }
33 return $usr_ids;
34 }
35
44 public function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
45 {
49 global $ilObjDataCache;
50
52 switch ($ilObjDataCache->lookupType($a_obj_id)) {
53 case 'file':
54 include_once './Services/Tracking/classes/class.ilChangeEvent.php';
55 if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
57 }
58 break;
59 }
60 return $status;
61 }
62}
An exception for terminatinating execution or to throw for unit testing.
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object which happened after the last time the user caught ...
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_COMPLETED_NUM
determineStatus($a_obj_id, $a_usr_id, $a_obj=null)
Determine status.
const LP_STATUS_NOT_ATTEMPTED_NUM
global $ilDB