Updates New Files cog menu for keyboard navigation

fixes CNVS-16811

Test Plan:
	- Enable Better Files Browsing
	- Use the keyboard to go to where the cog menu should be
	- The cog menu should appear when it has focus

Change-Id: I853d70c88958134093b6152def284748d11dbfa0
Reviewed-on: https://gerrit.instructure.com/44224
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Quiz Reports API - force regeneration

Extends the quiz reports API with the ability to re-trigger failed CSV
generation jobs, and to abort them completely. The UI is extended to
utilize those new APIs.

Closes CNVS-16525

TEST PLAN
---- ----

  - create a quiz with a file upload question
  - take the quiz by a student and upload a file, then submit
  - turn on new stats and go to new stats page
  - click the "Student Analysis" report generator button and verify that
    the CSV file is generated and you get prompted to save it

Now... we break the student's submission by removing the attachment and
then the student analysis will start failing to generate.

Launch a rails console and perform the following command:

[ 'Quizzes::QuizSubmission', 'Quizzes::QuizStatistics' ].each do |type|
  Attachment.where({ context_type: type }).last.destroy!
end

  - reload the stats page
    + the "Student Analysis" button should now read that it had never
      been generated, that's right because we just removed the CSV file
      attachment using the console
    + try generating the report again
      - verify that it blows up
    + you should now see a notification as in the screencast
      - clicking the "retry" link should retry generating the report
        (which will fail again)
      - clicking the "cancel" link should remove the notification
      - clicking "Dismiss" should dismiss the notification, but if you
        reload the page, it's still there

Change-Id: I467a9030c3ef94d685ec20b31dd533e530e24758
Reviewed-on: https://gerrit.instructure.com/43862
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
spec: Fixed the verify_logout method.

Change-Id: Ia84cf464d9c91dead4401db26553121cfe4f2c95
Reviewed-on: https://gerrit.instructure.com/44243
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Kyle Rosenbaum <kyler@instructure.com>
Reviewed-by: Kyle Rosenbaum <kyler@instructure.com>
QA-Review: Kyle Rosenbaum <kyler@instructure.com>
Changed discussion section to read Assignment Comments

Changed the disscussion section inside the speedgrader to read
Assignment Comments instead of Discussion.

fixes CNVS-16756

test plan:
- As teacher create an assignment
- have student finish the assignment.
- Post a comment on the assignment under get details.
- have teacher click speedgrader.  Notice the
Assignment Comments section changed from Discussion

Change-Id: Iafd860cf8fba67aae8df1cabe4c2db4e6bbcfa64
Reviewed-on: https://gerrit.instructure.com/44297
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Benjamin Porter <bporter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
fix unauthenticated error handling code

this commit really fixes three bugs that were all compounding to break
the unauthenticated error handling code:

- fixes a typo calling isUnauthenticated()
- fixes other bugs in that method that were masked by the fact that it
  wasn't being called
- once the code was called, and the message was showing, it was showing
  escaped html, because of a recent fix we did to make flash messages
  more secure to html injection.

we also have now tests covering the first and second bugs listed

this is tricky to test locally because there is a flag that passes all
error through to the default error handler in development, which is nice
because you can see what is breaking in development in a more visible
way, but is annoying because it meant the bugs listed above only
manifest themselves in production.

fixes CNVS-16819

test plan:
** ensure you are in a production environment **

retest commit 00698fc89858f9b86d7b430fdb3a9537e6d2e08e:
- hit a page with an ajax action that is unauthorized: (for example,
  right now there is a bug that causes this if you set the course
  homepage to be the assignment index page and then visit it as a user who
  has a student enrollment in a different class)
- it should show a 'development only' flash error in a development
  environment, and not show any flash error in a production environment

retest commit e45ff7189aee3edefb62de8f087bb6b871b2d1a9:
- in one tab, start to fill out an ajax form (e.g. editing a quiz)
- in another tab, log out of canvas
- return to the original tab and try to submit the form (e.g. save your
  changes)
- should get an error message with a link to login in a new tab
- login in the new tab
- return to the original, and try to resubmit
- should save successfully

Change-Id: I78a2b33a195cb494ea31364fdc4abb27abbe02c2
Reviewed-on: https://gerrit.instructure.com/44241
Reviewed-by: Benjamin Porter <bporter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
UI for adding SIS token to canvas

fixes SIS-641

Test plan:
- generate a token in SIS App
- copy and paste the token in the 'SIS Token Authentication' field
-- you must enable the Post Grades to SIS feature to see this setting
- update the settings and confirm the sis token was saved

Change-Id: I13f2e0136809c42d7b7c7b30c330efb11f6dc29f
Reviewed-on: https://gerrit.instructure.com/44358
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Houle <nhoule@instructure.com>
use scopes instead of associations with joins

associations with joins were never really supported by rails

test plan:
 * canvas works

