-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathcontest.html
More file actions
320 lines (311 loc) · 14.4 KB
/
contest.html
File metadata and controls
320 lines (311 loc) · 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
{% extends "base.html" %}
{% block core %}
<div class="core_title">
<h1>Contest configuration</h1>
</div>
{% include "fragments/overload_warning.html" %}
<!-- We use "multipart/form-data" to have Tornado distinguish between missing and empty values. -->
<form enctype="multipart/form-data" action="{{ url("contest", contest.id) }}" method="POST" name="edit_contest" style="display:inline;">
{{ xsrf_form_html|safe }}
<table class="sub_table">
<tr><td colspan=2><h2>Contest information</h2></td></tr>
<tr>
<td>
<span class="info" title="A short name for the contest, preferably using only letters, numbers and underscores."></span>
Name
</td>
<td><input type="text" name="name" value="{{ contest.name }}"></td>
</tr>
<tr>
<td>
<span class="info" title="The name of the contest as seen by the contestants."></span>
Description
</td>
<td><textarea name="description">{{ contest.description }}</textarea></td>
</tr>
<tr>
<td>
<span class="info" title="The list of languages that contestants can use, or empty for allowing any language.
Example: 'en,ja' (without quotes)."></span>
Allowed localizations
</td>
<td><input type="text" name="allowed_localizations" value="{{ contest.allowed_localizations|join(",") }}"/></td>
</tr>
<tr>
<td>
<span class="info" title="Programming languages that contestants can use to solve the tasks.
All the allowed languages must have task support, for example in managed tasks."></span>
Allowed programming languages
</td>
<td class="wrapping-options">
{% for lang in LANGUAGES %}
<label><input type="checkbox" name="languages" value="{{ lang.name }}" {{ "checked" if lang.name in contest.languages else "" }}>{{ lang.name }}</label>
{% endfor %}
</td>
</tr>
<tr>
<td>
<span class="info" title="Whether contestants can download their own submissions."></span>
<label for="submissions_download_allowed">Submissions download allowed</label>
</td>
<td>
<input type="checkbox" id="submissions_download_allowed" name="submissions_download_allowed" {{ "checked" if contest.submissions_download_allowed else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="Whether contestants can submit questions."></span>
<label for="allow_questions">Allow questions</label>
</td>
<td>
<input type="checkbox" id="allow_questions" name="allow_questions" {{ "checked" if contest.allow_questions else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="Whether contestants can submit user tests."></span>
<label for="allow_user_tests">Allow user tests</label>
</td>
<td>
<input type="checkbox" id="allow_user_tests" name="allow_user_tests" {{ "checked" if contest.allow_user_tests else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="The number of decimal places the scores will be rounded to.
Example: '2' to allow 98.76."></span>
Score decimal places
</td>
<td><input type="text" name="score_precision" value="{{ contest.score_precision }}"></td>
</tr>
<tr>
<td>
<span class="info" title="Allow contestant to make unofficial submission before analysis mode"></span>
Allow unofficial submission before analysis mode
</td>
<td>
<input type="checkbox" id="allow_unofficial_submission_before_analysis_mode" name="allow_unofficial_submission_before_analysis_mode" {{ "checked" if contest.allow_unofficial_submission_before_analysis_mode else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="Whether to show task scores in the overview page for contestants."></span>
<label for="show_task_scores_in_overview">Show task scores in overview page</label>
</td>
<td>
<input type="checkbox" id="show_task_scores_in_overview" name="show_task_scores_in_overview" {{ "checked" if contest.show_task_scores_in_overview else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="Whether to show task scores next to task names in the sidebar for contestants."></span>
<label for="show_task_scores_in_sidebar">Show task scores in sidebar</label>
</td>
<td>
<input type="checkbox" id="show_task_scores_in_sidebar" name="show_task_scores_in_sidebar" {{ "checked" if contest.show_task_scores_in_sidebar else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="Timezone of the server, used to display start, end times and the current server time to contestants.
Example: 'Europe/Rome', 'America/New_York', ..."></span>
Timezone
</td>
<td><input type="text" name="timezone" value="{{ contest.timezone if contest.timezone is not none else "" }}"></td>
</tr>
<tr><td colspan=2><h2>Logging in</h2></td></tr>
<tr>
<td>
<span class="info" title="If checked, contestants that are marked as hidden in this contest will not be able to log in."></span>
<label for="block_hidden_participations">Block hidden participations</label>
</td>
<td>
<input type="checkbox" id="block_hidden_participations" name="block_hidden_participations" {{ "checked" if contest.block_hidden_participations else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="If checked, contestants will be able to log in using username and password."></span>
<label for="allow_password_authentication">Allow password authentication</label>
</td>
<td>
<input type="checkbox" id="allow_password_authentication" name="allow_password_authentication" {{ "checked" if contest.allow_password_authentication else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="If checked, contestants will be able to autonomously create a user account and a participation in the contest."></span>
<label for="allow_registration">Allow registration</label>
</td>
<td>
<input type="checkbox" id="allow_registration" name="allow_registration" {{ "checked" if contest.allow_registration else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="If true, contestants with an IP address specified for this contest will only be able to log in from that address."></span>
<label for="ip_restriction">IP based login restriction</label>
</td>
<td>
<input type="checkbox" id="ip_restriction" name="ip_restriction" {{ "checked" if contest.ip_restriction else "" }}/>
</td>
</tr>
<tr>
<td>
<span class="info" title="If true, contestants with an IP address specified for this contest will be automatically logged in when connecting from that address."></span>
<label for="ip_autologin">IP based autologin</label>
</td>
<td>
<input type="checkbox" id="ip_autologin" name="ip_autologin" {{ "checked" if contest.ip_autologin else "" }}/>
</td>
</tr>
<tr><td colspan=2><h2>Tokens parameters (<a href="http://cms.readthedocs.org/en/{{ rtd_version }}/Configuring%20a%20contest.html#feedback-to-contestants" target="_blank">documentation</a>)</h2></td></tr>
<tr>
<td>
<span class="info" title="Select 'disabled' to remove tokens completely, 'infinite' for allowing any number of tokens, or 'finite' to specify the amount with the following parameters.
If you prefer to control tokens at the task level, select 'infinite' here."></span>
Token mode
</td>
<td>
<select name="token_mode">
<option value="{{ TOKEN_MODE_DISABLED }}" {{ "selected" if contest.token_mode == TOKEN_MODE_DISABLED else "" }}>Disabled</option>
<option value="{{ TOKEN_MODE_FINITE }}" {{ "selected" if contest.token_mode == TOKEN_MODE_FINITE else "" }}>Finite</option>
<option value="{{ TOKEN_MODE_INFINITE }}" {{ "selected" if contest.token_mode == TOKEN_MODE_INFINITE else "" }}>Infinite</option>
</select>
</td>
</tr>
<tr>
<td>
<span class="info" title="The maximum number of tokens a contestant can use in the whole contest.
It is used only if tokens are finite."></span>
Maximum number of tokens
</td>
<td><input type="text" name="token_max_number" value="{{ contest.token_max_number if contest.token_max_number is not none else "" }}" size="3"></td>
</tr>
<tr>
<td>
<span class="info" title="The minimum amount of time (in seconds) that a contestant needs to wait after using a token before being able to use another.
It is used only if tokens are finite."></span>
Minimum interval between tokens
</td>
<td><input type="text" name="token_min_interval" value="{{ contest.token_min_interval.total_seconds()|int }}" size="3"></td>
</tr>
<tr>
<td>
<span class="info" title="The number of tokens that a contestant has available when their contest time starts.
It is used only if tokens are finite."></span>
Initial number of tokens
</td>
<td><input type="text" name="token_gen_initial" value="{{ contest.token_gen_initial }}" size="3"></td>
</tr>
<tr>
<td>
<span class="info" title="The number of tokens that are generated periodically.
It is used only if tokens are finite."></span>
Token generation number
</td>
<td><input type="text" name="token_gen_number" value="{{ contest.token_gen_number }}" size="3"></td>
</tr>
<tr>
<td>
<span class="info" title="The amount of time (in minutes) between two token generation events.
It is used only if tokens are finite."></span>
Token generation period
</td>
<td><input type="text" name="token_gen_interval" value="{{ contest.token_gen_interval.total_seconds()|int // 60 }}" size="3"></td>
</tr>
<tr>
<td>
<span class="info" title="Maximum number of tokens available to a contestant at any given time during the contest.
It is used only if tokens are finite."></span>
Maximum accumulated tokens
</td>
<td><input type="text" name="token_gen_max" value="{{ contest.token_gen_max if contest.token_gen_max is not none else "" }}" size="3"></td>
</tr>
<tr><td colspan=2><h2>Main group settings</h2></td></tr>
<tr>
<td>
<span class="info" title="The group used for time calculations in the admin and ranking interface."></span>
Main group
</td>
<td>
<a href='{{ url("contest", contest.id, "group", contest.main_group_id, "edit") }}'>{{ contest.main_group.name }}</a>
</td>
</tr>
</table>
<table class="NestedSettings">
{% set group = contest.main_group %}
{% include "fragments/group_settings.html" %}
</table>
<table>
<tr>
<td>
<span style="width: 8px; display: inline-block;"></span>
<span style="max-width: 300px; display: inline-block; word-wrap: break-word;">
To change start and end times or analysis mode for other groups, or change the main
group, please use the <a href='{{ url("contest", contest.id, "groups")
}}'>groups</a> section.
</span>
</td>
</tr>
<tr><td colspan=2><h2>Limits</h2></td></tr>
<tr>
<td>
<span class="info" title="Maximum number of submissions each contestant can submit, for the whole contest.
Leave empty for no limits."></span>
Maximum number of submissions
</td>
<td><input type="text" name="max_submission_number" value="{{ contest.max_submission_number if contest.max_submission_number is not none else "" }}"></td>
</tr>
<tr>
<td>
<span class="info" title="Maximum number of user tests each contestant can submit, for the whole contest.
Leave empty for no limits."></span>
Maximum number of user tests
</td>
<td><input type="text" name="max_user_test_number" value="{{ contest.max_user_test_number if contest.max_user_test_number is not none else "" }}"></td>
</tr>
<tr>
<td>
<span class="info" title="The minimum amount of time (in seconds) that a contestant needs to wait after a submission before being able to submit another.
Leave empty for no limits."></span>
Minimum interval between submissions
</td>
<td><input type="text" name="min_submission_interval" value="{{ contest.min_submission_interval.total_seconds()|int if contest.min_submission_interval is not none else "" }}"></td>
</tr>
<tr>
<td>
<span class="info" title="The amount of time (in seconds) until the end of participation in which the minimum interval between submissions is not enforced."></span>
Minimum submission interval grace period
</td>
<td><input type="text" name="min_submission_interval_grace_period" value="{{ contest.min_submission_interval_grace_period.total_seconds()|int if contest.min_submission_interval_grace_period is not none else "" }}"></td>
</tr>
<tr>
<td>
<span class="info" title="The minimum amount of time (in seconds) that a contestant needs to wait after a user test before being able to send another.
Leave empty for no limits."></span>
Minimum interval between user tests
</td>
<td><input type="text" name="min_user_test_interval" value="{{ contest.min_user_test_interval.total_seconds()|int if contest.min_user_test_interval is not none else "" }}"></td>
</tr>
</table>
<input type="submit"
value="Update"
{% if not admin.permission_all %}
disabled
{% endif %}
>
<input type="reset" value="Reset">
</form>
<form action="{{ url("contests") }}" method="POST" style="display:inline;">
{{ xsrf_form_html|safe }}
<input type="hidden" name="contest_id" value="{{ contest.id }}"/>
<input type="submit"
name="operation"
value="Remove" style="float: right;"
{% if not admin.permission_all %}
disabled
{% endif %}
/>
</form>
{% endblock core %}