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
Copy file name to clipboardExpand all lines: docs/External contest formats.rst
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,15 @@ You can follow this description looking at `this example <https://github.com/cms
28
28
29
29
- for each task :samp:`{task_name}`, a directory :file:`{task_name}` that contains the description of the task and all the files needed to build the statement of the problem, the input and output cases, the reference solution and (when used) the solution checker.
30
30
31
-
The exact structure of these files and directories is detailed below. Note that providing confusing input to ``cmsYamlImporter`` can, unexpectedly, confuse it and create inconsistent tasks and/or strange errors. For confusing input we mean parameters and/or files from which it can infer no or multiple task types or score types.
31
+
The exact structure of these files and directories is detailed below. Note that this loader is not particularly reliable and providing confusing input to it may lead to create inconsistent or strange data on the database. For confusing input we mean parameters and/or files from which it can infer no or multiple task types or score types.
32
32
33
-
As the name suggest, this format was born among the Italian trainers group, thus many of the keywords detailed below used to be in Italian. Now they have been translated to English, but Italian keys are still recognized for backward compatibility and are detailed below. Please note that, although so far this is the only format natively supported by CMS, it is far from ideal: in particular, it has grown in a rather untidy manner in the last few years (CMS authors are planning to develop a new, more general and more organic, format, but unfortunately it doesn't exist yet). Thus, instead of converting your tasks to the Italian format for importing into CMS, it is suggested to write a loader for the format you already have. Please get in touch with CMS authors to have support.
33
+
As the name suggest, this format was born among the Italian trainers group, thus many of the keywords detailed below used to be in Italian. Now they have been translated to English, but Italian keys are still recognized for backward compatibility and are detailed below. Please note that, although so far this is the only format natively supported by CMS, it is far from ideal: in particular, it has grown in a rather untidy manner in the last few years (CMS authors are planning to develop a new, more general and more organic, format, but unfortunately it doesn't exist yet).
34
+
35
+
For the reasons above, instead of converting your tasks to the Italian format for importing into CMS, it is suggested to write a loader for the format you already have. Please get in touch with CMS authors to have support.
36
+
37
+
.. warning::
38
+
39
+
The authors offer no guarantee for future compatibility for this format. Again, if you use it, you do so at your own risk!
34
40
35
41
36
42
General contest description
@@ -42,11 +48,11 @@ The :file:`contest.yaml` file is a plain YAML file, with at least the following
42
48
43
49
- ``description`` (string; also accepted: ``nome``): the contest's name (description), shown to contestants in the web interface.
44
50
45
-
- ``tasks`` (list of strings; also accepted: ``problemi``): a list of the tasks belonging to this contest; for each of these strings, say :samp:`{task_name}`, there must be a file named:file:`{task_name}.yaml` in the contest directory and a directory called :file:`{task_name}`, used to extract information about that task; the order in this list will be the order of the tasks in the web interface.
51
+
- ``tasks`` (list of strings; also accepted: ``problemi``): a list of the tasks belonging to this contest; for each of these strings, say :samp:`{task_name}`, there must be a directory called:file:`{task_name}` in the contest directory, with content as described :ref:`below <externalcontestformats_task-directory>`; the order in this list will be the order of the tasks in the web interface.
46
52
47
53
- ``users`` (list of associative arrays; also accepted: ``utenti``): each of the elements of the list describes one user of the contest; the exact structure of the record is described :ref:`below <externalcontestformats_user-description>`.
48
54
49
-
- ``token_mode``: the token mode for the contest, as in :ref:`configuringacontest_tokens`; it can be ``disabled``, ``infinite`` or ``finite``.
55
+
- ``token_mode``: the token mode for the contest, as in :ref:`configuringacontest_tokens`; it can be ``disabled``, ``infinite`` or ``finite``; if this is not specified, the loader will try to infer it from the remaining token parameters (in order to retain compatibility with the past), but you are not advised to rely on this behavior.
50
56
51
57
The following are optional keys.
52
58
@@ -80,7 +86,10 @@ The following are optional keys.
80
86
81
87
- ``ip`` (string): the IP address or subnet from which incoming connections for this user are accepted, see :ref:`configuringacontest_login`.
82
88
83
-
- ``hidden`` (boolean; also accepted: ``fake``): when set to true set the ``hidden`` flag in the user, see :ref:`configuringacontest_login`; defaults to false (the case-sensitive _string_ ``True`` is also accepted).
89
+
- ``hidden`` (boolean; also accepted: ``fake``): when set to true set the ``hidden`` flag in the user, see :ref:`configuringacontest_login`; defaults to false (the case-sensitive *string* ``True`` is also accepted).
90
+
91
+
92
+
.. _externalcontestformats_task-directory:
84
93
85
94
Task directory
86
95
--------------
@@ -89,11 +98,11 @@ The content of the task directory is used both to retrieve the task data and to
89
98
90
99
These are the required files.
91
100
92
-
- :file:`task.yaml`: this file contains the name of the task and describes some of its properties. Its content is detailed below.
101
+
- :file:`task.yaml`: this file contains the name of the task and describes some of its properties; its content is detailed :ref:`below<externalcontestformats_task-description>`; in order to retain backward compatibility, this file can also be provided in the file :file:`{task_name.yaml}` in the root directory of the *contest*.
93
102
94
103
- :file:`statement/statement.pdf` (also accepted: :file:`testo/testo.pdf`): the main statement of the problem. It is not yet possible to import several statement associated to different languages: this (only) statement will be imported according to the language specified under the key ``primary_language``.
95
104
96
-
- :file:`input/input{%d}.txt` and :file:`output/output{%d}.txt` for all integers :samp:`{%d}` between 0 (included) and ``n_input`` (excluded): these are of course the input and (one of) the correct output files.
105
+
- :file:`input/input{%d}.txt` and :file:`output/output{%d}.txt` for all integers :samp:`{%d}` between 0 (included) and ``n_input`` (excluded): these are of course the input and reference output files.
97
106
98
107
The following are optional files, that must be present for certain task types or score types.
99
108
@@ -112,6 +121,8 @@ The following are optional files, that must be present for certain task types or
112
121
- :file:`att/*`: each file in this folder is added as an attachment to the task, named as the file's filename.
113
122
114
123
124
+
.. _externalcontestformats_task-description:
125
+
115
126
Task description
116
127
----------------
117
128
@@ -123,7 +134,7 @@ The task YAML files require the following keys.
123
134
124
135
- ``n_input`` (integer): number of test cases to be evaluated for this task; the actual test cases are retrieved from the :ref:`task directory <externalcontestformats_task-directory>`.
125
136
126
-
- ``token_mode``: the token mode for the task, as in :ref:`configuringacontest_tokens`; it can be ``disabled``, ``infinite`` or ``finite``.
137
+
- ``token_mode``: the token mode for the task, as in :ref:`configuringacontest_tokens`; it can be ``disabled``, ``infinite`` or ``finite``; if this is not specified, the loader will try to infer it from the remaining token parameters (in order to retain compatibility with the past), but you are not advised to relay on this behavior..
127
138
128
139
The following are optional keys.
129
140
@@ -147,5 +158,3 @@ The following are optional keys that must be present for some task type or score
147
158
148
159
- ``primary_language`` (string): the statement will be imported with this language code; defaults to ``it`` (Italian), in order to ensure backward compatibility.
0 commit comments