From 63151c3075ea43668331499ebb592b94b2df5d6a Mon Sep 17 00:00:00 2001 From: 17acres Date: Thu, 6 May 2021 13:18:02 -0400 Subject: [PATCH] Don't create user id subfolder for submissions if only 1 exists --- export.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/export.py b/export.py index e12b84d..29f9995 100644 --- a/export.py +++ b/export.py @@ -278,8 +278,9 @@ def download_submission_attachments(course, course_view): for assignment in course_view.assignments: for submission in assignment.submissions: - attachment_dir = os.path.join(course_dir, "assignments", assignment.title, - str(submission.user_id)) + attachment_dir = os.path.join(course_dir, "assignments", assignment.title) + if(len(assignment.submissions)!=1): + attachment_dir = os.path.join(attachment_dir,str(submission.user_id)) if (not os.path.exists(attachment_dir)) and (submission.attachments): os.makedirs(attachment_dir) for attachment in submission.attachments: