Skip to content

Commit 7cb1de8

Browse files
meisterTvmcj
authored andcommitted
Highlight pending submissions during freeze on jury scoreboard
Also, during the freeze, also show "x + y tries" for jury. Fixes #2572
1 parent 6df01fe commit 7cb1de8

File tree

7 files changed

+29
-14
lines changed

7 files changed

+29
-14
lines changed

webapp/public/style_domjudge.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ img.affiliation-logo {
265265
padding-right: 3pt;
266266
}
267267

268-
.score_correct { background: #60e760; }
269-
.score_first { background: #1daa1d !important; }
270-
.score_pending { background: #6666FF; }
271-
.score_incorrect { background: #e87272; }
268+
.score_correct { background: #60e760; }
269+
.score_correct.score_first { background: #1daa1d; }
270+
.score_incorrect { background: #e87272; }
271+
.score_pending { background: #6666ff; }
272272

273273
.gold-medal { background-color: #EEC710 }
274274
.silver-medal { background-color: #AAA }

webapp/public/style_jury.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ tr.summary td { border-top: 1px solid black; }
4848
clickable in the jury scoreboard and for all team cells */
4949
.scoreboard_jury td, .scoreboard_jury th { padding: 0; }
5050

51+
/* show pending submissions using a blue corner */
52+
.score_pending.score_correct { background: linear-gradient(45deg, #60e760 85%, #6666ff 85%); }
53+
.score_pending.score_correct.score_first { background: linear-gradient(45deg, #1daa1d 85%, #6666ff 85%); }
54+
.score_pending.score_incorrect { background: linear-gradient(45deg, #e87272 85%, #6666ff 85%); }
55+
5156
#submission_layout { width: 100%; }
5257

5358
#djlogo {

webapp/src/Service/ScoreboardService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ public function getScoreboardTwigData(
932932
$data['showFlags'] = $this->config->get('show_flags');
933933
$data['showAffiliationLogos'] = $this->config->get('show_affiliation_logos');
934934
$data['showAffiliations'] = $this->config->get('show_affiliations');
935-
$data['showPending'] = $this->config->get('show_pending');
935+
$data['showPending'] = empty($scoreboard) || $scoreboard->getFreezeData()->showFrozen() ? $this->config->get('show_pending') : 0;
936936
$data['showTeamSubmissions'] = $this->config->get('show_teams_submissions');
937937
$data['scoreInSeconds'] = $this->config->get('score_in_seconds');
938938
$data['maxWidth'] = $this->config->get('team_column_width');

webapp/src/Utils/Scoreboard/Scoreboard.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ protected function calculateScoreboard(): void
154154
$this->matrix[$teamId][$probId] = new ScoreboardMatrixItem(
155155
$scoreRow->getIsCorrect($this->restricted),
156156
$scoreRow->getIsCorrect($this->restricted) && $scoreRow->getIsFirstToSolve(),
157-
$scoreRow->getSubmissions($this->restricted),
158-
$scoreRow->getPending($this->restricted),
157+
// When public scoreboard is frozen, also show "x + y tries" for jury
158+
$scoreRow->getSubmissions($this->freezeData->showFrozen() ? false : $this->restricted),
159+
$scoreRow->getPending($this->freezeData->showFrozen() ? false : $this->restricted),
159160
$scoreRow->getSolveTime($this->restricted),
160161
$penalty,
161162
$scoreRow->getRuntime($this->restricted)

webapp/src/Utils/Scoreboard/SingleTeamScoreboard.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ protected function calculateScoreboard(): void
6565
$this->matrix[$scoreRow->getTeam()->getTeamid()][$scoreRow->getProblem()->getProbid()] = new ScoreboardMatrixItem(
6666
$scoreRow->getIsCorrect($this->restricted),
6767
$scoreRow->getIsCorrect($this->showRestrictedFts) && $scoreRow->getIsFirstToSolve(),
68-
$scoreRow->getSubmissions($this->restricted),
69-
$scoreRow->getPending($this->restricted),
68+
// When public scoreboard is frozen, also show "x + y tries" for jury
69+
$scoreRow->getSubmissions($this->freezeData->showFrozen() ? false : $this->restricted),
70+
$scoreRow->getPending($this->freezeData->showFrozen() ? false : $this->restricted),
7071
$scoreRow->getSolveTime($this->restricted),
7172
$penalty,
7273
$scoreRow->getRuntime($this->restricted)

webapp/templates/partials/scoreboard.html.twig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@
9393
</div>
9494
{% endif %}
9595

96-
{% if scoreboard.freezeData.showFrozen(false) %}
96+
{% if scoreboard.freezeData.showFrozen %}
9797
<div class="alert alert-warning" role="alert" style="font-size: 80%;">
9898
{% if jury %}
9999
<a href="{{ path('public_index') }}">The public scoreboard</a>
100-
was frozen with {{ current_contest.minutesRemaining }} minutes remaining
100+
was frozen with {{ current_contest.minutesRemaining }} minutes remaining.
101+
{% if showPending %}Submissions after the freeze are indicated with a blue corner.{% endif %}
101102
{% else %}
102103
The scoreboard was frozen with {{ current_contest.minutesRemaining }} minutes remaining - solutions
103104
submitted in the last {{ current_contest.minutesRemaining }} minutes of the contest {% if showPending %}are still shown as pending{% else %}are not shown{% endif %}.
@@ -109,7 +110,7 @@
109110
(filterValues.affiliations | length > 1 or
110111
filterValues.countries | length > 1 or
111112
filterValues.categories | length > 1) %}
112-
<div class="dropdown">
113+
<div class="dropdown">
113114
<button class="btn btn-outline-secondary btn-sm m-2 dropdown-toggle" data-bs-toggle="dropdown"
114115
aria-haspopup="true" aria-expanded="false" id="filter-toggle">
115116
<i class="fas fa-filter"></i>

webapp/templates/partials/scoreboard_table.html.twig

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,24 @@
249249
{% set scoreCssClass = 'score_correct' %}
250250
{% if enable_ranking %}
251251
{% if not scoreboard.getRuntimeAsScoreTiebreaker() and scoreboard.solvedFirst(score.team, problem) %}
252-
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
252+
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
253253
{% endif %}
254254
{% if scoreboard.getRuntimeAsScoreTiebreaker() and scoreboard.isFastestSubmission(score.team, problem) %}
255-
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
255+
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
256256
{% endif %}
257257
{% endif %}
258258
{% elseif showPending and matrixItem.numSubmissionsPending > 0 %}
259259
{% set scoreCssClass = 'score_pending' %}
260260
{% elseif matrixItem.numSubmissions > 0 %}
261261
{% set scoreCssClass = 'score_incorrect' %}
262262
{% endif %}
263+
{% if jury and showPending and matrixItem.numSubmissionsPending > 0 %}
264+
{% if scoreCssClass == 'score_pending' %}
265+
{% set scoreCssClass = scoreCssClass ~ ' score_incorrect' %}
266+
{% else %}
267+
{% set scoreCssClass = scoreCssClass ~ ' score_pending' %}
268+
{% endif %}
269+
{% endif %}
263270
264271
{% set numSubmissions = matrixItem.numSubmissions %}
265272
{% if showPending and matrixItem.numSubmissionsPending > 0 %}

0 commit comments

Comments
 (0)