ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLPStatusTestFinished.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 include_once './Services/Tracking/classes/class.ilLPStatus.php';
34 
36 {
37 
38  function ilLPStatusTestFinished($a_obj_id)
39  {
40  global $ilDB;
41 
42  parent::ilLPStatus($a_obj_id);
43  $this->db =& $ilDB;
44  }
45 
46  function _getInProgress($a_obj_id)
47  {
48  global $ilDB;
49 
50  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
51 
52  $query = "SELECT DISTINCT(user_fi) FROM tst_active ".
53  "WHERE tries = 0 ".
54  "AND test_fi = '".ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)."'";
55 
56  $res = $ilDB->query($query);
57  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
58  {
59  $user_ids[] = $row->user_fi;
60  }
61  return $user_ids ? $user_ids : array();
62  }
63 
64 
65  function _getCompleted($a_obj_id)
66  {
67  global $ilDB;
68 
69  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
70 
71  $query = "SELECT DISTINCT(user_fi) FROM tst_active ".
72  "WHERE tries > 0 ".
73  "AND test_fi = '".ilObjTestAccess::_getTestIDFromObjectID($a_obj_id)."'";
74 
75  $res = $ilDB->query($query);
76  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
77  {
78  $user_ids[] = $row->user_fi;
79  }
80  return $user_ids ? $user_ids : array();
81  }
82 }
83 ?>