Skip to content

Commit

Permalink
Highlight pending submissions during freeze on jury scoreboard
Browse files Browse the repository at this point in the history
Also, during the freeze, also show "x + y tries" for jury.

Fixes DOMjudge#2572
  • Loading branch information
meisterT authored and mpsijm committed Jun 8, 2024
1 parent 6df01fe commit a7d8c91
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 14 deletions.
8 changes: 4 additions & 4 deletions webapp/public/style_domjudge.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ img.affiliation-logo {
padding-right: 3pt;
}

.score_correct { background: #60e760; }
.score_first { background: #1daa1d !important; }
.score_pending { background: #6666FF; }
.score_incorrect { background: #e87272; }
.score_correct { background: #60e760; }
.score_correct.score_first { background: #1daa1d; }
.score_incorrect { background: #e87272; }
.score_pending { background: #6666ff; }

.gold-medal { background-color: #EEC710 }
.silver-medal { background-color: #AAA }
Expand Down
5 changes: 5 additions & 0 deletions webapp/public/style_jury.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ tr.summary td { border-top: 1px solid black; }
clickable in the jury scoreboard and for all team cells */
.scoreboard_jury td, .scoreboard_jury th { padding: 0; }

/* show pending submissions using a blue corner */
.score_pending.score_correct { background: linear-gradient(45deg, #60e760 85%, #6666ff 85%); }
.score_pending.score_correct.score_first { background: linear-gradient(45deg, #1daa1d 85%, #6666ff 85%); }
.score_pending.score_incorrect { background: linear-gradient(45deg, #e87272 85%, #6666ff 85%); }

#submission_layout { width: 100%; }

#djlogo {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Service/ScoreboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ public function getScoreboardTwigData(
$data['showFlags'] = $this->config->get('show_flags');
$data['showAffiliationLogos'] = $this->config->get('show_affiliation_logos');
$data['showAffiliations'] = $this->config->get('show_affiliations');
$data['showPending'] = $this->config->get('show_pending');
$data['showPending'] = empty($scoreboard) || $scoreboard->getFreezeData()->showFrozen() ? $this->config->get('show_pending') : 0;
$data['showTeamSubmissions'] = $this->config->get('show_teams_submissions');
$data['scoreInSeconds'] = $this->config->get('score_in_seconds');
$data['maxWidth'] = $this->config->get('team_column_width');
Expand Down
5 changes: 3 additions & 2 deletions webapp/src/Utils/Scoreboard/Scoreboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ protected function calculateScoreboard(): void
$this->matrix[$teamId][$probId] = new ScoreboardMatrixItem(
$scoreRow->getIsCorrect($this->restricted),
$scoreRow->getIsCorrect($this->restricted) && $scoreRow->getIsFirstToSolve(),
$scoreRow->getSubmissions($this->restricted),
$scoreRow->getPending($this->restricted),
// When public scoreboard is frozen, also show "x + y tries" for jury
$scoreRow->getSubmissions($this->freezeData->showFrozen() ? false : $this->restricted),
$scoreRow->getPending($this->freezeData->showFrozen() ? false : $this->restricted),
$scoreRow->getSolveTime($this->restricted),
$penalty,
$scoreRow->getRuntime($this->restricted)
Expand Down
5 changes: 3 additions & 2 deletions webapp/src/Utils/Scoreboard/SingleTeamScoreboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ protected function calculateScoreboard(): void
$this->matrix[$scoreRow->getTeam()->getTeamid()][$scoreRow->getProblem()->getProbid()] = new ScoreboardMatrixItem(
$scoreRow->getIsCorrect($this->restricted),
$scoreRow->getIsCorrect($this->showRestrictedFts) && $scoreRow->getIsFirstToSolve(),
$scoreRow->getSubmissions($this->restricted),
$scoreRow->getPending($this->restricted),
// When public scoreboard is frozen, also show "x + y tries" for jury
$scoreRow->getSubmissions($this->freezeData->showFrozen() ? false : $this->restricted),
$scoreRow->getPending($this->freezeData->showFrozen() ? false : $this->restricted),
$scoreRow->getSolveTime($this->restricted),
$penalty,
$scoreRow->getRuntime($this->restricted)
Expand Down
7 changes: 4 additions & 3 deletions webapp/templates/partials/scoreboard.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@
</div>
{% endif %}

{% if scoreboard.freezeData.showFrozen(false) %}
{% if scoreboard.freezeData.showFrozen %}
<div class="alert alert-warning" role="alert" style="font-size: 80%;">
{% if jury %}
<a href="{{ path('public_index') }}">The public scoreboard</a>
was frozen with {{ current_contest.minutesRemaining }} minutes remaining
was frozen with {{ current_contest.minutesRemaining }} minutes remaining.
{% if showPending %}Submissions after the freeze are indicated with a blue corner.{% endif %}
{% else %}
The scoreboard was frozen with {{ current_contest.minutesRemaining }} minutes remaining - solutions
submitted in the last {{ current_contest.minutesRemaining }} minutes of the contest {% if showPending %}are still shown as pending{% else %}are not shown{% endif %}.
Expand All @@ -109,7 +110,7 @@
(filterValues.affiliations | length > 1 or
filterValues.countries | length > 1 or
filterValues.categories | length > 1) %}
<div class="dropdown">
<div class="dropdown">
<button class="btn btn-outline-secondary btn-sm m-2 dropdown-toggle" data-bs-toggle="dropdown"
aria-haspopup="true" aria-expanded="false" id="filter-toggle">
<i class="fas fa-filter"></i>
Expand Down
11 changes: 9 additions & 2 deletions webapp/templates/partials/scoreboard_table.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,24 @@
{% set scoreCssClass = 'score_correct' %}
{% if enable_ranking %}
{% if not scoreboard.getRuntimeAsScoreTiebreaker() and scoreboard.solvedFirst(score.team, problem) %}
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
{% endif %}
{% if scoreboard.getRuntimeAsScoreTiebreaker() and scoreboard.isFastestSubmission(score.team, problem) %}
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
{% set scoreCssClass = scoreCssClass ~ ' score_first' %}
{% endif %}
{% endif %}
{% elseif showPending and matrixItem.numSubmissionsPending > 0 %}
{% set scoreCssClass = 'score_pending' %}
{% elseif matrixItem.numSubmissions > 0 %}
{% set scoreCssClass = 'score_incorrect' %}
{% endif %}
{% if jury and showPending and matrixItem.numSubmissionsPending > 0 %}
{% if scoreCssClass == 'score_pending' %}
{% set scoreCssClass = scoreCssClass ~ ' score_incorrect' %}
{% else %}
{% set scoreCssClass = scoreCssClass ~ ' score_pending' %}
{% endif %}
{% endif %}
{% set numSubmissions = matrixItem.numSubmissions %}
{% if showPending and matrixItem.numSubmissionsPending > 0 %}
Expand Down

0 comments on commit a7d8c91

Please sign in to comment.