diff --git a/webapp/src/Controller/Jury/SubmissionController.php b/webapp/src/Controller/Jury/SubmissionController.php index 590079e06a..3e0069cff7 100644 --- a/webapp/src/Controller/Jury/SubmissionController.php +++ b/webapp/src/Controller/Jury/SubmissionController.php @@ -494,6 +494,8 @@ public function viewAction( ->getSingleScalarResult(); } + $evalOnDemand = $submission->getContestProblem()->determineOnDemand($this->config->get('lazy_eval_results')); + $twigData = [ 'submission' => $submission, 'lastSubmission' => $lastSubmission, @@ -515,6 +517,7 @@ public function viewAction( 'combinedRunCompare' => $submission->getProblem()->getCombinedRunCompare(), 'requestedOutputCount' => $requestedOutputCount, 'version_warnings' => [], + 'evalOnDemand' => $evalOnDemand, ]; if ($selectedJudging === null) { @@ -1203,6 +1206,14 @@ public function createJudgeTasks(string $submitId): RedirectResponse return $this->redirectToRoute('jury_submission', ['submitId' => $submitId]); } + #[Route(path: '/{submitId<\d+>}/create-tasks-full', name: 'jury_submission_create_tasks_full')] + public function createJudgeTasksFull(string $submitId): RedirectResponse + { + $this->dj->unblockJudgeTasksForSubmission($submitId, true); + $this->addFlash('info', "Started judging all testcases for submission: $submitId"); + return $this->redirectToRoute('jury_submission', ['submitId' => $submitId]); + } + /** * @param string[] $allErrors */ diff --git a/webapp/src/Service/DOMJudgeService.php b/webapp/src/Service/DOMJudgeService.php index 08a1a2430f..292915047c 100644 --- a/webapp/src/Service/DOMJudgeService.php +++ b/webapp/src/Service/DOMJudgeService.php @@ -1126,7 +1126,7 @@ public function unblockJudgeTasksForProblem(int $probId): void } } - public function unblockJudgeTasksForSubmission(string $submissionId): void + public function unblockJudgeTasksForSubmission(string $submissionId, bool $judgeCompletely = false): void { // These are all the judgings that don't have associated judgetasks yet. Check whether we unblocked them. $judgings = $this->helperUnblockJudgeTasks() @@ -1136,7 +1136,7 @@ public function unblockJudgeTasksForSubmission(string $submissionId): void ->getQuery() ->getResult(); foreach ($judgings as $judging) { - $this->maybeCreateJudgeTasks($judging, JudgeTask::PRIORITY_DEFAULT, true); + $this->maybeCreateJudgeTasks($judging, JudgeTask::PRIORITY_DEFAULT, true, judgeCompletely: $judgeCompletely); } } @@ -1151,7 +1151,7 @@ public function unblockJudgeTasks(): void } } - public function maybeCreateJudgeTasks(Judging $judging, int $priority = JudgeTask::PRIORITY_DEFAULT, bool $manualRequest = false): void + public function maybeCreateJudgeTasks(Judging $judging, int $priority = JudgeTask::PRIORITY_DEFAULT, bool $manualRequest = false, bool $judgeCompletely = false): void { $submission = $judging->getSubmission(); $problem = $submission->getContestProblem(); @@ -1181,6 +1181,10 @@ public function maybeCreateJudgeTasks(Judging $judging, int $priority = JudgeTas return; } + if ($judgeCompletely) { + $judging->setJudgeCompletely(true); + } + // We use a mass insert query, since that is way faster than doing a separate insert for each testcase. // We first insert judgetasks, then select their ID's and finally insert the judging runs. diff --git a/webapp/templates/jury/submission.html.twig b/webapp/templates/jury/submission.html.twig index 8dc109b7af..e2cbba77d3 100644 --- a/webapp/templates/jury/submission.html.twig +++ b/webapp/templates/jury/submission.html.twig @@ -395,10 +395,19 @@   {% if selectedJudging is null or selectedJudging.result is empty %} {%- if not selectedJudging or not selectedJudging.started %} + {% if evalOnDemand %} + + + +   + {% endif %} {%- endif %}