Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could hide this with some JavaScript but I will do this later

Copy link
Contributor

@cubercsl cubercsl Oct 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should check this value before saving?
For multi-pass problems, the passlimit must be >= 2, and for traditional problem it must be equal to 1. (I noticed that getMultiPassLimit checks for traditional problem, but the value stored in the db may be inconsistent)

'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
Loading