ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
13 include_once './Services/Tracking/classes/class.ilLPStatus.php';
14 
16 {
17  public static function _getCountInProgress($a_obj_id)
18  {
19  return count(self::_getInProgress($a_obj_id));
20  }
21 
22  public static function _getInProgress($a_obj_id)
23  {
24  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
25  $prg = new ilObjStudyProgramme($a_obj_id, false);
26  return $prg->getIdsOfUsersWithNotCompletedAndRelevantProgress();
27  }
28 
29  public static function _getCountCompleted($a_obj_id)
30  {
31  return count(self::_getCompleted($a_obj_id));
32  }
33 
34  public static function _getCompleted($a_obj_id)
35  {
36  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
37  $prg = new ilObjStudyProgramme($a_obj_id, false);
38  return $prg->getIdsOfUsersWithCompletedProgress();
39  }
40 
41  public static function _getFailed($a_obj_id)
42  {
43  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
44  $prg = new ilObjStudyProgramme($a_obj_id, false);
45  return $prg->getIdsOfUsersWithFailedProgress();
46  }
47 
48  public function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
49  {
50  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
51  $prg = new ilObjStudyProgramme($a_obj_id, false);
52  $progresses = $prg->getProgressesOf($a_user_id);
53 
54  $successful = false;
55  $relevant = false;
56 
57  foreach ($progresses as $progress) {
58  if ($progress->isSuccessful()) {
59  $successful = true;
60  break;
61  }
62  if ($progress->isRelevant()) {
63  $relevant = true;
64  }
65  $progress->recalculateFailedToDeadline();
66  if ($progress->isFailed()) {
67  $failed = true;
68  }
69  }
70 
71  if ($successful) {
73  }
74  if ($failed) {
76  }
77  if ($relevant) {
79  }
80 
82  }
83 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Class ilObjStudyProgramme.
$failed
Definition: Utf8Test.php:85
const LP_STATUS_NOT_ATTEMPTED_NUM
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_FAILED_NUM