From e780e4d87e4dc60378a0d8d09c313544b63e28bb Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Tue, 17 Apr 2012 11:53:11 -0400 Subject: [PATCH] Put in precaution to be sure that any problems with a possible score of 0 are not graded. --- djangoapps/courseware/grades.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/djangoapps/courseware/grades.py b/djangoapps/courseware/grades.py index 072b3dd343..b50ef15669 100644 --- a/djangoapps/courseware/grades.py +++ b/djangoapps/courseware/grades.py @@ -313,6 +313,10 @@ def grade_sheet(student): correct = random.randrange( max(total-2, 1) , total + 1 ) else: correct = total + + if not total > 0: + #We simply cannot grade a problem that is 12/0, because we might need it as a percentage + graded = False scores.append( Score(correct,total, graded, p.get("name")) ) section_total, graded_total = aggregate_scores(scores, s.get("name"))