Skip to content

Commit 634c2b3

Browse files
Add rank to first to solve and region winners in results HTML.
Fixes #2480.
1 parent 0574694 commit 634c2b3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

webapp/src/Controller/Jury/ImportExportController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,19 @@ protected function getResultsHtml(Request $request, bool $full = false): Respons
377377
$ranked = [];
378378
$honorable = [];
379379
$regionWinners = [];
380+
$rankPerTeam = [];
380381

381382
$sortOrder = $request->query->getInt('sort_order');
382383

383384
foreach ($this->importExportService->getResultsData($sortOrder, full: $full) as $row) {
384385
$team = $teamNames[$row[0]];
386+
$rankPerTeam[$row[0]] = $row[1];
385387

386388
if ($row[6] !== '') {
387389
$regionWinners[] = [
388390
'group' => $row[6],
389391
'team' => $team,
392+
'rank' => $row[1] ?: '-',
390393
];
391394
}
392395

@@ -434,6 +437,7 @@ protected function getResultsHtml(Request $request, bool $full = false): Respons
434437
'problem_name' => $problem->getProblem()->getName(),
435438
'team' => null,
436439
'time' => null,
440+
'rank' => null,
437441
];
438442
foreach ($teams as $team) {
439443
if (!isset($categories[$team->getCategory()->getCategoryid()]) || $team->getCategory()->getSortorder() !== $sortOrder) {
@@ -446,6 +450,7 @@ protected function getResultsHtml(Request $request, bool $full = false): Respons
446450
'problem' => $problem->getShortname(),
447451
'problem_name' => $problem->getProblem()->getName(),
448452
'team' => $teamNames[$team->getIcpcId()],
453+
'rank' => $rankPerTeam[$team->getIcpcId()] ?: '-',
449454
'time' => Utils::scoretime($matrixItem->time, $scoreIsInSeconds),
450455
];
451456
}

webapp/templates/jury/export/results.html.twig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@
6565
<thead>
6666
<tr>
6767
<th scope="col">Region</th>
68+
<th scope="col">Rank</th>
6869
<th scope="col">Team</th>
6970
</tr>
7071
</thead>
7172
<tbody>
7273
{% for row in regionWinners %}
7374
<tr>
7475
<th scope="row">{{ row.group }}</th>
76+
<td>{{ row.rank }}</td>
7577
<td>{{ row.team }}</td>
7678
</tr>
7779
{% endfor %}
@@ -84,6 +86,7 @@
8486
<tr>
8587
<th scope="col">Problem</th>
8688
<th scope="col">Team</th>
89+
<th scope="col">Rank</th>
8790
<th scope="col">Time</th>
8891
</tr>
8992
</thead>
@@ -98,6 +101,13 @@
98101
<i>Not solved</i>
99102
{% endif %}
100103
</td>
104+
<td>
105+
{% if row.rank is not null %}
106+
{{ row.rank }}
107+
{% else %}
108+
<i>-</i>
109+
{% endif %}
110+
</td>
101111
<td>
102112
{% if row.time is not null %}
103113
{{ row.time }}

0 commit comments

Comments
 (0)