harden curve grades dialog to accept undefined + null.

this fix resolves an issue where the "assign zeroes" function
of curve grades dialog was receiving undefined values for scores
instead of null values.

the function now accepts both null and undefined values.

Change-Id: I56db70316b3a4b4b1a2e0f18a7e38ea2880d355f
Reviewed-on: https://gerrit.instructure.com/12403
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
This commit is contained in:
Zach Pendleton 2012-07-20 16:03:31 -06:00
parent ee6ddf3351
commit 6fba24a4d1
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ define [
for idx, student of @gradebook.students
score = student["assignment_#{@assignment.id}"].score
score = @assignment.points_possible if score > @assignment.points_possible
score = 0 if score < 0 or score is null and should_assign_blanks
score = 0 if score < 0 or !score? and should_assign_blanks
users_for_score[parseInt(score, 10)] = users_for_score[parseInt(score, 10)] or []
users_for_score[parseInt(score, 10)].push [ idx, (score or 0) ]
scoreCount++