Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #358 from SELab-2/status-in-export
Browse files Browse the repository at this point in the history
Add submission status to export
  • Loading branch information
matt01y authored May 23, 2024
2 parents 8d6761f + a286f3f commit 1cd67b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/domain/logic/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1cd67b1

Please sign in to comment.