Skip to content

Commit

Permalink
Allows sorting of a tests participant list by matriculation number an…
Browse files Browse the repository at this point in the history
…d test id
  • Loading branch information
matheuszych committed Jan 16, 2025
1 parent ef62965 commit 0b1e0b8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions components/ILIAS/Test/src/Participants/ParticipantTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 0b1e0b8

Please sign in to comment.