Don't create user id subfolder for submissions if only 1 exists

This commit is contained in:
17acres 2021-05-06 13:18:02 -04:00
parent 66696c5733
commit 63151c3075
1 changed files with 3 additions and 2 deletions

View File

@ -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: