Problem description package format |
to main pagecontents |
download sample problem package
Problem is stored in a ZIP archive, which should contain exactly one XML file with the problem descrition in the root directory, and arbitraty number of additional files with tests, solutions etc.
Tag name Parent tag | Attributes | Comments |
---|---|---|
<CATS> |
|
Required top-level tag. |
<Problem> |
|
Standard checker program compares output file with the answer file for a given test.
Following standard checkers are defined:
Since version 1.4, stdChecker attribute is deprecated. It is recommended to use <Import> tag instead with the following standard guid's:
|
<Keyword> |
|
Keyword code must be pre-defined in a system. |
<ProblemStatement> |
|
Problem statement text in STML format. If attachment or url attribute is present, statement text is replaced by a link. |
<ProblemConstraints> |
Problem input constraints in STML format. | |
<InputFormat> |
Input file format description in STML format. | |
<OutputFormat> |
Output file format description in STML format. | |
<JsonData> 1.7<Problem> |
Additional data in JSON format.
Recommended to use <include> tag. |
|
<Explanation> 1.5<Problem> |
|
Solution explanation in STML format. If attachment or url attribute is present, explanation text is replaced by a link. |
<Checker> |
|
Checker program descriton. This tag is ignored if the problem has stdChecker attribute.
"src" — is a path to the file relative to the archive root.
Nested directories are allowed.
Path is case-sensitive.
The list of standard development environments:
If the de_code is omitted, it is defined by the source file extension according to the list above. Checker's exit code: 0 — OK, 1 — WA, 2 — PE, 3 — Internal error. |
<Picture> |
|
Describes a picture to be inserted into a problem text. |
<Attachment> 1.6<Problem> |
|
Arbitrary file available for download from the problem text. |
<Solution> |
|
Description of the jury solution. |
<Generator> |
|
Description of the test generator. Generator must produce a file named according to the outputFile attribute. That file is used as an input data by the <In> tag.
By default the file name is equal to the value of inputFile attribute of the <Problem> tag.
Special value of outputFile="*STDOUT" means that the generator should print the test to the standard output.
For group generators outputFile attribute may contain context variables which are expanded to the test number 1.5, or file pattern characters 1.9 '?' and '*'. For example, to describe a generator producing test files t01, t02, ..., t50 in subdirectories subtask1, subtask2, ...: <Generator name="gen" src="gen.pas" outputFile="subtask?/t%0n" /> <Test rank="1-50" > <In use="gen" genAll="1"> ... |
<GeneratorRange> 1.2<Problem> |
|
Attributes name, src and export of <GeneratorRange> tag may contain context variables which are expanded to the current generator number.
For example:<GeneratorRange from="1" to="10" name="g%0n" src="gen%0n.pas"/>
|
<Validator> 1.10<Problem> |
|
Test data validator. Reads data from standard input and/or input file. Exits with code 0 if the data is valid, 0 otherwise. |
<Visualizer> 1.9<Problem> |
|
Test data visualizer. |
<Interactor> 1.9<Problem> |
|
Interactor or controller (see <Run> ). Only one iterator per problem is allowed. |
<Linter> 1.10<Problem> |
|
Linter runs either before or after compilation, depending on 'stage' attribute.
Linter accepts source file names on command line and exits with non-zero code
if the source does not pass the check.
Standard output of linter may contain error message.
Linter can be imported by its global identifier. See <Import> . |
<Run> 1.9<Problem> |
|
Possible values of method attribute:
|
<Snippet> 1.11<Problem> |
|
Snippet of the problem statement or test. May be different for each participant. |
<Test> |
|
Problem must have tests with ranks from 1 upto some N.
If there is no tests, any compilable submission will be judged OK.
Since version 1.5 attributes of <In> and <Out> tags,
nested inside <Test> tag,
may contain context variables which are expanded to the current test number.
For example:<Test rank="1-10"> <In src="%0n.in"/><Out use="solution"/> </Test>To avoid duplication, test properties may be split between several tags, for example: <Test rank="1-5" points="1" /> <Test rank="6-10" points="2" /> <Test rank="1-10"><Out use="sol"></Test>However the data about each test must not overlap between tags. |
<TestRange> 1.1 −1.5<Problem> |
|
Since version 1.5, this tag is deprecated — use <Test> tag instead.Attributes of <In> and <Out> tags,
nested inside <TestRange> tag,
may contain context variables which are expanded to the current test number.
For example:<TestRange from="1" to="10"> <In src="%0n.in"/><Out use="solution"/> </TestRange> |
<In> , <TestRange> 1.1 |
|
Test input description.
If the "use" attribute is present, input file is produced by running the given test generator. If the "param" attribute contains " | " character, then generation is performed by a pipeline,
starting with test generator, followed by generator modules. For example:
If neither "src" nor "use" attribute is present, input text is nested inside the tag1.9.
Whitespace is preserved exactly.
|
<Out> , <TestRange> 1.1 |
If the "use" attribute is present, output file is produced by running the given jury solution. If neither "src" nor "use" attribute is present, output text is nested inside the tag1.9. Whitespace is preserved exactly. | |
<Testset> 1.5<Problem> |
|
Contains test set description. While adding the problem to the contest, one or more testsets to use for checking may be specified. By default all the available tests are used. If the number of points for the testset is specified, the points are awarded only if all tests have passed. It is allowed to mix testsets and stand-alone tests, as well as specify overlapping testsets. However, the test must not be included in a several concurrently used testsets with points, dependencies or hidden details. |
<Module> 1.2<Problem> |
|
Module description. Module files are unpacked and compiled together with every object of the corresponding type. For the modules which do not require compilation, use development environment "None" (de_code="1"). Modules are compiled in the order they are listed in the package. If fileName attribute is given instead of src attribute, tag content will be saved to a module named fileName. |
<Import> 1.4<Problem> |
Import an object from the existing problem. Object is searched by guid. Is the type attribute is present, the type of referenced object is checked against it. The effect of importing an object is equivalent to adding that object to a package. | |
<Sample> |
|
Sample test descrption.
Attributes of tags <SampleIn> and <SampleOut> nested inside of <Sample>
can contain context variable referencing sample rank1.9.
For example:
<Sample rank="1-3"> <SampleIn src="%0n.in"/> <SampleOut src="%0n.out"/> </Sample> |
<SampleIn> |
If the src attribute is omitted, sample input text is nested inside the tag. Whitespace is preserved exactly. | |
<SampleOut> |
If the src attribute is omitted, sample output text is nested inside the tag. Whitespace is preserved exactly. | |
<Quiz> 1.11<ProblemStatement> |
Question from the quiz. If at least one of the attributes rank , points , descr is given,
or either tag <Answer> or tag <Choice>
with the correct attribute is used, test will be created automatically.
|
|
<Text> 1.11<Quiz> |
Question text. | |
<Answer> 1.11<Quiz> |
Correct answer for the question of type text .
|
|
<Choice> 1.11<Quiz> |
|
Answer variant for the question of type radiogroup or checkbox .
|
Specifier is a comma-separated list of elements. Each element may be one of:
-
" character 1.5,-
" character 1.10,<Testset>
)1.8.Have a form of %n
, %0n
, meaning test number and zero-padded test number correspondingly.
STML is a radically simplified subset of HTML with a few additional tags. The following tags are defined in STML:
Tag name Parent tag | Attributes | Comments |
---|---|---|
<img> |
Embed an image. | |
<a> 1.6 |
|
Insert a link to the attached file. |
<object> 1.6 |
|
Insert a link to the attached file. |
<include> 1.7 |
|
Insert a text from the file. |
<code> |
|
Format text as code. |
<i> , <em> |
Italics. | |
<b> |
Bold. | |
<p> |
Paragraph | |
<table> |
HTML Table. | |
<tr> |
Table row | |
<td> |
Table cell | |
<th> |
Table header |
Any tag inside STML can have additional cats-if
attribute.
Its value is a condition on problem tags.
Condition is a list of expressions separated by comma.
Each expression is one of
name
,
!name
,
name=value
or
!name=value
, where !
sign denotes
logical not, name — tag name, value — tag value.
lang
attribute 1.10By default, problem text is enclosed in a div
tag with lang
attribute
corresponding to the chosen language tag. However, if the text uses several languages
simultaneously (e.g. English terms in Russian text), spans of non-default language should
have explicit lang
attribute.
cats-dict
attribute 1.10Words inside of tag with cats-dict="1"
attribute are added to the dictionary of the current language.
cats-snippet
attribute 1.11Contents of the tag with cats-snippet="snippet_name"
attribute are replaced by the snippet snippet_name.
Memory size in mlimit, memoryLimit, wlimit or writeLimit attribute value must be an integer optionally followed by a suffix 'B' for bytes, 'K' for kilobytes, 'M' for megabytes, 'G' for gigabytes. If no suffix is given, megabytes are assumed.
o Attributes market with this sign are optional.
1.1 This feature is available since 1.1.
1.2 This feature is available since 1.2.
1.3 This feature is available since 1.3.
1.4 This feature is available since 1.4.
1.5 This feature is available since 1.5.
1.6 This feature is available since 1.6.
1.7 This feature is available since 1.7.
1.8 This feature is available since 1.8.
1.9 This feature is available since 1.9.
1.10 This feature is available since 1.10.
1.11 This feature is available since 1.11.
−1.4 This feature is deprecated since version 1.4.
−1.5 This feature is deprecated since version 1.5.
Documentation - CATS | developmentdocumentation© 2002-2020 Authors |
Far Eastern Federal University |