Gives the edit/add module form a better focus target

Because of the way the events are done/handled by the form
a submit occurs on the form whenever a form element has focus.
When the form dialog opens the first focusable item is given
focus.  This provides a empty non-interactive element to receive
focus when the form dialog opens preventing an automatic
submit from triggering.  While not ideal, it works.

fixes CNVS-14966

Test Plan:
  - Go to the modules page (/courses/##/modules)
  - Use the keyboard to navigate to the edit option in the cog
    menu.
  - Press "Enter" on the "Edit" option.
  - The form should not close automatically.
  - Do the same with module items.

Change-Id: Icf22c23b502b66a7678111224bf0907876bc72f8
Reviewed-on: https://gerrit.instructure.com/41031
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Quizzes only autosubmit when they hit the lock date

When a quiz is in progress, it should be marked late if the student is
still taking the quiz when the due date is reached.  If the lock date
comes up, the quiz should autosubmit at that point.  If there is a quiz
timer and a lock date, the lock date overrules the quiz timer.

Closes CNVS-13689

Test Plan:
  - Create 4 types of quiz scenarios:
    - Lock date only
      - submits at lock date
      - never marked late
    - Lock date and due date
      - autosubmits at lock date
      - late if submitted after due date
    - No due date
      - Never late
      - Autosubmits at course completion
    - Lock date and timer which runs beyond lock date
      - Gives the student time until lock, not normal timer
      - autosubmits at lock date
  - Monitor all these for sane prompts and alerts
    - deadline approaching flash messages for LATENESS (occur at T-30
      minutes, T-5 minutes, and T-1 minute)
    - autosubmission flash prompts (and popup @ T-10 seconds)

Change-Id: I5af9eb360a5f13527b32e7f84c205149bea1935b
Reviewed-on: https://gerrit.instructure.com/40609
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
Modifies subscription_hold to return nil if user is nil

fixes CNVS-15356

Test Plan:
  - Add a discussion to a course that has the following options:
    * Group discussion
    * Allow threaded replies
    * Graded
    * Set a due date of sometime in the future
  - Make the course syllabus publicly available
  - In another window (incognito) go to the syllabus
  - The syllabus should load without problems.

Change-Id: I177555c6e0ac87554360361a95b1ff0a26d35883
Reviewed-on: https://gerrit.instructure.com/41176
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix 400 error setting hidden user feature flag in API

test plan:
 - as a user with site admin privileges, enable the "LOR External
   Tools feature in /profile/settings.

fixes CNVS-15393

Change-Id: I918bdff059b4ef3b5590aa67b0991198699196fa
Reviewed-on: https://gerrit.instructure.com/40850
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Modifies the translation keys for course statistics

fixes CNVS-15576

Test Plan:
  - Transifex should not fail on importing.

Change-Id: I70a9b453b1209389888e347e552ac9843c9acb40
Reviewed-on: https://gerrit.instructure.com/41200
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
deal with read errors from s3 while inferring encoding

we sometimes get errors reading from s3 trying to infer encoding.
specifically, 'content-length does not match' errors from the aws-sdk
gem.  we're trying to upgrade the gem to improve those cases, but we
can at least not crash the job.

fixes CNVS-15442

test plan:
- attachment uploads to s3 should still work

Change-Id: Ie9dcc98098d9a5b3555398859476276fcacad79b
Reviewed-on: https://gerrit.instructure.com/40938
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Add accessibility warning to discussions

fixes: CNVS-14748

Adds an accessibility warning to the discussion
field headers so that SR and Keyboard users know
to navigate to the manage menu to emulate "drag n
drop" behavior.

Test-Plan:
1.) Navigate to discussions
2.) Make sure there are 2 or more pinned discussions
3.) Tab until you're just past the header
4.) Verify that a warning message has appeared
5.) Remove a pinned discussion so you have 1 or less
6.) Repeat steps 2-3
7.) Verify that no message appears, and that it takes
	a single tab to move from the header to the content

Change-Id: I71503a511b627dc6fadb696ca25b5fb6637c898d
Reviewed-on: https://gerrit.instructure.com/40429
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Dana Danger <dana@instructure.com>
rails 4.0.10