Change-Id: I62dd9b38c7340fce96351f1e3ba91acd6440aa66
Reviewed-on: https://gerrit.instructure.com/42856
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
be more defensive of special account creation

fixes CNVS-16632

don't auto-create unless the setting was previously nil, and we're
*not* in production mode. production mode *requires* using
rake db:initial_setup.

test plan:
 * existing canvas install should work
 * a fresh canvas install should also work

Change-Id: Iee4b0ead053aef220aac5f54c519174ce1b41843
Reviewed-on: https://gerrit.instructure.com/43845
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
add strong_parameters

refs CNVS-16685

at this point, it is completely opt-in - you have to use
strong_params instead of params in your controller.
during mass assignment, if it's a strong params hash, it will
only use that hash; if it's not, it will use attr_accessible
/attr_protected

handling of the new exception for the API is also included

Change-Id: I0fbf3b68291ad6f02165b27e36b23cc3b666e330
Reviewed-on: https://gerrit.instructure.com/44217
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
QLA - QuestionFlagged event

Closes CNVS-16801

TEST PLAN
---- ----

  - go to take quiz with at least 1 question
  - open console
  - flag a question
    + verify an event is submitted with the question's id and that it's
      flagged (a message should also be logged)
  - unflag it
    + verify the same event is submitted but this time with
      "flagged: false"
  - try flagging other questions, the submitted ID should change

Change-Id: I7a1b6ae3a0538050f6b5c8ea3a3d935cd50b0710
Reviewed-on: https://gerrit.instructure.com/44152
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fix role overrides fetching for site admin on a separate shard

test plan:
* have site admin on one shard
* make a custom account role
* give it all the permissions
* login as a user with that custom role
* visit an account on another shard
* should have all the permissions

Change-Id: I2a128a672b7b6973e1d25c58d635f0147a486240
Reviewed-on: https://gerrit.instructure.com/44353
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
don't delete from params in ContentImportsController

refs CNVS-16685

Change-Id: I4cd92ab8078ae1709b470ab6fb4cc1e410282044
Reviewed-on: https://gerrit.instructure.com/44290
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
add role id to student view enrollments in data fixup

Change-Id: I6fc8b02fb6325005cdd38c81457bd4b98a813cec
Reviewed-on: https://gerrit.instructure.com/44322
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
don't delete from params in CommunicationChannelsController

refs CNVS-16685

Change-Id: Ifbffb4b8d30871733faae3289bcb09d3d6218ca8
Reviewed-on: https://gerrit.instructure.com/44289
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
don't use params.delete in ContextModulesController

refs CNVS-16685

Change-Id: I29e04e20eb243b14ed2246fe7c25a3e45185b1fb
Reviewed-on: https://gerrit.instructure.com/44291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Add TinyMCE Keyboard shortcuts dialog for assessments pages

This adds a little 'i' icon that shows the TinyMCE keyboard shortcuts.
It's a critical change to benchmark leading-edge accessibility initiatives

Fixes CNVS-15962

Test Plan:

    Make sure the 'i' icon works on these three pages.  When clicked it
    should display a dialog that shows the keyboard shortcuts for the
    TinyMCE editor:

        1. Submit assignment
        2. Create/Edit assignment
        3. Outcomes

Change-Id: If20bb1a2ffca89417666968f7d6beff0ebe3cbd2
Reviewed-on: https://gerrit.instructure.com/44024
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
Changes time of assignment update to after change

Fixes: SIS-645

assignment update happens after change made in
post grade dialog instead of after error count = 0

Test-Plan:
--Ensure at least 2 assignment have post grades error--

1.) Navigate to grade book and post grades
2.) Resolve error for one assignment
3.) Close modal and verify that assignment has been
	updated

Change-Id: I8cfa415631427e711fdbf1bec167d5376fecc8be
Reviewed-on: https://gerrit.instructure.com/44225
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
Add sis_user_id to submissions for multiple assignments

Test Plan:
- Build a course with an enrolled student imported by the same SisBatch
- Request submissions for multiple assignments with the grouped
  parameter included in the query
- The response should include the sis_user_id of the student

Change-Id: I9c642c839fac74d45efb47d4252c3aac3a687fb7
Fixes: SIS-660
Reviewed-on: https://gerrit.instructure.com/44319
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Tyler Pickett <tpickett+gerrit@instructure.com>
specify pagination order for outcome links

the outcome link endpoint was not specifying an order when paginating,
which could cause duplicate outcome links to be returned

fixes CNVS-16646

test plan:
- create a course with a lot of outcomes (~50)
- load the student outcomes gradebook
- it should show all of your outcomes

Change-Id: I68c9b6369c9ec25a8a1ad7d429ba12fa21799588
Reviewed-on: https://gerrit.instructure.com/44347
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Benjamin Porter <bporter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Updated de translation

Change-Id: I5db60d82cce28025b705050bc7bdec1d72c4a745