33 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
42 parent::__construct($a_obj_id);
50 $ilBench->start(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
51 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'in_progress');
52 $ilBench->stop(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
61 $ilBench->start(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
62 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'passed');
63 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
70 return self::getUserIdsByResultArrayStatus($a_obj_id,
'not_attempted');
75 return self::getUserIdsByResultArrayStatus($a_obj_id,
'failed');
84 foreach($status_info[
'results'] as $user_data)
86 if($user_data[$resultArrayStatus])
88 $user_ids[] = $user_data[
'user_id'];
97 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
138 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
139 require_once
'Modules/Test/classes/class.ilObjTestAccess.php';
140 $res = $ilDB->query(
" 141 SELECT tst_active.active_id, tst_active.tries, count(tst_sequence.active_fi) " . $ilDB->quoteIdentifier(
"sequences") .
", tst_active.last_finished_pass, 143 (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass 148 LEFT JOIN tst_sequence 149 ON tst_sequence.active_fi = tst_active.active_id 151 ON tst_tests.test_id = tst_active.test_fi 152 WHERE tst_active.user_fi = {$ilDB->quote($a_user_id, "integer
")} 153 AND tst_active.test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))} 154 GROUP BY tst_active.active_id, tst_active.tries, is_last_pass 157 if ($rec = $ilDB->fetchAssoc(
$res))
159 if( $rec[
'sequences'] > 0 )
161 require_once
'Modules/Test/classes/class.ilObjTest.php';
163 $test_obj =
new ilObjTest($a_obj_id,
false);
168 $is_finished =
false;
169 if($rec[
'last_finished_pass'] != null && $rec[
'sequences'] - 1 == $rec[
'last_finished_pass'])
177 $status = self::LP_STATUS_IN_PROGRESS_NUM;
179 if($rec[
'last_finished_pass'] != null)
184 if( !$rec[
'is_last_pass'] && $status == self::LP_STATUS_FAILED_NUM )
186 $status = self::LP_STATUS_IN_PROGRESS_NUM;
202 $status = self::LP_STATUS_IN_PROGRESS_NUM;
218 $status = self::LP_STATUS_FAILED_NUM;
222 $status = self::LP_STATUS_COMPLETED_NUM;
240 $set = $ilDB->query(
"SELECT tst_result_cache.*, tst_active.user_fi FROM ".
241 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)".
242 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) ".
243 " WHERE tst_tests.obj_fi = ".$ilDB->quote($a_obj_id,
"integer").
244 " AND tst_active.user_fi = ".$ilDB->quote($a_user_id,
"integer"));
246 if ($rec = $ilDB->fetchAssoc($set))
248 if ($rec[
"max_points"] > 0)
250 $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)
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 ...