Skip to content
Snippets Groups Projects
Commit aaaeb8da authored by Martin Mareš's avatar Martin Mareš
Browse files

Jobs: Lepší formát komentářů

parent 3a660239
Branches
No related tags found
No related merge requests found
This commit is part of merge request !81. Comments created here will be created in the context of that merge request.
......@@ -18,6 +18,19 @@ from mo.util import logger, data_dir
from mo.util_format import inflect_number, inflect_by_number, data_size
#
# Job download_submits: Zazipuje vybrané papíry
#
# Vstupní JSON:
# { 'papers': [ seznam paper_id ke stažení ],
# 'want_feedback': true/false,
# }
#
# Výstupní JSON:
# null
#
def schedule_download_submits(paper_ids: List[int], description: str, for_user: db.User, want_subdirs: bool):
the_job = TheJob()
job = the_job.create(db.JobType.download_submits, for_user)
......@@ -28,17 +41,6 @@ def schedule_download_submits(paper_ids: List[int], description: str, for_user:
@job_handler(db.JobType.download_submits)
def handle_download_submits(the_job: TheJob):
"""Zazipuje zadané papíry.
Vstupní JSON:
{ 'papers': [ seznam paper_id ke stažení ],
'want_feedback': true/false,
}
Výstupní JSON:
null
"""
job = the_job.job
assert job.in_json is not None
ids: List[int] = job.in_json['papers'] # type: ignore
......@@ -81,6 +83,21 @@ def handle_download_submits(the_job: TheJob):
temp_file.close()
#
# Job upload_feedback: Uploaduje opravená řešení
#
# Vstupní JSON:
# { 'round_id': <id>,
# 'only_task_id': <id_or_null>,
# 'only_contest_id': <id_or_null>,
# 'only_site_id': <id_or_null>,
# }
#
# Výstupní JSON:
# null
#
def schedule_upload_feedback(round: db.Round, tmp_file: str, description: str, for_user: db.User,
only_contest: Optional[db.Contest],
only_site: Optional[db.Place],
......@@ -145,19 +162,6 @@ def parse_feedback_name(name: str) -> Optional[UploadFeedback]:
@job_handler(db.JobType.upload_feedback)
def handle_upload_feedback(the_job: TheJob):
"""Uploaduje opravená řešení.
Vstupní JSON:
{ 'round_id': <id>,
'only_task_id': <id_or_null>,
'only_contest_id': <id_or_null>,
'only_site_id': <id_or_null>,
}
Výstupní JSON:
null
"""
job = the_job.job
assert job.in_file is not None
in_json = job.in_json
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment