Skip to content

Commit

Permalink
account for partial grading when syncing from canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
IonMich committed Dec 7, 2023
1 parent ae402dc commit 797a1a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion courses/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def api_course_assignments_create(request, course_pk):
canvas_id=data.get('canvas_id'),
defaults=defaults
)
if (not created) and assignment.get_all_submissions().filter(graded_by__isnull=False).count() > 0:
num_subs_with_grader = assignment.get_all_submissions().filter(graded_by__isnull=False).count()
num_subs_with_question_grades = assignment.get_all_submissions().filter(question_grades__isnull=False).count()
if (not created) and (num_subs_with_grader > 0 or num_subs_with_question_grades > 0):
defaults.pop('max_question_scores')
print(f"Assignment has graded submissions. Not updating max_question_scores.")
if (not created):
Expand Down

0 comments on commit 797a1a0

Please sign in to comment.