Added ability to download all submissiosn from students and load credentials from file #1

Merged
moorepants merged 5 commits from all-assignments into master 2020-07-13 22:40:08 -06:00
1 changed files with 3 additions and 1 deletions
Showing only changes of commit b6f787167f - Show all commits

View File

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