From 2c68b189691409474e94ca781a1a67a6742683f2 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 28 Sep 2025 12:30:11 +0200 Subject: [PATCH] Only show diff between submissions in the same contest We get this case for jury imports where the same team DOMjudge uploads in multiple contests (dress + finals) and the first "finals" submission would show a diff with the last jury submission of the dress contest. We could also have this if a team is in 2 contests at the same time but although in theory possible this shouldn't happen in practice. --- webapp/src/Controller/Jury/SubmissionController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp/src/Controller/Jury/SubmissionController.php b/webapp/src/Controller/Jury/SubmissionController.php index 5f4cf38def..acca869506 100644 --- a/webapp/src/Controller/Jury/SubmissionController.php +++ b/webapp/src/Controller/Jury/SubmissionController.php @@ -889,10 +889,12 @@ public function sourceAction( ->andWhere('s.problem = :probid') ->andWhere('s.language = :langid') ->andWhere('s.submittime < :submittime') + ->andWhere('s.contest = :contest') ->setParameter('teamid', $submission->getTeam()) ->setParameter('probid', $submission->getProblem()) ->setParameter('langid', $submission->getLanguage()) ->setParameter('submittime', $submission->getSubmittime()) + ->setParameter('contest', $submission->getContest()) ->orderBy('s.submittime', 'DESC') ->setMaxResults(1) ->getQuery()