Skip to content

Commit

Permalink
Get same (wrong) behaviour as balloon page.
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Jul 23, 2024
1 parent e38b45f commit de6bb42
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions webapp/src/Service/DOMJudgeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,35 +419,22 @@ public function getUpdates(): array
}
}

if ($this->checkrole('balloon')) {
if ($this->checkrole('balloon') && $contest) {
$balloonsQuery = $this->em->createQueryBuilder()
->select('b.balloonid', 't.name', 't.location', 'p.name AS pname')
->from(Balloon::class, 'b')
->leftJoin('b.submission', 's')
->leftJoin('s.problem', 'p')
->leftJoin('s.contest', 'co')
->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
->leftJoin('s.team', 't')
->andWhere('co.cid = :cid')
->setParameter('cid', $contest->getCid())
->andWhere('b.done = 0');

if ($contest) {
$balloonsQuery->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
->andWhere('co.cid = :cid')
->setParameter('cid', $contest->getCid());
}

if (!(bool)$this->config->get('show_balloons_postfreeze')) {
$balloonsQuery->andWhere('s.submittime < co.freezetime');
//leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
//$freezetime = $contest->getFreezeTime();
//if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) {
// $balloonsQuery
// ->andWhere('s.submittime < :freeze')
// ->setParameter('freeze', $freezetime);
//}
$balloonsQuery->andWhere('s.submittime < co.freezetime');
}

Check failure on line 437 in webapp/src/Service/DOMJudgeService.php

View workflow job for this annotation

GitHub Actions / phpcs

Spaces must be used to indent lines; tabs are not allowed

Check failure on line 437 in webapp/src/Service/DOMJudgeService.php

View workflow job for this annotation

GitHub Actions / phpcs

Line indented incorrectly; expected 12 spaces, found 8

Check failure on line 437 in webapp/src/Service/DOMJudgeService.php

View workflow job for this annotation

GitHub Actions / phpcs

Closing brace indented incorrectly; expected 12 spaces, found 8
// We can now have the problem that there is no selected contest (so we should list all contests) but only active ones.
$balloonsQuery->andWhere('co.deactivatetime < :now OR co.deactivatetime IS NULL')
->setParameter('now', new DateTime());

$balloons = $balloonsQuery->getQuery()->getResult();
}
Expand Down

0 comments on commit de6bb42

Please sign in to comment.