Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support per test case explanations #21

Open
godmar opened this issue Aug 29, 2015 · 11 comments
Open

Support per test case explanations #21

godmar opened this issue Aug 29, 2015 · 11 comments

Comments

@godmar
Copy link
Contributor

godmar commented Aug 29, 2015

A number of problems has commentary related to sample test cases. I don't see support for that in the Kattis problem format. Work-around is to add a section to problem.tex, but that will be typeset above, rather than below, the sample test cases.

Possible solutions:

  • allow sample-1.for-contestant.tex in data/sample directory separate for each sample test case to be explained
  • allow single sample-explanation.tex in problem_statement/ directory
  • allow problem writer to determine the position in problem.tex where sample test cases will be included via to-be-defined latex command
@ghamerly
Copy link
Contributor

The problem format has support for annotations (see http://problemarchive.org/wiki/index.php/Problem_Format#Annotations), but none of them seem to address exactly what you're looking for (i.e. text that makes it into the problem statement).

It does seem that if a sample input has a .desc file, that could conceivably be put in the problem description (since the case, being a sample, is known). However, the .desc file is explicitly described as privileged (judge-only) information in the problem format. I would argue that nothing about the sample cases are privileged. So maybe this could be used for what you are suggesting.

@godmar
Copy link
Contributor Author

godmar commented Aug 29, 2015

Agreed. One issue to note is whether LaTeX is allowed or not in the file, perhaps could have two suffixes .desc.txt and .desc.tex or similar.

@eldering
Copy link
Contributor

eldering commented Jun 2, 2016

I'd prefer to keep the already defined .desc and add an optional .desc.tex. That makes it simpler for systems that don't support LaTeX (e.g. Kattis or DOMjudge when importing a problem) to know which file to look for, and doesn't change the standard, only extend it.

@austrin
Copy link
Contributor

austrin commented Jun 3, 2016

Agree that it should be a new file. Not sure if desc.tex is the right suffix. Usually it will be an explanation of a test case, rather than a description. But .explanation.tex feels a bit long-winded...

@niemela
Copy link
Member

niemela commented Jul 22, 2023

@jsannemo @simonlindholm How do we handle this at PO? Do we just avoid it? Do we need a fix for this?

@simonlindholm
Copy link
Member

We usually have a \section*{Sample explanations} at the bottom of the problem statement, saying things like "In the first sample, ...". I think it works fine, though it might encourage us write more sample explanations if it was a more integrated part of the problem format.

@RagnarGrootKoerkamp
Copy link
Contributor

@mzuenni

@mzuenni
Copy link
Contributor

mzuenni commented Jul 22, 2023

At GCPC we added a command to problemset.cls whose content is typeset after the automatically included samples (I also implemented something similar for BAPCtools).
However, my preferred way to handle this would be a command like \includeSamplesHere which can be used at any point to typeset the samples (and if it is never called will automatically be executed at the end).

@RagnarGrootKoerkamp
Copy link
Contributor

@mzuenni note that this is specifically about interleaving samples with explanations, so that you could have

<sample 1>
<explanation 1>
<sample 2>
<explanation 2>
...

Currently I don't see a super nice way of doing this. Maybe we can add \sample1, \sample2, ... that can be used from problem.en.tex to render samples?

@mzuenni
Copy link
Contributor

mzuenni commented Jul 24, 2023

Ah, well in that case I would prefer \sample{<filebasename>} and maybe an additional \allSamples.

@jsannemo
Copy link
Contributor

This should at the very least support Markdown too.

Other than that I (unfortunately) think this is the best way out. At least I don't see a nicer way (the sample/1.explanation.tex I don't like: it's more important to put it together with the rest of the statement).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants