instructure/canvas-lms — pull request #380 by Kulgar (2013-12-09 15:43:52+00:00)
Title: Global reminder functionality

I have added a new button in the peer reviews page of a task: when clicked it sends a notification for each submitted task to each assessor.

Here is what I did:

* Added a new route in routes.rb `'peer_reviews/all'` it simply match the same controller/action as the "single reminder" button,
* Changed the remind_peer_review action, I am testing for the presence of "params[:global]" and if it is present I simply get all the assessment requests that are assigned and not yet completed,
* Added a new method in the AssessmentRequest model: for each assessment request, it calls the `send_reminder!` function.
* Modified the view to add the button and the javascript function that does the ajax call and provides the 'global' parameter.

I am not sure if going through all the assessment requests that are not yet completed and calling `send_reminder!` on each request is the best way to achieve this functionnality - it may be slow if there is a lot of assessment requests that are not yet submitted. To speed up this functionnality we could add it to the delayed jobs or modify the broadcast policy.

Test plan:

* Create a course, a task with the 'enable peer reviews' option, some students,
* Submit several tasks and assign them to different students,
* Click the "Remind All Peer Reviews" button on the peer reviews page of a task and see if you receive the mails

**This functionnality won't work properly** until you accept the pull request #379 as there are some bugs in the basic peer review reminder functionnality.