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;
68 $ilBench->stop(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
69 return $users ? $users : array();
77 $ilBench->start(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
79 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
80 include_once
'./Services/Tracking/classes/class.ilTestResultCache.php';
83 foreach($status_info[
'results'] as $user_data)
85 if($user_data[
'passed'])
87 $user_ids[] = $user_data[
'user_id'];
90 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
91 return $user_ids ? $user_ids : array();
97 foreach($status_info[
'results'] as $user_data)
99 if($user_data[
'failed'])
101 $user_ids[] = $user_data[
'user_id'];
104 return $user_ids ? $user_ids : array();
109 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
152 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
154 $res = $ilDB->query(
"SELECT tries FROM tst_active".
155 " WHERE user_fi = ".$ilDB->quote($a_user_id,
"integer").
158 if ($rec = $ilDB->fetchAssoc(
$res))
160 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
187 $set = $ilDB->query(
"SELECT tst_result_cache.*, tst_active.user_fi FROM ".
188 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)".
189 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) ".
190 " WHERE tst_tests.obj_fi = ".$ilDB->quote($a_obj_id,
"integer").
191 " AND tst_active.user_fi = ".$ilDB->quote($a_user_id,
"integer"));
193 if ($rec = $ilDB->fetchAssoc($set))
195 if ($rec[
"max_points"] > 0)
197 $per = min(100, 100 / $rec[
"max_points"] * $rec[
"reached_points"]);