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';
83 foreach($status_info[
'results'] as $user_data)
85 if($user_data[
'passed'])
87 $user_ids[] = $user_data[
'user_id'];
91 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
92 return $user_ids ? $user_ids : array();
101 foreach($status_info[
'results'] as $user_data)
103 if( !$user_data[
'failed'] && !$user_data[
'passed'] )
105 $user_ids[] = $user_data[
'user_id'];
114 foreach($status_info[
'results'] as $user_data)
116 if($user_data[
'failed'])
118 $user_ids[] = $user_data[
'user_id'];
121 return $user_ids ? $user_ids : array();
126 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
165 global $ilObjDataCache, $ilDB,
$ilLog;
169 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
171 $res = $ilDB->query(
"
172 SELECT tst_active.active_id, tst_active.tries, count(tst_sequence.active_fi) sequences
174 LEFT JOIN tst_sequence
175 ON tst_sequence.active_fi = tst_active.active_id
176 WHERE tst_active.user_fi = {$ilDB->quote($a_user_id, "integer
")}
177 AND tst_active.test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))}
178 GROUP BY tst_active.active_id, tst_active.tries
181 if ($rec = $ilDB->fetchAssoc(
$res))
183 if( $rec[
'sequences'] > 0 )
185 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
216 $set = $ilDB->query(
"SELECT tst_result_cache.*, tst_active.user_fi FROM ".
217 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)".
218 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) ".
219 " WHERE tst_tests.obj_fi = ".$ilDB->quote($a_obj_id,
"integer").
220 " AND tst_active.user_fi = ".$ilDB->quote($a_user_id,
"integer"));
222 if ($rec = $ilDB->fetchAssoc($set))
224 if ($rec[
"max_points"] > 0)
226 $per = min(100, 100 / $rec[
"max_points"] * $rec[
"reached_points"]);