Skip to content

Commit ed9f9cf

Browse files
committed
Count in-contest submissions on submission list
This is to make comparing with a shadow CCS easier, as we don't want to include jury submissions here. Filter out submissions in invisible categories.
1 parent bf5d4c3 commit ed9f9cf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

webapp/src/Service/SubmissionService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,14 @@ public function getSubmissionList(
282282
->andWhere($countQueryExtras['queued'])
283283
->getQuery()
284284
->getSingleScalarResult();
285+
$counts['inContest'] = (clone $queryBuilder)
286+
->select('COUNT(s.submitid)')
287+
->join('s.contest', 'c')
288+
->join('t.category', 'tc')
289+
->andWhere('s.submittime BETWEEN c.starttime AND c.endtime')
290+
->andWhere('tc.visible = true')
291+
->getQuery()
292+
->getSingleScalarResult();
285293

286294
return [$submissions, $counts];
287295
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
{% if submissionCounts.queued > 0 %}
4242
<span class="badge text-bg-danger">{{ submissionCounts.queued }} queued (from {{submissionCounts.perteam}} teams)</span>
4343
{% endif %}
44+
45+
{% if submissionCounts.inContest > 0 %}
46+
<span class="badge text-bg-secondary">{{ submissionCounts.inContest }} in contest</span>
47+
{% endif %}
4448
</div>
4549

4650
<table class="data-table table table-hover table{% if showExternalResult and showExternalTestcases %}-3{% endif %}-striped table-sm submissions-table table-full-clickable-cell">

0 commit comments

Comments
 (0)