Add integration_id to submissions API

Added integration_id to the user (pseudonym) as well as the
assignments when querying for submissions.

Test Plan:
- query for submissions from a student with an sis_id and
  an integration_id, and for an assignment with an integration_id
- use grouped=false
- results should have integration_id for students, and
  integration_id for assignments
- e.g. curl -H 'Authorization: Bearer [your API key]' \
  -XGET http://localhost:3000/api/v1/courses/1/students/submissions \
  -F 'include[]=assignment' -F 'student_ids=all' -F 'grouped=false'

Fixes SIS-252

Change-Id: I0339fa19bc50dfea3719598924a90746b62f7ebe
Reviewed-on: https://gerrit.instructure.com/34456
Reviewed-by: Eric Adams <eadams@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
csv downloads working with new gb urls

refs CNVS-11966

test plan:
  -with srgb ff on
    - download a csv from srgb
    - download a csv from gb2
    - upload a gradebook csv
  -with srgb ff off
    - download a csv from gb2
    - download a csv from gb1
    - upload a gradebook csv

Change-Id: Ib63c65adbdb650852f3541e8045b103dd5fb7a21
Reviewed-on: https://gerrit.instructure.com/34100
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix multiple due dates from overlaping in modules

fixes CNVS-12637

When you go to the modulese page if you had multiple due dates it would
overflow into the pts column. This no longer does this.

Test Plan
---------
As a teacher
Given I have multiple sections set up in a course
And I've added an assignment to the modules page
And that assignment has multiple due dates on it
And that assignment has points on it
When I go to the modules page
I should the module item with multiple due dates text
And it should not be overlaping the points column

Change-Id: I77557f10eb83a1acca4aa21ad4b9d7ab1de2004d
Reviewed-on: https://gerrit.instructure.com/34387
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
move access tokens on user merge

fixes CNVS-12919

test plan
 - have an access token on user1
 - merge user1 into user2
 - access token should now belong to user2

Change-Id: Ied578d6c921585f15eb3575704f9bb6c5a801266
Reviewed-on: https://gerrit.instructure.com/34514
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
discussion topics: fix sorting nil positions

fixes CNVS-12774

test plan:
  * if you don't have legacy discussions with nil positions, run this:

Course.find(1).discussion_topics.where(pinned: true).update_all(position: nil)

  * open the discussions index page
  * move a discussion using the "Move To" gear menu option
  * verify that the discussion is moved
  * reload the page
  * verify that the change persists

Change-Id: Ibb3afc6a876f359cecba360792009b3db1793785
Reviewed-on: https://gerrit.instructure.com/34230
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
fix some crumbs I18n

fixes CNVS-3106

test plan:
 * change language
 * /accounts/X/account_authorization_configs
 * /accounts/X/avatars
 * go to a user page, and click "Delete from X" (where X is the account)
 * all three of those pages the bread crumbs should be localized

Change-Id: I198275963999bb08fceb0659a7097af6287d8684
Reviewed-on: https://gerrit.instructure.com/34484
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
add option for course state changes (log auditing)

fixes: CNVS-347

Adds state change logging activity for courses.  This change also adds an event
source field to all the course activity events.  The options for this is api,
manual, and sis.

Note: This also adds a fix for the event stream record object to force request_id to
be a string.  Event stream will try to insert an integer into a text column which
Cassandra will complain about and throw an error.

Test Plan:
  - Test for each type of Event:
    * Concluded
    * Unconcluded
    * Published
    * Deleted
    * Restored
    * Updated
    * Created
    * Copied To
    * Copied From

  - Test each type of event and each source.  Note that some events can only
    have certain sources.  Also make sure SIS migrations show that the source
    is type SIS.

Change-Id: Ic2308e1d10e6fc1cc6437221d7842eaf1a596f46
Reviewed-on: https://gerrit.instructure.com/30343
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
force calendar2_only account setting to true

fixes CNVS-12331

before you check out
- configure some accounts to not use calendar2
- configure some users to prefer calendar1

test plan
- ensure that everyone gets calendar2, all the time, even if they
 specifically checked a box saying they don't want to use it

Change-Id: Ibe1eb6b86ccc1c9489b166c138c87a288eb91ac1
Reviewed-on: https://gerrit.instructure.com/34339
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
allow users to manage group membership limits

fixes CNVS-11830
fixes CNVS-11831

test plan

 - add a course group
 - set the max members in the group creation dialog
 - verify that the limit is enforced

 - enforced it a course group
 - change the max members in the group edit dialog
 - verify that the new limit is enforced

 - edit the group set
 - change the max members limit for the group set
 - verify that the limit is changed for all of the groups in the set

Change-Id: I6f112d29d6c5ca662da1598e29db2f3081f30148
Reviewed-on: https://gerrit.instructure.com/33722
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
allow pressing enter to add module items

fixes CNVS-12660

