Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00033 include_once './Services/Tracking/classes/class.ilLPStatus.php';
00034
00035 class ilLPStatusTestFinished extends ilLPStatus
00036 {
00037
00038 function ilLPStatusTestFinished($a_obj_id)
00039 {
00040 global $ilDB;
00041
00042 parent::ilLPStatus($a_obj_id);
00043 $this->db =& $ilDB;
00044 }
00045
00046 function _getInProgress($a_obj_id)
00047 {
00048 global $ilDB;
00049
00050 $query = sprintf("SELECT DISTINCT(user_fi) FROM tst_active, tst_tests ".
00051 "WHERE tst_active.tries = 0 AND tst_active.test_fi = tst_tests.test_id AND tst_tests.obj_fi = %s",
00052 $ilDB->quote($a_obj_id)
00053 );
00054
00055 $res = $ilDB->query($query);
00056 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00057 {
00058 $user_ids[] = $row->user_fi;
00059 }
00060 return $user_ids ? $user_ids : array();
00061 }
00062
00063
00064 function _getCompleted($a_obj_id)
00065 {
00066 global $ilDB;
00067
00068 $query = sprintf("SELECT DISTINCT(user_fi) FROM tst_active, tst_tests ".
00069 "WHERE tst_active.tries > 0 AND tst_active.test_fi = tst_tests.test_id AND tst_tests.obj_fi = %s",
00070 $ilDB->quote($a_obj_id)
00071 );
00072
00073 $res = $ilDB->query($query);
00074 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00075 {
00076 $user_ids[] = $row->user_fi;
00077 }
00078 return $user_ids ? $user_ids : array();
00079 }
00080 }
00081 ?>