You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// this up() migration is auto-generated, please modify it to your needs
23
+
$this->addSql('ALTER TABLE problem ADD is_multipass_problem TINYINT(1) DEFAULT 0 NOT NULL COMMENT \'Whether this problem is a multi-pass problem.\', ADD multipass_limit INT UNSIGNED DEFAULT NULL COMMENT \'Optional limit on the number of rounds for multi-pass problems; defaults to 2 if not specified.\'');
24
+
}
25
+
26
+
publicfunctiondown(Schema$schema): void
27
+
{
28
+
// this down() migration is auto-generated, please modify it to your needs
29
+
$this->addSql('ALTER TABLE problem DROP is_multipass_problem, DROP multipass_limit');
Copy file name to clipboardExpand all lines: webapp/src/Entity/Problem.php
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,21 @@ class Problem extends BaseApiEntity implements
109
109
#[Serializer\Exclude]
110
110
private ?string$problemstatement_type = null;
111
111
112
+
#[ORM\Column(options: [
113
+
'comment' => 'Whether this problem is a multi-pass problem.',
114
+
'default' => 0,
115
+
])]
116
+
#[Serializer\Exclude]
117
+
privatebool$isMultipassProblem = false;
118
+
119
+
#[ORM\Column(
120
+
nullable: true,
121
+
options: ['comment' => 'Optional limit on the number of rounds; defaults to 1 for traditional problems, 2 for multi-pass problems if not specified.', 'unsigned' => true]
122
+
)]
123
+
#[Assert\GreaterThan(0)]
124
+
#[Serializer\Exclude]
125
+
private ?int$multipassLimit = null;
126
+
112
127
/**
113
128
* @var Collection<int, Submission>
114
129
*/
@@ -273,6 +288,31 @@ public function getCombinedRunCompare(): bool
273
288
return$this->combined_run_compare;
274
289
}
275
290
291
+
publicfunctionsetMultipassProblem(bool$isMultipassProblem): Problem
292
+
{
293
+
$this->isMultipassProblem = $isMultipassProblem;
294
+
return$this;
295
+
}
296
+
297
+
publicfunctionisMultipassProblem(): bool
298
+
{
299
+
return$this->isMultipassProblem;
300
+
}
301
+
302
+
publicfunctionsetMultipassLimit(?int$multipassLimit): Problem
303
+
{
304
+
$this->multipassLimit = $multipassLimit;
305
+
return$this;
306
+
}
307
+
308
+
publicfunctiongetMultipassLimit(): int
309
+
{
310
+
if ($this->isMultipassProblem) {
311
+
return$this->multipassLimit ?? 2;
312
+
}
313
+
return1;
314
+
}
315
+
276
316
publicfunctionsetProblemstatementFile(?UploadedFile$problemstatementFile): Problem
0 commit comments