Test Plan
As a teacher
Given I have a module
And I've clicked the add module item + button to add a module item
When I fill out any of the forms
And I press enter
It should add a module item
And it should add the module item once.

As a teacher
Given I have a module
And I've clicked the add module item + button to add a module item
When I select an existing module item with my mouse
And I press enter
It should add a module item
And it should add the module item once.

Change-Id: Iebc25a1906519f16af36686e0d20ba3094ed6ba3
Reviewed-on: https://gerrit.instructure.com/34515
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Syllabus: Jump To Today link redirects focus

Fixes CNVS-12796

Test plan:
- Open Syllabus.
- Click the Jump To Today link.
- Note that the browsers focus is moved to near the relevant row.
- Verify that the function still works as expected for sighted users.
- Using a screen reader, confirm that the virtual focus is also set correctly.

Change-Id: I2c14aeb25b3a2b1c638ec821cc1de61ecb9776b9
Reviewed-on: https://gerrit.instructure.com/34432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
individual gradebook view: outcomes

fixes CNVS-11439

test plan:
  * enable Individual Gradebook View
  * open a course's gradebook
  * switch to individual view
  * select the learning mastery tab
  * select a student
  * select an outcome
  * verify that displayed outcome results are accessible

Change-Id: I89bbcb81fe3049acf2595737ee921d5a0b91c90b
Reviewed-on: https://gerrit.instructure.com/33967
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
force calendar2_only account setting to true

fixes CNVS-12331

before you check out
- configure some accounts to not use calendar2
- configure some users to prefer calendar1

test plan
- ensure that everyone gets calendar2, all the time, even if they
 specifically checked a box saying they don't want to use it

Change-Id: Ibe1eb6b86ccc1c9489b166c138c87a288eb91ac1
Reviewed-on: https://gerrit.instructure.com/34339
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
change settings.value to text

refs OPS-92

test plan: n/a

Change-Id: Iae1fa2eb2194c0d9ea5c9a1e29a6ffabb0e90a92
Reviewed-on: https://gerrit.instructure.com/34611
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
change settings.value to text

refs OPS-92

test plan: n/a

Change-Id: Iae1fa2eb2194c0d9ea5c9a1e29a6ffabb0e90a92
Reviewed-on: https://gerrit.instructure.com/34611
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
return sis pseudonyms from trusted accounts

fixes CNVS-11814

and be sure to identify the account somehow

test plan:
 * set up a trust between account A to account B
 * add a user to account B with an SIS pseudonym
 * enroll the user in a course in account A
 * course gradebook csv and quiz statistics csv should show the
   pseudonym from account B, and account B's domain
 * an API call to list students in the course shoud show the
   pseudonym from account B, and account B's domain

Change-Id: Id656d06b8119bdcb31cc3e567d49cd6ce7c8428f
Reviewed-on: https://gerrit.instructure.com/31812
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>
accessibility fixes to kyle menus

fixes CNVS-9554

all items are properly read and focused when
navigating Kyle Menus via keyboard

this commit patches JQueryUI menu.js :(

test plan:

- Create a graded discussion.

- Activate the discussion cog menu, and confirm
  that all items are read by a
  screen reader, and properly focused on screen
  when arrowing up and down via the keyboard.

- Leave a reply, and test the cog menu on the
  reply as above.

- Confirm that all items within the menu are
  activatable by pressing enter

- Verify that the appearance of the page is still correct.

- Visit all other pages with Kyle Menus, and
  verify the same as above.

- make sure to test in IE since the way click
  events are simulated is different code

Change-Id: I735573b3151c1133b6bdfb2f0e6bea6b7a285372
Reviewed-on: https://gerrit.instructure.com/27447
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
canvadocs

This commit adds support for document previews from a Box View
compatible API.

closes CNVS-12416

Test plan:
* NOTE: check everywhere for previews (speedgrader, files list,
  individual files page, etc?)
* Enable Scribd and Crocodoc
  * attachments should be previewable in scribd or crocodoc (submission
    attachments should go to Crocodoc)
* Enable Canvadocs
  * Files that previously previewed in scribd should now go to
    Canvadocs.  Nothing should ever go to scribd.
  * New submission attachments should continue to use Crocodoc (for
    supported file types)
  * Other attachments should preview in Canvadocs

Change-Id: I173e4fabc0ae677cdddd4bd065777a90360c1f34
Reviewed-on: https://gerrit.instructure.com/34535
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
spec: fix user api spec

Change-Id: I04058d52c5c63124451d9524c89e210fd11bd155
Reviewed-on: https://gerrit.instructure.com/34675
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
ensure course's account and root account are in associated_courses

fixes CNVS-3273

test plan:
 * create a course in a sub account
 * delete all course_account_associations for that course
 * clear your cache, and restart your server
 * as an admin in only that account, you should be able to
   edit the course (even though you won't see it in the course
   list for the account)

Change-Id: I26120fedbd9556c18e08cecf5ff4f14a960d334c
Reviewed-on: https://gerrit.instructure.com/34486
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>