Added ability to download all submissiosn from students and load credentials from file #1
|
@ -258,10 +258,12 @@ def download_submission_attachments(course, course_view):
|
|||
for attachment in submission.attachments:
|
||||
filepath = os.path.join(attachment_dir, attachment.filename)
|
||||
if not os.path.exists(filepath):
|
||||
print('Downloading attachment: {}'.format(attachment.filename))
|
||||
print('Downloading attachment: {}'.format(filepath))
|
||||
r = requests.get(attachment.url, allow_redirects=True)
|
||||
with open(filepath, 'wb') as f:
|
||||
f.write(r.content)
|
||||
else:
|
||||
print('File already exists: {}'.format(filepath))
|
||||
|
||||
|
||||
def getCoursePageUrls(course):
|
||||
|
|
Loading…
Reference in New Issue