19 declare(strict_types=0);
32 $userIds = self::getUserIdsByResultArrayStatus(
41 $userIds = self::getUserIdsByResultArrayStatus($a_obj_id,
'passed');
47 return self::getUserIdsByResultArrayStatus($a_obj_id,
'not_attempted');
52 return self::getUserIdsByResultArrayStatus($a_obj_id,
'failed');
63 foreach ($status_info[
'results'] as $user_data) {
64 if (isset($user_data[$resultArrayStatus]) && $user_data[$resultArrayStatus]) {
65 $user_ids[] = (
int) $user_data[
'user_id'];
75 $test_result_repository = TestDIC::dic()[
'results.data.repository'];
76 $status_info[
'results'] = $test_result_repository->getPassedParticipants($a_obj_id);
86 $test_result_repository = TestDIC::dic()[
'results.data.repository'];
89 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
91 $res = $this->db->query(
93 SELECT tst_active.active_id, tst_active.tries, count(tst_sequence.active_fi) " . $this->db->quoteIdentifier(
95 ) .
", tst_active.last_finished_pass, 97 (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass 102 LEFT JOIN tst_sequence 103 ON tst_sequence.active_fi = tst_active.active_id 105 ON tst_tests.test_id = tst_active.test_fi 106 WHERE tst_active.user_fi = {$this->db->quote($a_usr_id, "integer
")} 107 AND tst_active.test_fi = {$this->db->quote(ilObjTestAccess::_getTestIDFromObjectID($a_obj_id), ilDBConstants::T_INTEGER)} 108 GROUP BY tst_active.active_id, tst_active.tries, is_last_pass 113 ($rec = $this->db->fetchAssoc(
$res))
114 && $rec[
'sequences'] > 0
116 $test_obj =
new ilObjTest($a_obj_id,
false);
117 $is_passed = $test_result_repository->isPassed($a_usr_id, $a_obj_id);
120 $is_finished =
false;
121 if ($rec[
'last_finished_pass'] !==
null && $rec[
'sequences'] - 1 === $rec[
'last_finished_pass']) {
129 $status = self::LP_STATUS_IN_PROGRESS_NUM;
131 if ($rec[
'last_finished_pass'] !==
null) {
137 if ($old_status !==
null 138 && $old_status !== self::LP_STATUS_NOT_ATTEMPTED_NUM
139 && $status === self::LP_STATUS_IN_PROGRESS_NUM) {
150 $status = self::LP_STATUS_IN_PROGRESS_NUM;
161 $status = self::LP_STATUS_FAILED_NUM;
164 $status = self::LP_STATUS_COMPLETED_NUM;
173 ?
object $a_obj =
null 175 $set = $this->db->query(
176 "SELECT tst_result_cache.*, tst_active.user_fi FROM " .
177 "tst_result_cache JOIN tst_active ON (tst_active.active_id = tst_result_cache.active_fi)" .
178 " JOIN tst_tests ON (tst_tests.test_id = tst_active.test_fi) " .
179 " WHERE tst_tests.obj_fi = " . $this->db->quote(
183 " AND tst_active.user_fi = " . $this->db->quote(
189 if ($rec = $this->db->fetchAssoc($set)) {
190 if ($rec[
"max_points"] > 0) {
193 100 / $rec[
"max_points"] * $rec[
"reached_points"]
static _getFailed(int $a_obj_id)
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
determineLpStatus(bool $passed)
static _getStatusInfo(int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserIdsByResultArrayStatus( $objId, $resultArrayStatus)
static _getInProgress(int $a_obj_id)
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
static _getCompleted(int $a_obj_id)
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
determineStatusForScoreLastPassTests(bool $is_finished, bool $passed)
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getNotAttempted(int $a_obj_id)