Some of these tweaks to bin and config were made just to match what a
newly-generated rails4 project looks like.

Change-Id: I57a7c71e2ddd7f3295ffadf30cb0976c4d15db6a
Reviewed-on: https://gerrit.instructure.com/41186
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
rails4: use jammit HEAD from github

There's a rails4 fix that isn't available in a published gem version,
yet.

test plan: compile assets, and verify that still works properly in rails3

Change-Id: I24e7815f8325d52764813eab353ae226dcec0d12
Reviewed-on: https://gerrit.instructure.com/41060
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
link to discussion topic and quiz menu tools on assignment index

test plan:
* enable the lor feature flag
* create an external tool with quiz_menu and
discussion_topic_menu configured
* should show external tool links specific to each type
on the assignments index page for graded discussion topics
and quiz assignments

closes #CNVS-15520

Change-Id: I020ab9cbc583d7940b0051056d27acb557ab152c
Reviewed-on: https://gerrit.instructure.com/41172
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
no more dynamic finders (controllers)

refs CNVS-15126

Change-Id: Icdea762c810c541d99c30922ee92d6c36686e1fa
Reviewed-on: https://gerrit.instructure.com/39670
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Updated de translation

Change-Id: I74a14343a111b98129055f24f918a4ee0c6b08de
Updated fr translation

Change-Id: Iabab2dd1e21be512cf930939eb484b3f46c4caee
Updated ja translation

Change-Id: I752d08c6aa386e5239c02188885af311710dc9f6
Updated nl translation

Change-Id: Icb75baa93bc8f4f0cf40f0bf879349d3267837a1
move not_selected from external tools settings to it's own column

fixes: PLAT-646

Test Plan:
 * Install an external tool with the property "not_selectable" as true
 * when you look in the asmnt/module item external tool list the tool
   should not be listed

Change-Id: If66e09b83373fad83274d0120cb464e7caf60c83
Reviewed-on: https://gerrit.instructure.com/41205
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Remove SIS attributes from manually recreated enrollments

This also improves consistency with SIS batch imports, as prior SIS
enrollments recreated manually behave the same as first time manual
enrollments.

Fixes CNVS-12983

Test plan:
- Add a user to a course via SIS enrollment
- Remove said user with another SIS enrollment
- Add the user to the same course, but manually
- The enrollment should no longer have SIS attributes,
allowing it to be removed normally through the UI.

Change-Id: I13a56d27fa33c47dc147664010789665daab658e
Reviewed-on: https://gerrit.instructure.com/40540
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
DA - remove deleted assignments from sql view

fixes CNVS-15511

test plan:
  - turn DA off and make an assignment then delete the assignment
  - note the assignment's id
  - open the rails console and run this
    - "AssignmentStudentVisibility.where(assignment_id: XXXXX)"
    - instead of XXXXX, you should write the assignment's id
    - the result of that command should be an empry array => []

Change-Id: I2f09560ce46bd4682e9bf671b4c116508a6f4b49
Reviewed-on: https://gerrit.instructure.com/41114
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
show roles for cross shard users

test plan
 - do an lti launch
 - roles should show up for cross shard users
 - the following substitutions should still work
   * $Canvas.user.id
   * $Canvas.user.sisSourceId
   * $Canvas.user.loginId
   * $Canvas.enrollment.enrollmentState
   * $Canvas.membership.concludedRoles
   * $Canvas.membership.roles

fixes PLAT-648

Change-Id: Ic4c3639a95b4528628f8dd2d205cd8250c1b7d11
Reviewed-on: https://gerrit.instructure.com/41214
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
A bunch of style/polish for newfiles

fixes: CNVS-15244 CNVS-15261 CNVS-15374

changes:
handles overflow by scrolling
matches blake's mockup

test plan:
try the folder tree in both new files and by pressing
the "add image" icon in the tinyMCE toolbar and going
to the "From Canvas" tab.

TODO: 'active' style

it should look good and work well.

Change-Id: I6219da771758fd00d6ed3005ed459097a83fcd7e
Reviewed-on: https://gerrit.instructure.com/40922
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>