From cfd7a05ed0ad17716f648e6c00628456a2909a0c Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Fri, 7 Jul 2023 17:23:09 +0200 Subject: [PATCH] Properly style judging verifier page. (#2100) --- .../Controller/Jury/JuryMiscController.php | 21 +++--- webapp/src/Twig/TwigExtension.php | 1 + .../templates/jury/check_judgings.html.twig | 66 ++++++++++++------- 3 files changed, 58 insertions(+), 30 deletions(-) diff --git a/webapp/src/Controller/Jury/JuryMiscController.php b/webapp/src/Controller/Jury/JuryMiscController.php index 28b7561b06..0c20021068 100644 --- a/webapp/src/Controller/Jury/JuryMiscController.php +++ b/webapp/src/Controller/Jury/JuryMiscController.php @@ -264,37 +264,42 @@ public function judgingVerifierAction(Request $request): Response /** @var string[] $expectedResults */ $expectedResults = $submission->getExpectedResults(); $submissionId = $submission->getSubmitid(); + $submissionFiles = $submission->getFiles(); + $result = mb_strtoupper($judging->getResult()); + $entry = ['files' => $submissionFiles, 'actual' => $result, 'expected' => $expectedResults, 'contestProblem' => $submission->getContestProblem()]; if (!empty($expectedResults) && !$judging->getVerified()) { $numChecked++; - $result = mb_strtoupper($judging->getResult()); if (!in_array($result, $expectedResults)) { - $submissionFiles = $submission->getFiles(); - $unexpected[$submissionId] = ['files' => $submissionFiles, 'actual' => $result, 'expected' => $expectedResults]; + $unexpected[$submissionId] = $entry; } elseif (count($expectedResults) > 1) { if ($verifyMultiple) { // Judging result is as expected, set judging to verified. $judging ->setVerified(true) ->setJuryMember($verifier); - $multiple[$submissionId] = ['actual' => $result, 'expected' => $expectedResults, 'verified' => true]; + $entry['verified'] = true; } else { - $multiple[$submissionId] = ['actual' => $result, 'expected' => $expectedResults, 'verified' => false]; + $entry['verified'] = false; } + $multiple[$submissionId] = $entry; } else { // Judging result is as expected, set judging to verified. $judging ->setVerified(true) ->setJuryMember($verifier); - $verified[$submissionId] = ['actual' => $result, 'expected' => $expectedResults, 'verified' => true]; + $entry['verified'] = true; + $verified[$submissionId] = $entry; } } else { $numUnchecked++; if (empty($expectedResults)) { - $nomatch[$submissionId] = []; + $entry['verified'] = false; + $nomatch[$submissionId] = $entry; } else { - $earlier[$submissionId] = []; + $entry['verified'] = true; + $earlier[$submissionId] = $entry; } } } diff --git a/webapp/src/Twig/TwigExtension.php b/webapp/src/Twig/TwigExtension.php index 7361ba0c6d..ba7774d630 100644 --- a/webapp/src/Twig/TwigExtension.php +++ b/webapp/src/Twig/TwigExtension.php @@ -490,6 +490,7 @@ public function displayTestcaseResults(array $testcases, bool $submissionDone, b public function printResult(?string $result, bool $valid = true, bool $jury = false): string { + $result = strtolower($result); switch ($result) { case 'too-late': $style = 'sol_queued'; diff --git a/webapp/templates/jury/check_judgings.html.twig b/webapp/templates/jury/check_judgings.html.twig index 69c140692e..7f9f9e4a82 100644 --- a/webapp/templates/jury/check_judgings.html.twig +++ b/webapp/templates/jury/check_judgings.html.twig @@ -31,30 +31,52 @@ {% macro verifyResults(id, header, results, collapse) %} {% if results is not empty %}

{{ header }}

-