From a286f3fc9f38d02645257a59fa4e9082def7b04a Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Wed, 22 May 2024 22:11:14 +0200 Subject: [PATCH] Add submission status to export Closes #343 --- backend/domain/logic/submission.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/domain/logic/submission.py b/backend/domain/logic/submission.py index cf707f2a..00cf08c8 100644 --- a/backend/domain/logic/submission.py +++ b/backend/domain/logic/submission.py @@ -103,7 +103,8 @@ def zip_all_submissions(session: Session, project_id: int) -> bytes: submission = get_last_submission(session, group.id) if not Path.exists(Path(submission.filename)): continue - submission_path = Path(tmpdir) / f"{group.visible_id}-{submission.filename.split("/")[-1]}" + state = str(submission.state).split(".")[1] + submission_path = Path(tmpdir) / f"{group.visible_id}-{state}-{submission.filename.split("/")[-1]}" shutil.copy(submission.filename, submission_path) with tempfile.TemporaryDirectory() as zipdir: shutil.make_archive(f"{zipdir}/submissions", "zip", tmpdir)