Skip to content
Merged
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
5 changes: 4 additions & 1 deletion webapp/src/Service/DOMJudgeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,10 @@ public function getSamplesZipForContest(Contest $contest): StreamedResponse

/** @var ContestProblem $problem */
foreach ($contest->getProblems() as $problem) {
$this->addSamplesToZip($zip, $problem, $problem->getShortname());
// We don't include the samples for interactive problems.
if (!$problem->getProblem()->getCombinedRunCompare()) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm apparantly in the minority here, but I don't like that we have to add a comment to explain why this function indicates that this is an interactive problem.

Can we make it a TODO to fix this in the future? Either by using a function alias or actually storing if something is interactive?

Copy link
Member

Choose a reason for hiding this comment

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

Who says you are in the minority :-)

I think it is a good idea to add a function alias.

Copy link
Member Author

Choose a reason for hiding this comment

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

I mentioned IRL that I don't like adding that alias, as it hides that under the hood this CombinedRunCompare, which I think is not necessarily exactly the same as an interactive compare script. I think it's better to leave that explicit than make an alias function look like a clean expression of the problem being an inteactive problem. OTOH, if this really 1-1 means that this is an interactive compare script and thus problem, then I think we should just rename that table column and this associated getter.

Copy link
Member

Choose a reason for hiding this comment

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

Let's address/discuss this outside of this PR.

$this->addSamplesToZip($zip, $problem, $problem->getShortname());
}

if ($problem->getProblem()->getProblemstatementType()) {
$filename = sprintf('%s/statement.%s', $problem->getShortname(), $problem->getProblem()->getProblemstatementType());
Expand Down
Loading