Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to filter submissions which are currently judging. #2143

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 8 additions & 0 deletions webapp/src/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ public function getSubmissionList(
$queryBuilder->andWhere('j.result IS NULL OR j.endtime IS NULL');
}
}
if (isset($restrictions['judging'])) {
dump($restrictions);
meisterT marked this conversation as resolved.
Show resolved Hide resolved
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');
meisterT marked this conversation as resolved.
Show resolved Hide resolved
}
}

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