ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLPStatusQuestions.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Tracking/classes/class.ilLPStatus.php';
5 
14 {
15  function _getInProgress($a_obj_id)
16  {
17  include_once './Services/Tracking/classes/class.ilChangeEvent.php';
18  $users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
19 
20  // Exclude all users with status completed.
21  $users = array_diff((array) $users,ilLPStatusWrapper::_getCompleted($a_obj_id));
22 
23  return $users;
24  }
25 
26  function _getCompleted($a_obj_id)
27  {
28  $usr_ids = array();
29 
30  include_once './Services/Tracking/classes/class.ilChangeEvent.php';
31  $users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
32 
33  include_once "Modules/LearningModule/classes/class.ilLMTracker.php";
34  foreach($users as $user_id)
35  {
36  // :TODO: this ought to be optimized
37  $tracker = ilLMTracker::getInstanceByObjId($a_obj_id, $user_id);
38  if($tracker->getAllQuestionsCorrect())
39  {
40  $usr_ids[] = $user_id;
41  }
42  }
43 
44  return $usr_ids;
45  }
46 
55  function determineStatus($a_obj_id, $a_user_id, $a_obj = null)
56  {
58 
59  include_once "Services/Tracking/classes/class.ilChangeEvent.php";
60  if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id))
61  {
63 
64  include_once "Modules/LearningModule/classes/class.ilLMTracker.php";
65  $tracker = ilLMTracker::getInstanceByObjId($a_obj_id, $a_user_id);
66  if($tracker->getAllQuestionsCorrect())
67  {
69  }
70  }
71 
72  return $status;
73  }
74 }