Skip to content

Commit ba8e495

Browse files
committed
fix "message students who scored more/less than" and 0 scores
refs #3783 Change-Id: Idfd66601f0dd82a0e1f492a84d3526d77973ee4f Reviewed-on: https://gerrit.instructure.com/2276 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Brian Whitmer <brian@instructure.com>
1 parent 5eba17d commit ba8e495

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

public/javascripts/gradebooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@
375375
if(selected == "Haven't submitted yet") {
376376
return !student.submitted_at && !student.graded_at;
377377
} else if(selected == "Scored less than") {
378-
return student.score != null && student.score != "" && cutoff != null && student.score < cutoff;
378+
return student.score != null && student.score !== "" && cutoff != null && student.score < cutoff;
379379
} else if(selected == "Scored more than") {
380-
return student.score != null && student.score != "" && cutoff != null && student.score > cutoff;
380+
return student.score != null && student.score !== "" && cutoff != null && student.score > cutoff;
381381
}
382382
});
383383
return $.map(students, function(student) { return student.user_data.id });

public/javascripts/message_students.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@
9999
var idx = parseInt($(this).val(), 10) || 0;
100100
var option = currentSettings.options[idx];
101101
var students_hash = $message_students_dialog.data('students_hash'),
102-
cutoff = parseFloat($message_students_dialog.find(".cutoff_score").val(), 10) || null;
102+
cutoff = parseFloat($message_students_dialog.find(".cutoff_score").val(), 10);
103+
if (!cutoff && cutoff !== 0) {
104+
cutoff = null;
105+
}
103106
var student_ids = null;
104107
var students_list = [];
105108
for(var idx in students_hash) { students_list.push(students_hash[idx]); }
@@ -125,4 +128,4 @@
125128
}
126129
});
127130
});
128-
})();
131+
})();

0 commit comments

Comments
 (0)