canvas-lms/app/views/submissions
Evan Battaglia dffd8e03e4 Fix links to originality reports multiple attempts
Commit 39d77b5e added an "attempt" parameter so plagiarism platform
providers can reliably set and update scores for online_text_entry
submissions with multiple attempts. However Canvas also needs to provide
a way for the user to access the report for a given attempt number,
rather than always showing the report for the first submission attempt.

closes PLAT-5232
flag=none

Test plan:
- As in https://github.com/instructure/canvas-lms/commit/39d77b5e test
  plan, make an assignment that accepts online_text_entry, and as a
  student, submit to it twice (making two attempts).
- As before, make originality score for each attempt using the API, this
  time also sending `resource_url`s
  curl -H "Authorization: Bearer MYTOKEN" http://web.canvas-lms.docker/api/lti/assignments/39/submissions/27/originality_report --data 'originality_report[attempt]=1&originality_report[originality_score]=11&originality_report[tool_setting][resource_type_code]=originality_reports&originality_report[tool_setting][resource_url]=http://example.com/eleven'
  (Note: if you comment out `raise Canvas::Security::TokenExpired` in
  lib/canvas/security.rb, you can use an old token from your Plagiarism
  Platform test tool)
- Go to the places in the UI where links to the report appear and make
  sure all links now point to a URL with an `attempt=1` (etc.) query
  param. Make sure the attempt number matches up. The four places are:
  1. In speed grader on the right side
  2. In speed grader on the left side of the page -- this is in a
  partial which is shown in other places like when the student clicks
  details for a submission
  3. In student grades -- as an instructor, go to gradebook and click on
  a student's name. In the table with assignments, on the right, there
  will be a red or green bubble -- clicking that takes you to the
  report. (You can only the last attempt's report here).
  4. In old gradebook there is a link too. In new gradebook there is
  not. (I didn't change gradebook stuff due to new gradebook
  uncertainty)
- Click the link, which should forward to an LTI 2 launch URL. For me,
  this page doesn't work (and didn't for me on Jesse's test account
  either) but you can get the `resource/XXXXX/` parameter in the URL and
  look up the URL by something like `Lti::Link.find_by(resource_link_id:
  'ec2fa300-2c64-432f-83db-8af709059a7c').resource_url`. Make sure this
  matches up to the correct URL you sent for that attempt.
- Optionally, resubmit originality reports using the API, using new
  scores and report URLs. Again click a link in the UI and get the
  resource_link_id (that shouldn't have changed) and check that the URL
  `Lti::Link.find_by(resource_link_id: '...').resource_url` did change.

Change-Id: Ifc8828b4d4486adc2988b7b71cb712821b2b42c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/221399
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-01-06 22:53:45 +00:00
..
_originality_score.html.erb Fix links to originality reports multiple attempts 2020-01-06 22:53:45 +00:00
_submission_download.html.erb add alt tag to submissions downlaod modal 2018-09-10 15:55:05 +00:00
show.html.erb simplify/modernize google analytics & load faster 2019-08-02 20:07:18 +00:00
show_preview.html.erb simplify/modernize google analytics & load faster 2019-08-02 20:07:18 +00:00