Add course and term names under group listings

Multiple groups with the same name are now better identified with their
context names (and term names if they are courses).

Test Plan:
  * Create two courses, with one of them in the Default Term
  * Create course groups in those courses
  * Add a student to both course groups
  * As the student, go to /courses
  * Make sure the course name appears under the group name
  * Make sure the term name appears (unless it's in the Default Term)
  * Do the same for /groups
Fix group name tooltip in courses#index

Test Plan:
  * Create a course group with multiple words
  * Add a student to that group
  * As the student, go to /courses
  * Hover over the group name
  * Make sure that all the words show up in the tooltip
Use term styling for groups in courses#index

Test Plan:
  * Go to the courses page (/courses)
  * Look under My Groups
  * Course name/term for groups should be displayed like terms
    for courses
  * Course term (if any) should be in parentheses
Bug fix for pressing enter key on add course form

Before this fix, if your pressed or held down the enter key
when creating a course on the Add Course dialog, duplicate
courses would be created.  This prevents that from happening.

fixes CNVS-13480
fixes CNVS-14154

test plan:
- Go to one of your accounts
- Click the "Add a New Course" button
- Put in a Course Name and Reference Code
- Press Enter
- The form should only submit once and only one course
  should be created.
- Go to /courses
- Click Start a New Course
- Enter a Course Name and press Enter
- The form should submit and take you to that course's page
- Go back to /courses
- There shouldn't be duplicates of the course you just created

Change-Id: I32980445e2e6748188f84232cb8c0740c660c8a0
Reviewed-on: https://gerrit.instructure.com/41825
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Dan Minkevitch <dminkevitch@instructure.com>
fixes typo for CNVS-15738

Test plan:
- Ensure that " Better File Browsing" feature flag is enabled
- Select the course
- Click on Files from the left navigation panel
- Select Multiple files in the right hand pane
- Download Zip button is displayed in the top
- Verify hover over tool tip text on the button is' Download Zip'

Change-Id: I2ce5664a1dbf89e43d71de34116045692983df1c
Reviewed-on: https://gerrit.instructure.com/41861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
fixed speech to text and true/false check for Chrome

Chrome's x-webkit-speech was deprecated, replaced it with javascript API
added functionality:
now actively tracks interim results and displays them to the user
added variety of error messages and prompts

fixes CNVS-13432

test plan:
- use Chrome (Version 35 or 36)
- navigate to an assignment, then to speedgrader
- click the microphone/pencil icon under the comment box
- dialog should pop up. Click record (then 'allow' if prompted)
- begin speaking
- interim results should appear in blue while talking
- final results should turn black
- when you hit stop, spoken text should appear in comment box
- should generate error for mic not allowed or no text spoken
- should bring up error if recording times out after long silence
- cancel button should discard spoken text w/out adding comment
- ensure mic does not appear in FF, Safari, or IE

Change-Id: I46eae92892dd37e0a3906023150653aaaf2e2ece
Reviewed-on: https://gerrit.instructure.com/38833
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
disable_ddl_transaction! is built into rails 4

Change-Id: I04d12180680b9cb85b5797ca3dbab0aff912c503
Reviewed-on: https://gerrit.instructure.com/41791
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix submitting on assignment with # in url

  added if statement to catch urls with lone #'s at the end when
  submitting assignments

  fixes CNVS-15812

  Test Plan:
  -Navigate to a published file upload assignment as a student.
  -Submit the assignment with a file.
  -Notice it succeeds.
  -Add a #<any text here> to the end of the assignment url so it should
  look like this: /assignments/:id/#<your text here> and refresh the
  the page until it actually reloads.
  -Submit the assignment again.
  -Notice it submits successfully
  -Navigate to /assignments/:id/# (make sure it actually reloads the page)
  -Submit the assignment.
  -The page should refresh and the Submit section of the page should have disappeared.
  

Change-Id: Ic81b4e7e51de96a20f7eae8c2fa609b82be6965a
Reviewed-on: https://gerrit.instructure.com/41756
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Update Respondus SOAP endpoint to use Quizzes NS

Since the namespacing of Quizzes, their "asset_strings" have become
"quizzes:quiz" instead of just "quiz" which was causing this endpoint to
not locate the quiz objects from the content migration.

Closes CNVS-11732

TEST PLAN
---- ----

See https://www.pagehub.org/canvas/quizzes/tickets/cnvs-11732#test-plan

Change-Id: I97369f9c50881dc1c6541fc0a824d9f332c99e0e
Reviewed-on: https://gerrit.instructure.com/41905
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
bump switchman

rails 4 compatibility issue

Change-Id: Ib663144fa32ae33df93e8159a6959f07e1889248
Reviewed-on: https://gerrit.instructure.com/41781
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
add enrollment_term_id to courses api response

this is core information about a course and should be included

Test Plan:
 * Fetch a course through the api at both /courses and accounts/:id/courses
 * the enrollment_term_id should be on the course object

closes PLAT-665

Change-Id: If60e347fc40dc2c510ba999f05e058ea3bccbcc7
Reviewed-on: https://gerrit.instructure.com/41943
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>
speed up & simplify rails controller for newfiles

fixes:  CNVS-15789

we don't need to do this check if a user can
"read_contents" of the root folder of the course
because if they can't the api request to get it
will just 401.

Change-Id: I4787bb8c3340f9215f7bfadf6e708e7c29a38aaa
Reviewed-on: https://gerrit.instructure.com/41705
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
implement drag and drop upload

closes CNVS-11668

test plan:
  - enable new files UI feature flag
  - in the new files interface:
    - drag a file from your OS to the folder area in the canvas UI
    - UI should update to reflect a dropable zone
    - drop the file
    - UI should return to normal state
    - previous upload process should take over

Change-Id: Ifbf66eec86f431c5d29a50b3e6e05e21b20bc410
Reviewed-on: https://gerrit.instructure.com/41670
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
remove AR serialization overrides

fixes CNVS-15784

restores default behavior of a nil column returning a blank object,
rather than nil

had to adjust turnitin code that expected a nil rather than blank,
and a few specs

test plan:
 * regression test turnitin integration

Change-Id: I62968cabdba15f2e59ebdfed9b946781a1b0561c
Reviewed-on: https://gerrit.instructure.com/41647
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
don't use preload_associations

it's a shim of the rails 2 variety, and breaks in rails 4 in the
common case because the options became a scope

Change-Id: I712a8fed35ee0a9747a13c1495f7d51b8dac6823
Reviewed-on: https://gerrit.instructure.com/41716
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
update active_polymorph for rails 4.0

fixes CNVS-15774

test plan:
 * take a quiz. it shouldn't asplode

Change-Id: I090fc549cd5d7986d6963fb4ae6be441eda2c675
Reviewed-on: https://gerrit.instructure.com/41659
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Controller/model features for Outstanding Quiz Submissions

Outstanding quiz submission management is now contained in a dedictated
model, and this controller action provides access to the quiz scoped
actions of #search and #grade.  The API endpoint provides JSON access to
these actions.
Closes CNVS-15501
Test Plan:
  - Create quizzes with outstanding (unclosed, but overdue) quiz submissions
  - Hit the endpoint
  /api/v1/courses/:course_id/quizzes/:quiz_id/outstanding_quiz_submissions
  - GET JSON to retrieve quiz_submissions which are outstanding
  - POST JSON with something like {"quiz_submission_ids": [1,2,3,4]} to grade the QS
Change-Id: I7fe0341379d4dbd70ed25c667bd1c4dc7969b077
Reviewed-on: https://gerrit.instructure.com/41229
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
Fix permissions and multi-select for SearchResults

Before, you were not able to select multiple items when searching
for files.  You also wouldn't be able to edit those items even
if you had manage_files permissions.  This fixes both of
those bugs.

fixes CNVS-15800
fixes CNVS-15834

test plan:
- Enable Better File Browsing feature flag
- Go to any course's Files section
- Search for an existing file
- Click on the search result(s) in the main file pane
- A toolbar should appear above allowing you to
  view and download the file(s), as well as other
  editing abilities if you have manage_files permissions.
  Also, if you have manage_files permissions, a PublishCloud
  button should appear on each search result item,
  as well as additional options in the ItemCog to edit, move,
  etc that file (more than just the Download link).

Change-Id: Ie818fd1cf4cd7dcaa0520260babf5a540ca816e4
Reviewed-on: https://gerrit.instructure.com/41801
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
reworded sentence to address comma splice and typo

Change-Id: I6e1593e74c47ce681951af8bf2631e2ee08ad439
Reviewed-on: https://gerrit.instructure.com/41218
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
clean up routes for rails 4

fixes CNVS-15128

 * don't use :as when it's already what it will be
 * use get/post/delete instead of match, to specific the actual
   method allowed
 * don't use 'path' => 'controller#action' when the action is the
   default; just use :action
 * use as instead of path_name (path_name is gone)
 * use path instead of path_prefix (more inline with rails 4 options)
 * make ApiRouteSet not duplicate the same route name
 * remove a few duplicate route names
 * since I rewrote most the file anyway, fully convert to 1.9 hash
   syntax

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