Skip to content

Commit

Permalink
Add option to filter submissions which are currently judging. (#2143)
Browse files Browse the repository at this point in the history
* Add option to display submissions which are currently judging.

* Remove dump
  • Loading branch information
meisterT authored Sep 18, 2023
1 parent bf1bd43 commit aa7022c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webapp/src/Controller/Jury/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function indexAction(
#[MapQueryParameter(name: 'view')]
?string $viewFromRequest = null,
): Response {
$viewTypes = [0 => 'newest', 1 => 'unverified', 2 => 'unjudged', 3 => 'all'];
$viewTypes = [0 => 'newest', 1 => 'unverified', 2 => 'unjudged', 3 => 'judging', 4 => 'all'];
$view = 0;
if (($submissionViewCookie = $this->dj->getCookie('domjudge_submissionview')) &&
isset($viewTypes[$submissionViewCookie])) {
Expand Down Expand Up @@ -101,6 +101,9 @@ public function indexAction(
if ($viewTypes[$view] == 'unjudged') {
$restrictions['judged'] = 0;
}
if ($viewTypes[$view] == 'judging') {
$restrictions['judging'] = 1;
}

$contests = $this->dj->getCurrentContests();
if ($contest = $this->dj->getCurrentContest()) {
Expand Down
7 changes: 7 additions & 0 deletions webapp/src/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ public function getSubmissionList(
$queryBuilder->andWhere('j.result IS NULL OR j.endtime IS NULL');
}
}
if (isset($restrictions['judging'])) {
if ($restrictions['judging']) {
$queryBuilder->andWhere('j.starttime IS NOT NULL AND j.result IS NULL');
} else {
$queryBuilder->andWhere('j.starttime IS NULL OR j.result IS NOT NULL');
}
}

if (isset($restrictions['externally_judged'])) {
if ($restrictions['externally_judged']) {
Expand Down

0 comments on commit aa7022c

Please sign in to comment.