Skip to content

Commit de40776

Browse files
committed
Do not include submissions in rejudging if problem/language are not allowed to be judged.
1 parent c133c01 commit de40776

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

webapp/src/Service/RejudgingService.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,23 @@ public function createRejudging(
8282
$index = 0;
8383
$first = true;
8484
foreach ($judgings as $judging) {
85+
$submission = $judging->getSubmission();
86+
$contestProblem = $submission->getContestProblem();
87+
$language = $submission->getLanguage();
88+
8589
$index++;
86-
if ($judging->getSubmission()->getRejudging() !== null) {
87-
// The submission is already part of another rejudging, record and skip it.
90+
if (
91+
// Record and skip submission/judging if it is already part of another judging or is not allowed
92+
// to be judged.
93+
$submission->getRejudging() !== null
94+
|| !$contestProblem->getAllowJudge()
95+
|| !$language->getAllowJudge()
96+
) {
8897
$skipped[] = $judging;
8998
continue;
9099
}
91100

101+
92102
$this->em->wrapInTransaction(function () use (
93103
$priority,
94104
$singleJudging,

0 commit comments

Comments
 (0)