From 7a7c73a8836529920c4d108746dd351b26133898 Mon Sep 17 00:00:00 2001
From: Michael Vasseur <14887731+vmcj@users.noreply.github.com>
Date: Sun, 26 Oct 2025 16:47:49 +0100
Subject: [PATCH 1/3] Display pre-contest clarifications
We already disclose those in the API, so keep this consistent. This
does result in the `contest time` of that clarification to be negative
but thats factually true.
---
webapp/templates/team/partials/index_content.html.twig | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/webapp/templates/team/partials/index_content.html.twig b/webapp/templates/team/partials/index_content.html.twig
index 34c7ca453c..06e8061eb8 100644
--- a/webapp/templates/team/partials/index_content.html.twig
+++ b/webapp/templates/team/partials/index_content.html.twig
@@ -6,6 +6,10 @@
Contest {{ contest | printContestStart }}
+ {% if clarifications is not empty %}
+ Clarifications
+ {% include 'team/partials/clarification_list.html.twig' with {clarifications: clarifications} %}
+ {% endif %}
{% else %}
From 1c088e88a2eb6d945d3c3e609e26cc8c56ba6067 Mon Sep 17 00:00:00 2001
From: Michael Vasseur <14887731+vmcj@users.noreply.github.com>
Date: Sun, 26 Oct 2025 16:40:01 +0100
Subject: [PATCH 2/3] Don't reference undisclosed problems in clarifications
before conteststart
---
webapp/src/Controller/API/ClarificationController.php | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/webapp/src/Controller/API/ClarificationController.php b/webapp/src/Controller/API/ClarificationController.php
index 397e2e499b..a502b64c82 100644
--- a/webapp/src/Controller/API/ClarificationController.php
+++ b/webapp/src/Controller/API/ClarificationController.php
@@ -297,6 +297,14 @@ protected function getQueryBuilder(Request $request): QueryBuilder
}
}
+ // For non-API-reader users, only expose the problems after the contest has started.
+ // `WF Access Policy` allows for clarifications before the contest, but not to disclose the problem
+ // so referencing them in clarifications would violate referential integrity.
+ if (!$this->dj->checkrole('api_reader')) {
+ $queryBuilder->andWhere('c.starttime < :now OR clar.problem IS NULL')
+ ->setParameter('now', Utils::now());
+ }
+
if ($request->query->has('problem')) {
$queryBuilder
->andWhere('clar.problem = :problem')
From 5616ca0dca40cf7c0cbc844b940ae85ed9f08b53 Mon Sep 17 00:00:00 2001
From: Michael Vasseur <14887731+vmcj@users.noreply.github.com>
Date: Sun, 26 Oct 2025 16:45:44 +0100
Subject: [PATCH 3/3] Don't display clarifications about non-disclosed problems
yet
We do for the jury so they can still see the interface as it would at contest
start.
---
webapp/src/Controller/Team/MiscController.php | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/webapp/src/Controller/Team/MiscController.php b/webapp/src/Controller/Team/MiscController.php
index 1ad3d4e7a1..d304264ad7 100644
--- a/webapp/src/Controller/Team/MiscController.php
+++ b/webapp/src/Controller/Team/MiscController.php
@@ -5,13 +5,13 @@
use App\Controller\BaseController;
use App\DataTransferObject\SubmissionRestriction;
use App\Entity\Clarification;
-use App\Entity\Language;
use App\Form\Type\PrintType;
use App\Service\ConfigurationService;
use App\Service\DOMJudgeService;
use App\Service\EventLogService;
use App\Service\ScoreboardService;
use App\Service\SubmissionService;
+use App\Utils\Utils;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NonUniqueResultException;
use Doctrine\ORM\NoResultException;
@@ -92,8 +92,7 @@ public function homeAction(Request $request): Response
paginated: false
)[0];
- /** @var Clarification[] $clarifications */
- $clarifications = $this->em->createQueryBuilder()
+ $qb = $this->em->createQueryBuilder()
->from(Clarification::class, 'c')
->leftJoin('c.problem', 'p')
->leftJoin('c.sender', 's')
@@ -105,9 +104,12 @@ public function homeAction(Request $request): Response
->setParameter('contest', $contest)
->setParameter('team', $team)
->addOrderBy('c.submittime', 'DESC')
- ->addOrderBy('c.clarid', 'DESC')
- ->getQuery()
- ->getResult();
+ ->addOrderBy('c.clarid', 'DESC');
+ if (!$this->dj->checkrole('jury') && $contest->getStartTimeObject()->getTimestamp() > time()) {
+ $qb->andWhere('c.problem IS NULL');
+ }
+ /** @var Clarification[] $clarifications */
+ $clarifications = $qb->getQuery()->getResult();
/** @var Clarification[] $clarificationRequests */
$clarificationRequests = $this->em->createQueryBuilder()