Skip to content

Commit 2f6c3ec

Browse files
committed
Only set valid to false if source is import
1 parent 44daec8 commit 2f6c3ec

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

webapp/src/Service/SubmissionService.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -726,15 +726,12 @@ public function submitSolution(
726726
// This is so that we can use the submitid/judgingid below.
727727
$this->em->flush();
728728

729-
$priority = match ($source) {
730-
SubmissionSource::PROBLEM_IMPORT => JudgeTask::PRIORITY_LOW,
731-
default => JudgeTask::PRIORITY_DEFAULT,
732-
};
733729
// Create judgetask as invalid when evaluating as analyst.
734730
$lazyEval = $this->config->get('lazy_eval_results');
735731
// We create invalid judgetasks, and only mark them valid when they are interesting for the analysts.
736-
$start_invalid = $lazyEval === DOMJudgeService::EVAL_ANALYST && $source == SubmissionSource::SHADOWING;
737-
$this->dj->maybeCreateJudgeTasks($judging, $priority, valid: !$start_invalid);
732+
$isAnalystImport = $source === SubmissionSource::SHADOWING && $lazyEval === DOMJudgeService::EVAL_ANALYST;
733+
$priority = $isAnalystImport ? JudgeTask::PRIORITY_LOW : JudgeTask::PRIORITY_DEFAULT;
734+
$this->dj->maybeCreateJudgeTasks($judging, $priority, valid: !$isAnalystImport);
738735
}
739736

740737
$this->em->wrapInTransaction(function () use ($contest, $submission) {

0 commit comments

Comments
 (0)