Skip to content

Commit 466ee4a

Browse files
committed
Add a warning for disabled problem/langs on the rejudging page as well.
1 parent de40776 commit 466ee4a

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

webapp/src/Controller/Jury/RejudgingController.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,21 @@ public function viewAction(
215215
->getQuery()
216216
->getOneOrNullResult();
217217

218+
$disabledProblems = [];
219+
$disabledLangs = [];
220+
foreach ($rejudging->getJudgings() as $judging) {
221+
$submission = $judging->getSubmission();
222+
$problem = $submission->getContestProblem();
223+
$language = $submission->getLanguage();
224+
225+
if (!$problem->getAllowJudge()) {
226+
$disabledProblems[$submission->getProblemId()] = $submission->getProblem()->getName();
227+
}
228+
if (!$language->getAllowJudge()) {
229+
$disabledLangs[$submission->getLanguage()->getLangid()] = $submission->getLanguage()->getName();
230+
}
231+
}
232+
218233
if (!$rejudging) {
219234
throw new NotFoundHttpException(sprintf('Rejudging with ID %s not found', $rejudgingId));
220235
}
@@ -389,6 +404,8 @@ public function viewAction(
389404
'url' => $request->getRequestUri(),
390405
'ajax' => true,
391406
],
407+
'disabledProbs' => $disabledProblems,
408+
'disabledLangs' => $disabledLangs,
392409
];
393410
if ($request->isXmlHttpRequest()) {
394411
$data['ajax'] = true;

webapp/templates/jury/rejudging.html.twig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,27 @@
105105
<div class="alert alert-warning">Judgings in this rejudging will be applied automatically.</div>
106106
{% endif %}
107107

108+
{% if disabledLangs %}
109+
<div class="alert alert-danger">
110+
The following languages are currently not allowed to be judged:
111+
<ul>
112+
{% for id, name in disabledLangs %}
113+
<li>{{ name }}</li>
114+
{% endfor %}
115+
</ul>
116+
</div>
117+
{% endif %}
118+
{% if disabledProbs %}
119+
<div class="alert alert-danger">
120+
The following problems are currently not allowed to be judged:
121+
<ul>
122+
{% for id, name in disabledProbs %}
123+
<li>{{ name }}</li>
124+
{% endfor %}
125+
</ul>
126+
</div>
127+
{% endif %}
128+
108129
<div data-rejudging-matrix>
109130
{% include 'jury/partials/rejudging_matrix.html.twig' %}
110131
</div>

0 commit comments

Comments
 (0)