diff --git a/webapp/src/Twig/TwigExtension.php b/webapp/src/Twig/TwigExtension.php index 9ddbfaddb4..6a5e823afc 100644 --- a/webapp/src/Twig/TwigExtension.php +++ b/webapp/src/Twig/TwigExtension.php @@ -215,26 +215,31 @@ public function printtime(string|float|null $datetime, ?string $format = null, ? } } - public function printHumanTimeDiff(float|null $datetime): string + public function printHumanTimeDiff(float|null $startTime, float|null $endTime): string { - if ($datetime === null) { + if ($startTime === null) { return ''; } - $diff = Utils::now() - $datetime; + $suffix = ''; + if ($endTime === null) { + $suffix = ' ago'; + $endTime = Utils::now(); + } + $diff = $endTime - $startTime; if ($diff < 120) { - return (int)($diff) . ' seconds ago'; + return (int)($diff) . ' seconds' . $suffix; } $diff /= 60; if ($diff < 120) { - return (int)($diff) . ' minutes ago'; + return (int)($diff) . ' minutes' . $suffix; } $diff /= 60; if ($diff < 48) { - return (int)($diff) . ' hours ago'; + return (int)($diff) . ' hours' . $suffix; } $diff /= 24; - return (int)($diff) . ' days ago'; + return (int)($diff) . ' days' . $suffix; } /** @@ -438,7 +443,7 @@ public function displayTestcaseResults(array $testcases, bool $submissionDone, b $lastTypeSample = true; foreach ($testcases as $testcase) { if ($testcase->getSample() != $lastTypeSample) { - $results .= ' | '; + $results .= ' | '; $lastTypeSample = $testcase->getSample(); } @@ -662,6 +667,7 @@ private function getCommonPrefix(array $strings): string */ public function printHosts(array $hostnames): string { + $hostnames = array_values($hostnames); if (empty($hostnames)) { return ""; } diff --git a/webapp/templates/jury/analysis/download_graphs.html.twig b/webapp/templates/jury/analysis/download_graphs.html.twig index 3ba2ef2ac5..9978d672e2 100644 --- a/webapp/templates/jury/analysis/download_graphs.html.twig +++ b/webapp/templates/jury/analysis/download_graphs.html.twig @@ -48,7 +48,7 @@ $(function () { $('.container-fluid svg').each(function () { - var $button = $(''); + var $button = $(''); var $svg = $(this); // Pick a good place for the button, on the submission page next to diff --git a/webapp/templates/jury/partials/submission_graph.html.twig b/webapp/templates/jury/partials/submission_graph.html.twig index 6a74534f57..c8cb166fbe 100644 --- a/webapp/templates/jury/partials/submission_graph.html.twig +++ b/webapp/templates/jury/partials/submission_graph.html.twig @@ -1,21 +1,43 @@ {% set timelimit = submission.problem.timelimit * submission.language.timeFactor %}
- {{ label }}: {% if judging.verified %}yes{% else %}no{% endif %} + {% if judging.verified %} + {{ label }}: yes + {% endif %} {%- if judging.verified and judging.juryMember is not empty -%} , by {{ judging.juryMember }} {%- if judging.verifyComment is not empty %} diff --git a/webapp/templates/jury/submission.html.twig b/webapp/templates/jury/submission.html.twig index c7390f383e..22146b75a0 100644 --- a/webapp/templates/jury/submission.html.twig +++ b/webapp/templates/jury/submission.html.twig @@ -83,9 +83,10 @@ {% endfor %} {% endif %} -
{{ submission.importError }}
{{ submission.importError }}
{{ output }}
testcase runs: | +{% if selectedJudging is null %} {% set judgingDone = false %} @@ -508,6 +556,18 @@ {% endif %} {% endif %} | ++ {# Show JS toggle of previous submission results #} + {% if lastJudging is not null %} + + show/hide + results of previous submission s{{ lastSubmission.submitid }} + {% if lastJudging.verifyComment %} + (verify comment: '{{ lastJudging.verifyComment }}') + {% endif %} + + {% endif %} + |
{{ output }}