33 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
41 parent::__construct($a_obj_id);
49 $ilBench->start(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
50 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'in_progress');
51 $ilBench->stop(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
60 $ilBench->start(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
61 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'passed');
62 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
69 return self::getUserIdsByResultArrayStatus($a_obj_id,
'not_attempted');
74 return self::getUserIdsByResultArrayStatus($a_obj_id,
'failed');
83 foreach ($status_info[
'results'] as $user_data) {
84 if ($user_data[$resultArrayStatus]) {
85 $user_ids[] = $user_data[
'user_id'];
94 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
135 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
136 require_once
'Modules/Test/classes/class.ilObjTestAccess.php';
137 $res = $ilDB->query(
" 138 SELECT tst_active.active_id, tst_active.tries, count(tst_sequence.active_fi) " . $ilDB->quoteIdentifier(
"sequences") .
", tst_active.last_finished_pass, 140 (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass 145 LEFT JOIN tst_sequence 146 ON tst_sequence.active_fi = tst_active.active_id 148 ON tst_tests.test_id = tst_active.test_fi 149 WHERE tst_active.user_fi = {$ilDB->quote($a_user_id, "integer
")} 150 AND tst_active.test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))} 151 GROUP BY tst_active.active_id, tst_active.tries, is_last_pass 154 if ($rec = $ilDB->fetchAssoc(
$res)) {
155 if ($rec[
'sequences'] > 0) {
156 require_once
'Modules/Test/classes/class.ilObjTest.php';
158 $test_obj =
new ilObjTest($a_obj_id,
false);
162 $is_finished =
false;
163 if ($rec[
'last_finished_pass'] != null && $rec[
'sequences'] - 1 == $rec[
'last_finished_pass']) {
168 $status = self::LP_STATUS_IN_PROGRESS_NUM;
170 if ($rec[
'last_finished_pass'] != null) {
174 if (!$rec[
'is_last_pass'] && $status == self::LP_STATUS_FAILED_NUM) {
175 $status = self::LP_STATUS_IN_PROGRESS_NUM;
191 $status = self::LP_STATUS_IN_PROGRESS_NUM;
206 $status = self::LP_STATUS_FAILED_NUM;
209 $status = self::LP_STATUS_COMPLETED_NUM;
227 $set = $ilDB->query(
"SELECT tst_result_cache.*, tst_active.user_fi FROM " .
228 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)" .
229 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) " .
230 " WHERE tst_tests.obj_fi = " . $ilDB->quote($a_obj_id,
"integer") .
231 " AND tst_active.user_fi = " . $ilDB->quote($a_user_id,
"integer"));
233 if ($rec = $ilDB->fetchAssoc($set)) {
234 if ($rec[
"max_points"] > 0) {
235 $per = min(100, 100 / $rec[
"max_points"] * $rec[
"reached_points"]);
static _getStatusInfo($a_obj_id)
static _getNotAttempted($a_obj_id)
static _getInProgress($a_obj_id)
static _getFailed($a_obj_id)
static _isPassed($user_id, $a_obj_id)
Returns TRUE if the user with the user id $user_id passed the test with the object id $a_obj_id...
determineLpStatus($passed)
foreach($_POST as $key=> $value) $res
static _getCompleted($a_obj_id)
static getUserIdsByResultArrayStatus($objId, $resultArrayStatus)
static _getPassedUsers($a_obj_id)
Returns an array containing the users who passed the test.
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Determine status.
Create styles array
The data for the language used.
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
determinePercentage($a_obj_id, $a_user_id, $a_obj=null)
Determine percentage.
determineStatusForScoreLastPassTests($is_finished, $passed)
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...