ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  static function _getCountInProgress($a_obj_id) {
18  return count($this->_getInProgress($a_obj_id));
19  }
20 
21  static function _getInProgress($a_obj_id)
22  {
23  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
24  $prg = new ilObjStudyProgramme($a_obj_id, false);
25  return $prg->getIdsOfUsersWithNotCompletedAndRelevantProgress();
26  }
27 
28  static function _getCountCompleted($a_obj_id) {
29  return count($this->_getCompleted($a_obj_id));
30  }
31 
32  static function _getCompleted($a_obj_id)
33  {
34  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
35  $prg = new ilObjStudyProgramme($a_obj_id, false);
36  return $prg->getIdsOfUsersWithCompletedProgress();
37  }
38 
39  function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
40  {
41  require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
42  $prg = new ilObjStudyProgramme($a_obj_id, false);
43  $progresses = $prg->getProgressesOf($a_user_id);
44 
45  $successful = false;
46  $relevant = false;
47 
48  foreach ($progresses as $progress) {
49  if ($progress->isSuccessful()) {
50  $successful = true;
51  break;
52  }
53  if ($progress->isRelevant()) {
54  $relevant = true;
55  }
56  }
57 
58  if ($successful) {
60  }
61  if ($relevant) {
63  }
65  }
66 }
67 
68 ?>
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Class ilObjStudyProgramme.
const LP_STATUS_NOT_ATTEMPTED_NUM
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...