Skip to content

Commit de6bb42

Browse files
committed
Get same (wrong) behaviour as balloon page.
1 parent e38b45f commit de6bb42

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

webapp/src/Service/DOMJudgeService.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -419,35 +419,22 @@ public function getUpdates(): array
419419
}
420420
}
421421

422-
if ($this->checkrole('balloon')) {
422+
if ($this->checkrole('balloon') && $contest) {
423423
$balloonsQuery = $this->em->createQueryBuilder()
424424
->select('b.balloonid', 't.name', 't.location', 'p.name AS pname')
425425
->from(Balloon::class, 'b')
426426
->leftJoin('b.submission', 's')
427427
->leftJoin('s.problem', 'p')
428428
->leftJoin('s.contest', 'co')
429+
->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
429430
->leftJoin('s.team', 't')
431+
->andWhere('co.cid = :cid')
432+
->setParameter('cid', $contest->getCid())
430433
->andWhere('b.done = 0');
431434

432-
if ($contest) {
433-
$balloonsQuery->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
434-
->andWhere('co.cid = :cid')
435-
->setParameter('cid', $contest->getCid());
436-
}
437-
438435
if (!(bool)$this->config->get('show_balloons_postfreeze')) {
439-
$balloonsQuery->andWhere('s.submittime < co.freezetime');
440-
//leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
441-
//$freezetime = $contest->getFreezeTime();
442-
//if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) {
443-
// $balloonsQuery
444-
// ->andWhere('s.submittime < :freeze')
445-
// ->setParameter('freeze', $freezetime);
446-
//}
436+
$balloonsQuery->andWhere('s.submittime < co.freezetime');
447437
}
448-
// We can now have the problem that there is no selected contest (so we should list all contests) but only active ones.
449-
$balloonsQuery->andWhere('co.deactivatetime < :now OR co.deactivatetime IS NULL')
450-
->setParameter('now', new DateTime());
451438

452439
$balloons = $balloonsQuery->getQuery()->getResult();
453440
}

0 commit comments

Comments
 (0)