Put in precaution to be sure that any problems with a possible score of 0 are not graded.

This commit is contained in:
Bridger Maxwell
2012-04-17 11:53:11 -04:00
parent 3e293f2a3d
commit e780e4d87e

View File

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