From 0b1e0b8abff5438c1b3ff91d77e91704eddc3949 Mon Sep 17 00:00:00 2001 From: Matheus Zych Date: Thu, 16 Jan 2025 16:16:45 +0100 Subject: [PATCH] Allows sorting of a tests participant list by matriculation number and test id --- .../Test/src/Participants/ParticipantTable.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/ILIAS/Test/src/Participants/ParticipantTable.php b/components/ILIAS/Test/src/Participants/ParticipantTable.php index 8686228f4695..be7c64eb203b 100644 --- a/components/ILIAS/Test/src/Participants/ParticipantTable.php +++ b/components/ILIAS/Test/src/Participants/ParticipantTable.php @@ -229,8 +229,15 @@ private function getPostLoadOrderFields(): array 'mark' => static fn( Participant $a, Participant $b - ) => $a->getAttemptOverviewInformation()?->getMark() <=> $b->getAttemptOverviewInformation()?->getMark() - + ) => $a->getAttemptOverviewInformation()?->getMark() <=> $b->getAttemptOverviewInformation()?->getMark(), + 'matriculation' => static fn( + Participant $a, + Participant $b + ) => $a->getMatriculation() <=> $b->getMatriculation(), + 'id_of_attempt' => static fn( + Participant $a, + Participant $b + ) => $a->getMatriculation() <=> $b->getMatriculation() ]; } @@ -337,7 +344,7 @@ private function getColumns(): array $columns += [ 'matriculation' => $column_factory->text($this->lng->txt('matriculation')) ->withIsOptional(true, false) - ->withIsSortable(false), + ->withIsSortable(true), 'ip_range' => $column_factory->text($this->lng->txt('client_ip_range')) ->withIsOptional(true, false) ->withIsSortable(true), @@ -365,7 +372,7 @@ private function getColumns(): array if ($this->test_object->getMainSettings()->getTestBehaviourSettings()->getExamIdInTestAttemptEnabled()) { $columns['id_of_attempt'] = $column_factory->text($this->lng->txt('exam_id_of_attempt')) ->withIsOptional(true, false) - ->withIsSortable(false); + ->withIsSortable(true); } if ($this->test_access->checkParticipantsResultsAccess()) {