From cccc23bf8acd4b5c5ce4bc397de0c73c493b7a04 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 14 Oct 2022 18:27:36 +0300 Subject: [PATCH] Test: Fix Results Table --- Modules/Test/classes/class.ilTestParticipantList.php | 6 +++--- .../tables/class.ilParticipantsTestResultsTableGUI.php | 8 ++++---- .../templates/default/tpl.il_as_tst_scorings_row.html | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Modules/Test/classes/class.ilTestParticipantList.php b/Modules/Test/classes/class.ilTestParticipantList.php index 7ede91a1f302..668b580aa711 100644 --- a/Modules/Test/classes/class.ilTestParticipantList.php +++ b/Modules/Test/classes/class.ilTestParticipantList.php @@ -284,13 +284,13 @@ public function buildScoringsQuery(): string $query = " SELECT * FROM tst_result_cache tres - + INNER JOIN tst_pass_result pres ON pres.active_fi = tres.active_fi AND pres.pass = tres.pass $closedScoringsOnly - + WHERE $IN_activeIds "; @@ -350,7 +350,7 @@ public function getScoringsTableRows(): array $row['percent_result'] = $participant->getScoring()->getPercentResult(); $row['passed_status'] = $participant->getScoring()->isPassed(); $row['final_mark'] = $participant->getScoring()->getFinalMark(); - $row['last_scored_access'] = ilObjTest::lookupLastTestPassAccess( + $row['scored_pass_finished_timestamp'] = ilObjTest::lookupLastTestPassAccess( $participant->getActiveId(), $participant->getScoring()->getScoredPass() ); diff --git a/Modules/Test/classes/tables/class.ilParticipantsTestResultsTableGUI.php b/Modules/Test/classes/tables/class.ilParticipantsTestResultsTableGUI.php index e02cd99e0676..d065040279fa 100644 --- a/Modules/Test/classes/tables/class.ilParticipantsTestResultsTableGUI.php +++ b/Modules/Test/classes/tables/class.ilParticipantsTestResultsTableGUI.php @@ -160,7 +160,7 @@ public function fillRow(array $a_set): void $this->tpl->setVariable("FULLNAME", $a_set['name']); $this->tpl->setVariable("SCORED_PASS", $this->buildScoredPassString($a_set)); - $this->tpl->setVariable("PASS_FINISHED", $this->buildPassFinishedString($a_set)); + $this->tpl->setVariable("SCORED_PASS_FINISHED", $this->buildScoredPassFinishedString($a_set)); $this->tpl->setVariable("ANSWERED_QUESTIONS", $this->buildAnsweredQuestionsString($a_set)); $this->tpl->setVariable("REACHED_POINTS", $this->buildReachedPointsString($a_set)); @@ -240,10 +240,10 @@ protected function buildScoredPassString(array $data): string return $this->lng->txt('pass') . ' ' . ($data['scored_pass'] + 1); } - protected function buildPassFinishedString(array $data): string + protected function buildScoredPassFinishedString(array $data): string { - if (isset($data['pass_finished'])) { - return ilDatePresentation::formatDate(new ilDateTime($data['pass_finished'], IL_CAL_UNIX)); + if (isset($data['scored_pass_finished_timestamp'])) { + return ilDatePresentation::formatDate(new ilDateTime($data['scored_pass_finished_timestamp'], IL_CAL_UNIX)); } return ''; } diff --git a/Modules/Test/templates/default/tpl.il_as_tst_scorings_row.html b/Modules/Test/templates/default/tpl.il_as_tst_scorings_row.html index dbcd0f4ed69d..a3f196fb16bf 100644 --- a/Modules/Test/templates/default/tpl.il_as_tst_scorings_row.html +++ b/Modules/Test/templates/default/tpl.il_as_tst_scorings_row.html @@ -6,9 +6,8 @@ - {FINISHED_PASSES} {SCORED_PASS} - {LAST_SCORED_ACCESS} + {SCORED_PASS_FINISHED} {ANSWERED_QUESTIONS} {REACHED_POINTS} {PERCENT_RESULT}