Skip to content

Commit f1105ea

Browse files
committed
Allow changing the multi-pass problems attributes in the web UI.
Part of #2307.
1 parent 6530dff commit f1105ea

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

webapp/src/Controller/Jury/ProblemController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function indexAction(): Response
212212
$type .= ' interactive';
213213
}
214214
if ($p->isMultipassProblem()) {
215-
$type .= ' multi-pass';
215+
$type .= ' multi-pass (max passes: ' . $p->getMultipassLimit() . ')';
216216
}
217217
$problemdata = array_merge($problemdata, [
218218
'num_contests' => ['value' => (int)($contestCounts[$p->getProbid()] ?? 0)],
@@ -498,7 +498,7 @@ public function viewAction(Request $request, SubmissionService $submissionServic
498498
$type .= ' interactive';
499499
}
500500
if ($problem->isMultipassProblem()) {
501-
$type .= ' multi-pass';
501+
$type .= ' multi-pass (max passes: ' . $problem->getMultipassLimit() . ')';
502502
}
503503
$data = [
504504
'problem' => $problem,

webapp/src/Form/Type/ProblemType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
8181
'label' => 'Use run script as compare script.',
8282
'required' => false,
8383
]);
84+
$builder->add('multipassProblem', CheckboxType::class, [
85+
'label' => 'Multi-pass problem',
86+
'required' => false,
87+
]);
88+
$builder->add('multipassLimit', IntegerType::class, [
89+
'label' => 'Multi-pass limit',
90+
'required' => false,
91+
'help' => 'leave empty for default',
92+
]);
8493
$builder->add('save', SubmitType::class);
8594

8695
// Remove clearProblemstatement field when we do not have a problem text.

0 commit comments

Comments
 (0)