Skip to content

Commit

Permalink
Allow changing the multi-pass problems attributes in the web UI.
Browse files Browse the repository at this point in the history
Part of DOMjudge#2307.
  • Loading branch information
meisterT committed Oct 5, 2024
1 parent 6530dff commit cbd7160
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/src/Controller/Jury/ProblemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function indexAction(): Response
$type .= ' interactive';
}
if ($p->isMultipassProblem()) {
$type .= ' multi-pass';
$type .= ' multi-pass (max passes: ' . $p->getMultipassLimit() . ')';
}
$problemdata = array_merge($problemdata, [
'num_contests' => ['value' => (int)($contestCounts[$p->getProbid()] ?? 0)],
Expand Down Expand Up @@ -498,7 +498,7 @@ public function viewAction(Request $request, SubmissionService $submissionServic
$type .= ' interactive';
}
if ($problem->isMultipassProblem()) {
$type .= ' multi-pass';
$type .= ' multi-pass (max passes: ' . $problem->getMultipassLimit() . ')';
}
$data = [
'problem' => $problem,
Expand Down
9 changes: 9 additions & 0 deletions webapp/src/Form/Type/ProblemType.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'label' => 'Use run script as compare script.',
'required' => false,
]);
$builder->add('multipassProblem', CheckboxType::class, [
'label' => 'Multi-pass problem',
'required' => false,
]);
$builder->add('multipassLimit', IntegerType::class, [
'label' => 'Multi-pass limit',
'required' => false,
'help' => 'leave empty for default',
]);
$builder->add('save', SubmitType::class);

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

0 comments on commit cbd7160

Please sign in to comment.