33 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
43 parent::__construct($a_obj_id);
53 $ilBench->start(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
54 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'in_progress');
55 $ilBench->stop(
'LearningProgress',
'9182_LPStatusTestPassed_inProgress');
66 $ilBench->start(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
67 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'passed');
68 $ilBench->stop(
'LearningProgress',
'9183_LPStatusTestPassed_completed');
75 return self::getUserIdsByResultArrayStatus($a_obj_id,
'not_attempted');
80 return self::getUserIdsByResultArrayStatus($a_obj_id,
'failed');
89 foreach ($status_info[
'results'] as $user_data) {
90 if ($user_data[$resultArrayStatus]) {
91 $user_ids[] = $user_data[
'user_id'];
100 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
141 $ilDB = $DIC[
'ilDB'];
143 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
144 require_once
'Modules/Test/classes/class.ilObjTestAccess.php';
146 SELECT tst_active.active_id, tst_active.tries, count(tst_sequence.active_fi) " .
$ilDB->quoteIdentifier(
"sequences") .
", tst_active.last_finished_pass, 148 (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass 153 LEFT JOIN tst_sequence 154 ON tst_sequence.active_fi = tst_active.active_id 156 ON tst_tests.test_id = tst_active.test_fi 157 WHERE tst_active.user_fi = {$ilDB->quote($a_user_id, "integer
")} 158 AND tst_active.test_fi = {$ilDB->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id))} 159 GROUP BY tst_active.active_id, tst_active.tries, is_last_pass 163 if ($rec[
'sequences'] > 0) {
164 require_once
'Modules/Test/classes/class.ilObjTest.php';
166 $test_obj =
new ilObjTest($a_obj_id,
false);
170 $is_finished =
false;
171 if ($rec[
'last_finished_pass'] != null && $rec[
'sequences'] - 1 == $rec[
'last_finished_pass']) {
176 $status = self::LP_STATUS_IN_PROGRESS_NUM;
178 if ($rec[
'last_finished_pass'] != null) {
182 if (!$rec[
'is_last_pass'] && $status == self::LP_STATUS_FAILED_NUM) {
183 $status = self::LP_STATUS_IN_PROGRESS_NUM;
199 $status = self::LP_STATUS_IN_PROGRESS_NUM;
214 $status = self::LP_STATUS_FAILED_NUM;
217 $status = self::LP_STATUS_COMPLETED_NUM;
235 $ilDB = $DIC[
'ilDB'];
237 $set =
$ilDB->query(
"SELECT tst_result_cache.*, tst_active.user_fi FROM " .
238 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)" .
239 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) " .
240 " WHERE tst_tests.obj_fi = " .
$ilDB->quote($a_obj_id,
"integer") .
241 " AND tst_active.user_fi = " .
$ilDB->quote($a_user_id,
"integer"));
243 if ($rec =
$ilDB->fetchAssoc($set)) {
244 if ($rec[
"max_points"] > 0) {
245 $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.
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 ...