Skip to content

Commit 8c5934d

Browse files
Use accepted and rejected instead of full verdict
Also drop time tie breaker column.
1 parent 14242a4 commit 8c5934d

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

webapp/src/Twig/TwigExtension.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,12 @@ public function displayTestcaseResults(array $testcases, bool $submissionDone, b
513513
return $results;
514514
}
515515

516-
public function printResult(?string $result, bool $valid = true, bool $jury = false): string
516+
public function printResult(
517+
?string $result,
518+
bool $valid = true,
519+
bool $jury = false,
520+
bool $onlyAcceptedAndRejected = false,
521+
): string
517522
{
518523
$result = strtolower($result ?? '');
519524
switch ($result) {
@@ -536,9 +541,15 @@ public function printResult(?string $result, bool $valid = true, bool $jury = fa
536541
break;
537542
case 'correct':
538543
$style = 'sol_correct';
544+
if ($onlyAcceptedAndRejected) {
545+
$result = 'accepted';
546+
}
539547
break;
540548
default:
541549
$style = 'sol_incorrect';
550+
if ($onlyAcceptedAndRejected) {
551+
$result = 'rejected';
552+
}
542553
}
543554

544555
return sprintf('<span class="sol %s">%s</span>', $valid ? $style : 'disabled', $result);

webapp/templates/public/partials/submission_list.html.twig

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
<th scope="col">time</th>
1111
<th scope="col">language</th>
1212
<th scope="col">result</th>
13-
{% if contest.getRuntimeAsScoreTiebreaker() %}
14-
<th scope="col">runtime</th>
15-
{% endif %}
1613
</tr>
1714
</thead>
1815
<tbody>
@@ -35,19 +32,10 @@
3532
{% elseif verificationRequired and not submission.judgings.first.verified %}
3633
{{ '' | printResult }}
3734
{% else %}
38-
{{ submission.judgings.first.result | printResult }}
35+
{{ submission.judgings.first.result | printResult(true, false, true) }}
3936
{% endif %}
4037
{% endif %}
4138
</td>
42-
{% if contest.getRuntimeAsScoreTiebreaker() %}
43-
<td>
44-
{% if link and submission.getResult() == 'correct' %}
45-
{{ "%0.3f s" | format(submission.judgings.first.getMaxRuntime()) }}
46-
{% else %}
47-
-
48-
{% endif %}
49-
</td>
50-
{% endif %}
5139
</tr>
5240
{% endfor %}
5341
</tbody>

webapp/templates/public/team_submissions.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{% extends "public/base.html.twig" %}
22

33
{% block title %}
4-
{% if team is not empty %}Submissions for team {{ team.effectiveName }} and problem {{ problem.problem.name }} - {% endif %}{{ parent() }}
4+
{% if team is not empty %}Submissions for team {{ team.effectiveName }} on problem {{ problem.problem.name }} - {% endif %}{{ parent() }}
55
{% endblock %}
66

77
{% block content %}
88
<h1 class="mt-3">
9-
Submissions for team {{ team.effectiveName }} and problem {{ problem | problemBadge }} {{ problem.problem.name }}
9+
Submissions for team {{ team.effectiveName }} on problem {{ problem | problemBadge }} {{ problem.problem.name }}
1010
</h1>
1111

1212
{% include 'public/partials/submission_list.html.twig' %}

webapp/templates/public/team_submissions_modal.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "partials/modal.html.twig" %}
22

33
{% block title %}
4-
Submissions for team {{ team.effectiveName }} and problem {{ problem | problemBadge }} {{ problem.problem.name }}
4+
Submissions for team {{ team.effectiveName }} on problem {{ problem | problemBadge }} {{ problem.problem.name }}
55
{% endblock %}
66

77
{% block content %}

0 commit comments

Comments
 (0)