Skip to content

Commit c51234a

Browse files
committed
Do not reuse previous submission files for BatchAndOutput.
1 parent 03d1e51 commit c51234a

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

cms/grading/tasktypes/BatchAndOutput.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class BatchAndOutput(Batch):
7777

7878
# Other constants to specify the task type behaviour and parameters.
7979
ALLOW_PARTIAL_SUBMISSION = True
80+
REUSE_PREVIOUS_SUBMISSION = False
8081

8182
_OUTPUT_ONLY_TESTCASES = ParameterTypeString(
8283
"Comma-separated list of output only testcases",

cms/grading/tasktypes/abc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ class TaskType(metaclass=ABCMeta):
6161

6262
# If ALLOW_PARTIAL_SUBMISSION is True, then we allow the user to
6363
# submit only some of the required files; moreover, we try to fill
64-
# the non-provided files with the one in the previous submission.
64+
# the non-provided files with the one in the previous submission if
65+
# REUSE_PREVIOUS_SUBMISSION is True.
6566
ALLOW_PARTIAL_SUBMISSION = False
67+
REUSE_PREVIOUS_SUBMISSION = True
6668

6769
# A list of all the accepted parameters for this task type.
6870
# Each item is an instance of TaskTypeParameter.

cms/server/contest/submission/workflow.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ def accept_submission(
200200
missing_codenames = required_codenames.difference(files.keys())
201201
if len(missing_codenames) > 0:
202202
if task.active_dataset.task_type_object.ALLOW_PARTIAL_SUBMISSION:
203-
digests = fetch_file_digests_from_previous_submission(
204-
sql_session, participation, task, language,
205-
missing_codenames)
203+
if task.active_dataset.task_type_object.REUSE_PREVIOUS_SUBMISSION:
204+
digests = fetch_file_digests_from_previous_submission(
205+
sql_session, participation, task, language,
206+
missing_codenames)
206207
else:
207208
raise UnacceptableSubmission(
208209
N_("Invalid submission format!"),
@@ -393,9 +394,10 @@ def accept_user_test(
393394
missing_codenames = required_codenames.difference(files.keys())
394395
if len(missing_codenames) > 0:
395396
if task.active_dataset.task_type_object.ALLOW_PARTIAL_SUBMISSION:
396-
digests = fetch_file_digests_from_previous_submission(
397-
sql_session, participation, task, language,
398-
missing_codenames, cls=UserTest)
397+
if task.active_dataset.task_type_object.REUSE_PREVIOUS_SUBMISSION:
398+
digests = fetch_file_digests_from_previous_submission(
399+
sql_session, participation, task, language,
400+
missing_codenames, cls=UserTest)
399401
else:
400402
raise UnacceptableUserTest(
401403
N_("Invalid test format!"),

0 commit comments

Comments
 (0)