canvas-lms/app/models/assignment
Gary Mei 85ee64f3ae allow provisional graders to delete grades
When a provisional grade has been left, it should be deletable by the
provisional grader who left it. Invalid grades still be unacceptable,
but now "no provisional grade" is considered valid. Deleting a
provisional grade will not change the fact that the provisional
grader took up a moderation slot.

A provisional grade cannot be deleted nor changed after the
provisional grader has been been selected by the final grader in the
moderation page. After grades have posted, grades can be deleted
or changed.

fixes GRADE-1637

Test Plan
- Create a moderated assignment with just 1 number of graders.
- As the provisional grader, launch SpeedGrader and give a grade to a
  student. Tab away.
- Delete the provisional grade; there should be no error messages.
- Enter a valid, non-empty grade.
- Replace the valid provisional grade with an invalid provisional grade
  (e.g. "asdf"). There should be an error message, and the
  provisional grade should have reverted to the last valid provisional
  grade.

- Delete the provisional grade.
- As another provisional grader, launch SpeedGrader and attempt to
  leave a provisional grade. There should be an error message stating
  that the max number of graders has already been reached.

- Leave a provisional grade again, as the first provisional grader.
- As the final grader, open the moderation page and select the
  provisional grader.
- As the provisional grader, attempt the delete the provisional
  grade. It should have an error message.
- As the provisional grader, attempt to change the provisional grade.
  It should have an error message.

- As the final grader, post the grades.
- As the provisional grader, attempt to delete the grade. It should be
  okay.
- As the provisional grader, attempt to leave and change a grade. It
  should be okay.

Change-Id: I169ac65a5d8785007b3c71aed87bbef968c86e9e
Reviewed-on: https://gerrit.instructure.com/168804
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2018-10-30 19:34:18 +00:00
..
filter_with_overrides_by_due_at.rb da licença part 8 2017-04-27 21:33:20 +00:00
filter_with_overrides_by_due_at_for_class.rb da licença part 8 2017-04-27 21:33:20 +00:00
filter_with_overrides_by_due_at_for_student.rb da licença part 8 2017-04-27 21:33:20 +00:00
grade_error.rb allow provisional graders to delete grades 2018-10-30 19:34:18 +00:00
max_graders_reached_error.rb Show error in SG on grade/comment if max graders 2018-05-25 17:24:26 +00:00