Skip to content

Commit 3a60f88

Browse files
committed
Don't display clarifications about non-disclosed problems yet
We do for the jury so they can still see the interface as a time would see it.
1 parent c8c97ec commit 3a60f88

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

webapp/src/Controller/Team/MiscController.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use App\Controller\BaseController;
66
use App\DataTransferObject\SubmissionRestriction;
77
use App\Entity\Clarification;
8-
use App\Entity\Language;
98
use App\Form\Type\PrintType;
109
use App\Service\ConfigurationService;
1110
use App\Service\DOMJudgeService;
1211
use App\Service\EventLogService;
1312
use App\Service\ScoreboardService;
1413
use App\Service\SubmissionService;
14+
use App\Utils\Utils;
1515
use Doctrine\ORM\EntityManagerInterface;
1616
use Doctrine\ORM\NonUniqueResultException;
1717
use Doctrine\ORM\NoResultException;
@@ -92,8 +92,7 @@ public function homeAction(Request $request): Response
9292
paginated: false
9393
)[0];
9494

95-
/** @var Clarification[] $clarifications */
96-
$clarifications = $this->em->createQueryBuilder()
95+
$qb = $this->em->createQueryBuilder()
9796
->from(Clarification::class, 'c')
9897
->leftJoin('c.problem', 'p')
9998
->leftJoin('c.sender', 's')
@@ -105,9 +104,12 @@ public function homeAction(Request $request): Response
105104
->setParameter('contest', $contest)
106105
->setParameter('team', $team)
107106
->addOrderBy('c.submittime', 'DESC')
108-
->addOrderBy('c.clarid', 'DESC')
109-
->getQuery()
110-
->getResult();
107+
->addOrderBy('c.clarid', 'DESC');
108+
if (!$this->dj->checkrole('jury') && $contest->getStartTimeObject()->getTimestamp() > time()) {
109+
$qb->andWhere('c.problem IS NULL');
110+
}
111+
/** @var Clarification[] $clarifications */
112+
$clarifications = $qb->getQuery()->getResult();
111113

112114
/** @var Clarification[] $clarificationRequests */
113115
$clarificationRequests = $this->em->createQueryBuilder()

0 commit comments

Comments
 (0)