use linked assignment for discussion regrouping check

fixes CNVS-14003

test plan
- create a graded group discussion
- make the topic like a pre group assignment/graded group
 discussion separation commit by doing the following in a console
 - set the linked assignment's group_category_id to the topic's
  group_category_id
 - set the discussion's group_category_id to nil
- edit the discussion from the web ui
- ensure that the discussion can be edited

Change-Id: I7fc385e0ce2236f5986cf601b46a057708c81079
Reviewed-on: https://gerrit.instructure.com/37469
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: David Josse <david@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
add SQL tag back to query log lines

test plan:

Run Canvas with this patch applied, verify that the log lines start with
"SQL User Load (ms)" rather than just "User Load (ms)", etc

Change-Id: Ibded65886a61d4ec2c57a37280f0447af005159e
Reviewed-on: https://gerrit.instructure.com/37570
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix crocodoc bug in speedgrader

fixes CNVS-13920, fixes CNVS-13447

Test plan:
  This needs to be tested against two different HEADs D:
  (6318ca161 and master)

  * Go to speedgrader in an assignment that has crocodocable submissions
  * Make sure the submission loads in crocodoc
  * Assign grades to a student
  * The submission should still be displayed in Crocodoc
  * The submission dropdown should work correctly

Change-Id: If42efff4b8f6f9301fc1a5dbe5c4f52caf9a295c
Reviewed-on: https://gerrit.instructure.com/37419
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
bump encrypted_cookie_store

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

Conflicts:
	Gemfile.d/other_stuff.rb
bump switchman

Change-Id: I868db086df5b4e50efc936f26ce07bb4591420eb
Reviewed-on: https://gerrit.instructure.com/37620
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
run domain substitutions on module item and external tool urls

test plan:
* create a course with external link module items,
and external tools with links pointing to a given
domain (e.g. "http://www.example.com/somewhere")

* in the rails console, manually configure the account settings
as follows, (replacing COURSEID with the id of the course):
 a = Course.find(COURSEID).root_account
 h1 = {"http://www.example.com" => "https://www.not-example.com"}
 h2 = {:domain_substitution_map => h1}
 a.settings[:default_migration_settings] = h2
 a.save!

* copy the course
* the links should all be translated to the new domain
 (e.g. "https://www.not-example.com")

fixes #CNVS-13512

Change-Id: I4472fec4c2633827409967cc76652e7395fb8e0f
Reviewed-on: https://gerrit.instructure.com/37356
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
fix speedgrader multiple submission bug

refs CNVS-13920, refs CNVS-13447

Test plan:
  * submit multiple crocodocable submissions to an assignment for one
    student
  * submit a single crocodocable submission for another student
  * try grading each version of the submissions in speedgrader
  * after grading, you should remain on the same submission version
    (but switching versions should still work)

Change-Id: Idb4244b0ba0f92550a8dbd761a013a67fca8d33a
Reviewed-on: https://gerrit.instructure.com/37711
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
don't overwrite birth shard if it already exists

refs CNVS-14250

Change-Id: I2e8defd8c27ddad48c581735c85e563f5a1a9946
Reviewed-on: https://gerrit.instructure.com/37721
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>
get instead of post to create crocodoc_sessions

This redirects to the session url (like canvadocs) instead of returning
a session url.

refs CNVS-13322
fixes CNVS-13445

Test plan:
  * enable Crocodoc
  * make multiple submissions to the assignment (with the same student)
  * make sure you preview all submissions in the speedgrader (with
    Crocodoc)
  * disable Canvadocs
  * make sure the student can preview the submission attachments in his
    files page (in Crocodoc)

  * also make sure that canvadocs still works (just one preview is fine)

Change-Id: Icbea4b8986039d1405300a09f54a878ba1cc288f
Reviewed-on: https://gerrit.instructure.com/35931
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>

Conflicts:
	app/controllers/files_controller.rb
make canvadocs work in public courses

fixes CNVS-13805

Test plan:
  * make a public course
  * upload a canvadocable file
  * visit the course in a new browser (without logging in)
  * you should be able to preview the file

Change-Id: I4ef0b0ba656f2aad734736178b09ad9a729ae3c9
Reviewed-on: https://gerrit.instructure.com/37245
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
remove property name collision on js strings

fixes CNVS-14258, CNVS-14237, CNVS-13700

Change-Id: I6d298c2729c302ad1aac245a9a0cdde5d3835e98
Reviewed-on: https://gerrit.instructure.com/37776
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
fix migrations for mysql

fixes CNVS-13306
fixes gh-453

MySQL refuses to change columns that have a foreign key on them

Test plan
- Run the polling migrations on MySQL
- They should migrate the database correctly.

Change-Id: Ib781c5237c0973b254043096e536ac094dd809cf
Reviewed-on: https://gerrit.instructure.com/35511
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>
treesame commit of origin/stable/2014-07-12

Treesame-Commit-Id: eb9e8360d4c738d8d6fc16a745768a4d9853a530