ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilLPStatusStudyProgramme.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14{
15 public static function _getCountInProgress($a_obj_id)
16 {
17 return count(self::_getInProgress($a_obj_id));
18 }
19
20 public static function _getInProgress($a_obj_id)
21 {
22 $prg = new ilObjStudyProgramme($a_obj_id, false);
23 return $prg->getIdsOfUsersWithNotCompletedAndRelevantProgress();
24 }
25
26 public static function _getCountCompleted($a_obj_id)
27 {
28 return count(self::_getCompleted($a_obj_id));
29 }
30
31 public static function _getCompleted($a_obj_id)
32 {
33 $prg = new ilObjStudyProgramme($a_obj_id, false);
34 return $prg->getIdsOfUsersWithCompletedProgress();
35 }
36
37 public static function _getFailed($a_obj_id)
38 {
39 $prg = new ilObjStudyProgramme($a_obj_id, false);
40 return $prg->getIdsOfUsersWithFailedProgress();
41 }
42
43 public function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
44 {
45 $prg = new ilObjStudyProgramme($a_obj_id, false);
46 $progresses = $prg->getProgressesOf($a_user_id);
47
48 $relevant = false;
49 $failed = false;
50
51 foreach ($progresses as $progress) {
52 if ($progress->isSuccessful()) {
53 if (!$progress->isSuccessfulExpired()) {
55 } else {
56 $failed = true;
57 }
58 }
59 if ($progress->isRelevant()) {
60 $relevant = true;
61 }
62 if ($progress->isFailed()) {
63 $failed = true;
64 }
65 }
66 if ($failed) {
68 }
69 if ($relevant) {
71 }
72
74 }
75}
$failed
Definition: Utf8Test.php:85
An exception for terminatinating execution or to throw for unit testing.
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Determine status.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM