Skip to content

Commit

Permalink
Count in-contest submissions on submission list
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kevinjil committed Sep 28, 2024
1 parent bf5d4c3 commit ed9f9cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webapp/src/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ public function getSubmissionList(
->andWhere($countQueryExtras['queued'])
->getQuery()
->getSingleScalarResult();
$counts['inContest'] = (clone $queryBuilder)
->select('COUNT(s.submitid)')
->join('s.contest', 'c')
->join('t.category', 'tc')
->andWhere('s.submittime BETWEEN c.starttime AND c.endtime')
->andWhere('tc.visible = true')
->getQuery()
->getSingleScalarResult();

return [$submissions, $counts];
}
Expand Down
4 changes: 4 additions & 0 deletions webapp/templates/jury/partials/submission_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
{% if submissionCounts.queued > 0 %}
<span class="badge text-bg-danger">{{ submissionCounts.queued }} queued (from {{submissionCounts.perteam}} teams)</span>
{% endif %}

{% if submissionCounts.inContest > 0 %}
<span class="badge text-bg-secondary">{{ submissionCounts.inContest }} in contest</span>
{% endif %}
</div>

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

0 comments on commit ed9f9cf

Please sign in to comment.