instructure/canvas-lms — pull request #379 by Kulgar (2013-12-09 15:15:11+00:00)
Title: Peer reviews bugs

Hi!

I have found 3 different bugs concerning peer-reviews:

1. The recipient of the notification in the broadcast policy is not the right one - the mail was sent to the user that submitted the task and not to the assessor, I have corrected it.
2. There is a wrong url in the email bodies, the url was using the "submission.id" as the last element, but this route does not exist in routes.rb, we have to use "submission.user_id" to match the correct route in routes.rb
3. A user could see the "private name" of his assessors in some fields. The 'assessor_name' function of the rubric assessment model should return the 'short name' of the assessor and not his (private) 'name'.

__Test plan__

To __reproduce__ the bugs I solved:

1. Wrong recipient:
* Create a task in a course and check the "enable peer reviews" option,
* Create two students, one should submit the task and the other should be the assessor - don't forget to assign him the task of the first student,
* Don't review the task, instead, send a 'remind' notification by clicking the button when your mouse is over the assigned task in the 'peer reviews' page of the task.
* The user that will receive the mail is not the assessor but the student that submitted the task - this is not right.

2. Wrong URL:
* In the email that you receive from the first test (wrong recipient), you just have to try to click on the link that should bring you to the submission that you have to review.
* It won't be the right URL, if a user has the same id as the submission (for instance the URL is taking you to submission 1 and User 1 does exist!) - you will find yourself on the user 1 submission if this user has submitted a submission. If he does not, you will be redirected with a strange error 'this user is not a student of this course'.

3. Wrong displayed name:
* Masquerade a user that already received some peer reviews,
* Go to the reviewed task
* Click on one of the peer reviews
* Click on the upper right button 'view rubric'
* You should see a select field with user names in it (the assessor names), those names are not the "public names" (the short_name attribute of the User model) but the "private names" (the 'name' attribute of the User model)