Skip to content

Commit 573b9e7

Browse files
Change name to score modes
1 parent c0a8760 commit 573b9e7

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

cms/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"SOURCE_EXT_TO_LANGUAGE_MAP",
4040
"LANGUAGE_TO_SOURCE_EXT_MAP", "LANGUAGE_TO_HEADER_EXT_MAP",
4141
"LANGUAGE_TO_OBJ_EXT_MAP",
42-
"SCORE_MODE_IOI_MAX", "SCORE_MODE_IOI_MAX_TOKENED_LAST",
42+
"SCORE_MODE_MAX", "SCORE_MODE_MAX_TOKENED_LAST",
4343
# log
4444
# Nothing intended for external use, no need to advertise anything.
4545
# util
@@ -113,9 +113,9 @@
113113
# Task score modes.
114114

115115
# Maximum score amongst all submissions.
116-
SCORE_MODE_IOI_MAX = "ioi_max"
116+
SCORE_MODE_MAX = "max"
117117
# Maximum score among all tokened submissions and the last submission.
118-
SCORE_MODE_IOI_MAX_TOKENED_LAST = "ioi_max_tokened_last"
118+
SCORE_MODE_MAX_TOKENED_LAST = "max_tokened_last"
119119

120120
from .util import ConfigError, mkdir, utf8_decoder, Address, ServiceCoord, \
121121
get_safe_shard, get_service_address, get_service_shards, \

cms/db/task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
from . import Base, Contest
4242
from .smartmappedcollection import smart_mapped_collection
43-
from cms import SCORE_MODE_IOI_MAX, SCORE_MODE_IOI_MAX_TOKENED_LAST
43+
from cms import SCORE_MODE_MAX, SCORE_MODE_MAX_TOKENED_LAST
4444

4545

4646
class Task(Base):
@@ -194,10 +194,10 @@ class Task(Base):
194194

195195
# Score mode for the task.
196196
score_mode = Column(
197-
Enum(SCORE_MODE_IOI_MAX_TOKENED_LAST, SCORE_MODE_IOI_MAX,
197+
Enum(SCORE_MODE_MAX_TOKENED_LAST, SCORE_MODE_MAX,
198198
name="score_mode"),
199199
nullable=False,
200-
default=SCORE_MODE_IOI_MAX_TOKENED_LAST)
200+
default=SCORE_MODE_MAX_TOKENED_LAST)
201201

202202
# Active Dataset (id and object) currently being used for scoring.
203203
# The ForeignKeyConstraint for this column is set at table-level.

cms/grading/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
from cms import \
4040
LANG_C, LANG_CPP, LANG_PASCAL, LANG_PYTHON, LANG_PHP, LANG_JAVA, \
41-
SCORE_MODE_IOI_MAX
41+
SCORE_MODE_MAX
4242
from cms.db import Submission
4343
from cms.grading.Sandbox import Sandbox
4444

@@ -780,8 +780,8 @@ def task_score(user, task):
780780

781781
score = 0.0
782782

783-
if task.score_mode == SCORE_MODE_IOI_MAX:
784-
# Modern IOI score mode: maximum score amongst all submissions.
783+
if task.score_mode == SCORE_MODE_MAX:
784+
# Like in IOI 2013-: maximum score amongst all submissions.
785785

786786
# The maximum score amongst all submissions (not yet computed
787787
# scores count as 0.0).
@@ -796,8 +796,8 @@ def task_score(user, task):
796796

797797
score = max_score
798798
else:
799-
# Legacy IOI score mode: maximum score among all tokened submissions
800-
# and the last submission.
799+
# Like in IOI 2010-2012: maximum score among all tokened
800+
# submissions and the last submission.
801801

802802
# The score of the last submission (if computed, otherwise 0.0).
803803
last_score = 0.0

cms/server/templates/admin/add_task.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{% end %}
1515

1616
{% block core %}
17-
{% from cms import plugin_list, SCORE_MODE_IOI_MAX_TOKENED_LAST, SCORE_MODE_IOI_MAX %}
17+
{% from cms import plugin_list, SCORE_MODE_MAX_TOKENED_LAST, SCORE_MODE_MAX %}
1818
{% set task_type_list = plugin_list("cms.grading.tasktypes", "tasktypes") %}
1919
{% set score_type_list = plugin_list("cms.grading.scoretypes", "scoretypes") %}
2020

@@ -196,8 +196,8 @@ <h2 id="title_score_options" class="toggling_on">Score Options</h2>
196196
<td>Score mode</td>
197197
<td>
198198
<select name="score_mode">
199-
<option value="{{ SCORE_MODE_IOI_MAX_TOKENED_LAST }}" selected>Legacy IOI (maximum score among all tokened submissions and the last submission)</option>
200-
<option value="{{ SCORE_MODE_IOI_MAX }}">Modern IOI (maximum score amongst all submissions)</option>
199+
<option value="{{ SCORE_MODE_MAX_TOKENED_LAST }}" selected>Use best among tokened and last submissions (IOI 2010-2012)</option>
200+
<option value="{{ SCORE_MODE_MAX }}">Use best among all submissions (IOI 2013-)</option>
201201
</select>
202202
</td>
203203
</tr>

cms/server/templates/admin/task.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
{% block core %}
2121
{% from cms.server import format_dataset_attrs %}
22-
{% from cms import plugin_list, SCORE_MODE_IOI_MAX_TOKENED_LAST, SCORE_MODE_IOI_MAX %}
22+
{% from cms import plugin_list, SCORE_MODE_MAX_TOKENED_LAST, SCORE_MODE_MAX %}
2323
{% set task_type_list = plugin_list("cms.grading.tasktypes", "tasktypes") %}
2424
{% set score_type_list = plugin_list("cms.grading.scoretypes", "scoretypes") %}
2525

@@ -356,8 +356,8 @@ <h2 id="title_score_options" class="toggling_on">Score Options</h2>
356356
<td>Score mode</td>
357357
<td>
358358
<select name="score_mode">
359-
<option value="{{ SCORE_MODE_IOI_MAX_TOKENED_LAST }}" {{ "selected" if task.score_mode == SCORE_MODE_IOI_MAX_TOKENED_LAST else "" }}>Legacy IOI (maximum score among all tokened submissions and the last submission)</option>
360-
<option value="{{ SCORE_MODE_IOI_MAX }}" {{ "selected" if task.score_mode == SCORE_MODE_IOI_MAX else "" }}>Modern IOI (maximum score amongst all submissions)</option>
359+
<option value="{{ SCORE_MODE_MAX_TOKENED_LAST }}" {{ "selected" if task.score_mode == SCORE_MODE_MAX_TOKENED_LAST else "" }}>Use best among tokened and last submissions (IOI 2010-2012)</option>
360+
<option value="{{ SCORE_MODE_MAX }}" {{ "selected" if task.score_mode == SCORE_MODE_MAX else "" }}>Use best among all submissions (IOI 2013-)</option>
361361
</select>
362362
</td>
363363
</tr>

0 commit comments

Comments
 (0)