33 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
51 $ilBench->start(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
54 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
56 $query =
"SELECT DISTINCT(user_fi) FROM tst_active ".
57 "WHERE test_fi = '".ilObjTestAccess::_getTestIDFromObjectID($a_obj_id).
"'";
62 $user_ids[] =
$row->user_fi;
69 $ilBench->stop(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
70 return $users ? $users : array();
78 $ilBench->start(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
80 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
81 include_once
'./Services/Tracking/classes/class.ilTestResultCache.php';
84 foreach($status_info[
'results'] as $user_data)
86 if($user_data[
'passed'])
88 $user_ids[] = $user_data[
'user_id'];
92 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
93 return $user_ids ? $user_ids : array();
102 foreach($status_info[
'results'] as $user_data)
104 if( !$user_data[
'failed'] && !$user_data[
'passed'] )
106 $user_ids[] = $user_data[
'user_id'];
115 foreach($status_info[
'results'] as $user_data)
117 if($user_data[
'failed'])
119 $user_ids[] = $user_data[
'user_id'];
122 return $user_ids ? $user_ids : array();
127 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
166 global $ilObjDataCache, $ilDB,
$ilLog;
170 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
172 $res = $ilDB->query(
"
173 SELECT tst_active.active_id, tst_active.tries, count(tst_sequence.active_fi) sequences
175 LEFT JOIN tst_sequence
176 ON tst_sequence.active_fi = tst_active.active_id
177 WHERE tst_active.user_fi = {$ilDB->quote($a_user_id, "integer
")}
178 AND tst_active.test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
179 GROUP BY tst_active.active_id, tst_active.tries
182 if ($rec = $ilDB->fetchAssoc(
$res))
184 if( $rec[
'sequences'] > 0 )
186 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
217 $set = $ilDB->query(
"SELECT tst_result_cache.*, tst_active.user_fi FROM ".
218 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)".
219 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) ".
220 " WHERE tst_tests.obj_fi = ".$ilDB->quote($a_obj_id,
"integer").
221 " AND tst_active.user_fi = ".$ilDB->quote($a_user_id,
"integer"));
223 if ($rec = $ilDB->fetchAssoc($set))
225 if ($rec[
"max_points"] > 0)
227 $per = min(100, 100 / $rec[
"max_points"] * $rec[
"reached_points"]);