Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions components/ILIAS/Test/src/Participants/ParticipantTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function getRows(
'login' => $record->getLogin(),
'matriculation' => $record->getMatriculation(),
'total_time_on_task' => $record->getAttemptOverviewInformation()?->getHumanReadableTotalTimeOnTask() ?? '',
'status_of_attempt' => $this->lng->txt($status_of_attempt->value),
'status_of_attempt' => $status_of_attempt->getTranslation($this->lng),
'id_of_attempt' => $record->getAttemptOverviewInformation()?->getExamId(),
'ip_range' => $record->getClientIpTo() !== '' || $record->getClientIpFrom() !== ''
? sprintf('%s - %s', $record->getClientIpFrom(), $record->getClientIpTo())
Expand Down Expand Up @@ -216,11 +216,13 @@ private function getPostLoadOrderFields(): array
) => $a->getRemainingDuration($processing_time, $reset_time_on_new_attempt)
<=> $b->getRemainingDuration($processing_time, $reset_time_on_new_attempt),
'last_access' => static fn(Participant $a, Participant $b) => $a->getLastAccess() <=> $b->getLastAccess(),
'status_of_attempt' => static fn(
'status_of_attempt' => fn(
Participant $a,
Participant $b
) => $a->getAttemptOverviewInformation()?->getStatusOfAttempt()
<=> $b->getAttemptOverviewInformation()?->getStatusOfAttempt(),
) => strcmp(
$a->getAttemptOverviewInformation()?->getStatusOfAttempt()->getTranslation($this->lng) ?? StatusOfAttempt::NOT_YET_STARTED->getTranslation($this->lng),
$b->getAttemptOverviewInformation()?->getStatusOfAttempt()->getTranslation($this->lng) ?? StatusOfAttempt::NOT_YET_STARTED->getTranslation($this->lng)
),
'reached_points' => static fn(
Participant $a,
Participant $b
Expand All @@ -239,8 +241,8 @@ private function getPostLoadOrderFields(): array
'test_passed' => static fn(
Participant $a,
Participant $b
) => $a->getAttemptOverviewInformation()?->hasPassingMark()
<=> $b->getAttemptOverviewInformation()?->hasPassingMark(),
) => $b->getAttemptOverviewInformation()?->hasPassingMark()
<=> $a->getAttemptOverviewInformation()?->hasPassingMark(),
'mark' => static fn(
Participant $a,
Participant $b
Expand Down Expand Up @@ -405,7 +407,8 @@ private function getColumns(): array

if ($this->test_access->checkParticipantsResultsAccess()) {
$columns['reached_points'] = $column_factory->text($this->lng->txt('tst_reached_points'))
->withIsSortable(true);
->withIsSortable(true)
->withOrderingLabels(...$column_factory->number($this->lng->txt('tst_reached_points'))->getOrderingLabels());
$columns['nr_of_answered_questions'] = $column_factory->text($this->lng->txt('tst_answered_questions'))
->withIsOptional(true, false)
->withIsSortable(true);
Expand Down
7 changes: 7 additions & 0 deletions components/ILIAS/Test/src/Results/Data/StatusOfAttempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

namespace ILIAS\Test\Results\Data;

use ILIAS\Language\Language;

enum StatusOfAttempt: string
{
case NOT_YET_STARTED = 'not_started';
Expand Down Expand Up @@ -53,4 +55,9 @@ public static function build(int $current_attempt, ?int $last_finished_attempt,

return StatusOfAttempt::tryFrom($finalized_by);
}

public function getTranslation(Language $lng): string
{
return $lng->txt($this->value);
}
}