Skip to content
Snippets Groups Projects
Commit e5a8d1cb authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

bug fixes

parent aec77cab
No related branches found
No related tags found
No related merge requests found
......@@ -281,7 +281,7 @@ class CanvasAssignment:
def get_submission_text(self, canvas_user):
submission = self.canvas_assignment.get_submission(canvas_user.get_canvas_id())
if submission.submission_type == 'online_text_entry':
return submission.body
return submission.body # TODO: what happens if there is no user submission?
elif submission.submission_type == 'online_url':
return submission.url
elif self.is_quiz():
......@@ -306,7 +306,7 @@ class CanvasAssignment:
submission = self.canvas_assignment.get_submission(canvas_user.get_canvas_id(),
include=['submission_history'])
history = sorted(list(submission.submission_history), key=lambda s: s['submitted_at'], reverse=True)
if len(history) > 0:
if len(history) > 0 and 'submission_data' in history[0]:
submission_data = history[0]['submission_data']
for datum in submission_data:
answers.append(datum['text'])
......
......@@ -75,11 +75,11 @@ if __name__ == '__main__':
if option is options[1]:
print('Which group?')
student_groups = [select_from_list(student_groups, 'student group')]
for student_group in student_groups:
input(f'\n\nPress any key to grade {student_group}')
for student_group in student_groups: # TODO: Skip past graded groups
input(f'\n\nPress Enter to grade {student_group}')
display_peer_reviews(peer_review_assignment, student_group.get_students())
project_name = f'{project_prefix}{student_group.get_name().split()[1]}'
display_git_contributions(list(filter(lambda p: p.get_name() == project_name, projects))[0])
# display_git_contributions(list(filter(lambda p: p.get_name() == project_name, projects))[0])
# TODO: Ask if you want to grade (keep track of groups that you don't grade)
if True:
grade(peer_review_assignment, None, student_group.get_students())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment