33include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
42 parent::__construct($a_obj_id);
50 $ilBench->start(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
52 $ilBench->stop(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
61 $ilBench->start(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
63 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
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';
139 require_once
'Modules/Test/classes/class.ilObjTestAccess.php';
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
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'])
179 if($rec[
'last_finished_pass'] !=
null)
184 if( !$rec[
'is_last_pass'] && $status == self::LP_STATUS_FAILED_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"]);
An exception for terminatinating execution or to throw for unit testing.
determinePercentage($a_obj_id, $a_user_id, $a_obj=null)
Determine percentage.
static _getInProgress($a_obj_id)
determineStatusForScoreLastPassTests($is_finished, $passed)
static getUserIdsByResultArrayStatus($objId, $resultArrayStatus)
static _getStatusInfo($a_obj_id)
static _getCompleted($a_obj_id)
static _getFailed($a_obj_id)
determineStatus($a_obj_id, $a_user_id, $a_obj=null)
Determine status.
determineLpStatus($passed)
static _getNotAttempted($a_obj_id)
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
static _getPassedUsers($a_obj_id)
Returns an array containing the users who passed the test.
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.