fix file uploads for quizzes, remove unused code

fixes a regression in a recent change to how/when we set the authenticity
token for file uploads. since it will now always be set appropriately in
the upload params, we don't need to do anything to pass it along in js/
coffeescript

test plan:
1. using local files uploads
  1. make a file upload quiz
  2. as the student, take the quiz. you should be able to upload the file
  3. as the teacher and student, you should be able to download the file
2. repeat the steps above for s3 uploads
3. specs should also all pass

Change-Id: I80c607289d06b904e2b12a2ae1749de2b4006dc6
Reviewed-on: https://gerrit.instructure.com/21586
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
add Dutch and Korean crowd-sourced language translations

fixes CNVS-6233

Test Plan:
  - Check that Dutch (nl) and Korean (ko) are language options
  - Canvas should be in Dutch or Korean
  - the language titles should show "crowd-sourced" in their names
    to distinguish from other sponsored languages

Change-Id: I338f92b418f354f290e3b5db4ef029b61b0c28cc
Reviewed-on: https://gerrit.instructure.com/21582
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
preserve links to other content in quizzes on course copy

test plan:
* create a quiz that includes a link to other content
in the course, such as an assignment or a wiki page
* copy the course
* the links should be copied correctly

fixes #CNVS-2303

Change-Id: Ie5eb41c9193bad4d3786d2cd312b31a3be6c4ddf
Reviewed-on: https://gerrit.instructure.com/21600
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>
Revert "add metadata to kaltura file upload"

This reverts commit 7a89817a25a451319062e4d29588d82dddbf0d97

Change-Id: Iacd4759bed8e21763538b8c3b98a4f90e79ae149
Reviewed-on: https://gerrit.instructure.com/21684
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
only submit one group assignment to turnitin

Fixes PS-356

test plan
* turnitin, non gorup assignments should still submit to turnitin as before
* turnitin, group assignments should only send the origianl submitters submission to turnitin

Change-Id: I29e90e9d42be8b57a9bc4755a4db9b0ffd9e0487
Reviewed-on: https://gerrit.instructure.com/21219
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
speedgrader nav links

FIXES CNVS-5990
FIXES CNVS-5991

This adds the quiz question links to the
speed grader form and handles the
scrolling and clicking to make it function
usefully.  This also persists the 
active question between students

I also refactored a bit of the quiz_history file.

TEST PLAN:

1) Login as a teacher.
2) grade a quiz with speed grader.
3) as you scroll down through questions,
the nav numbers at the top should highlight
as you go over the relevant questions.
4) if you click a number in the nav, it
should pleasantly scroll to the question you want.
5) no speed grader functionality should be broken.

Change-Id: I0b0b6e60138f08ce4bfec45a5a1a1fe10f4d1847
Reviewed-on: https://gerrit.instructure.com/21024
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ethan Vizitei <ethan@12spokes.com>
don't use delayed validation for FKs if already in a transaction

refs CNVS-6202

Change-Id: I85b0c2d925d2d2d5b8707fe1640a22cd424bcbf4
Reviewed-on: https://gerrit.instructure.com/21268
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>
don't require full rails+canvas env for rake i18n:generate_js

The full env isn't available on our release packaging servers

Change-Id: I5b9b6c878d061ae4d2ae75739a46c5bc22e0d639
Reviewed-on: https://gerrit.instructure.com/21675
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
add foreign keys part 3

refs CNVS-6202

Change-Id: I27d4db67ae996015d79f800b28299a0c048a3f0a
Reviewed-on: https://gerrit.instructure.com/11532
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
add lis_outcome_service_url to assignment launches for teachers

per the LTI spec the lis_outcome_service_url should always
be sent, and we were only sending it for students.

Test Plan:
 * Do an LTI assignment launch as a teacher or admin
 * Make sure the lis_outcome_service_url value is sent
 * Also check that the custom_canvas_assignment_title/points_possible are sent

closes CNVS-6392

Change-Id: If69875884029e5cba9fb329f09c21d2220fcdfd0
Reviewed-on: https://gerrit.instructure.com/21652
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
fix sort/click in FF on discussions index page.

test plan:
  * using firefox, navigate to discussions index page as
    a teacher or admin;
  * unless at least two topics are already pinned, drag
    two topics into the pinned area;
  * attempt to reorder the pinned topics, and verify that
    they reorder properly and that the sort does not
    navigate you into the sorted topic's show page.

Change-Id: I10cc1af83f9b12b6fc44361b8ec661c58a2b09d8
Reviewed-on: https://gerrit.instructure.com/21699
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
show media preview for media files in file show view

test plan:
* upload a media file (video/audio) to a course
* when either:
 * linking the file to a module item and
 clicking on the item link
 * or, directly going to the file show page
 (e.g. '/courses/:course_id/files/:attachment_id')
* confirm that the media preview appears (rather
 than a failed document preview), just as on
 the main 'Files' page

fixes #CNVS-2529

Change-Id: Ic8701c28a7ea0382de84e36fc363c0cff8cc2ac6
Reviewed-on: https://gerrit.instructure.com/21616
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>
unflag the new quiz question type closes CNVS-6360

Change-Id: I9d02e3d937bdfbd73e7dc6553f9f3f53f2607cb1
Reviewed-on: https://gerrit.instructure.com/21579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
prevent incompatible character encodings errors

refs #CNVS-5828

Change-Id: Id0a165363de05f000eee956bf976ffcff70adfc7
Reviewed-on: https://gerrit.instructure.com/21674
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
fully remove style tags in html sanitizer

test plan:
* test the sanitizer through the api by
creating or updating an object with html content
(such as a wiki page body attribute)

* the following html:
  <p><style>should ignore this text</style></p>

* should be sanitized to:
  <p></p>

fixes #CNVS-5828

Change-Id: I735f031eafdeeb8d7ae05fd977327fb3cc7e9251
Reviewed-on: https://gerrit.instructure.com/21689
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>
do not allow assignment groups with frozen assignments to be deleted

This restores previous behavior for the Assignment Property Freezer
plugin:

Teacher are not allowed to delete a an assignment group in a copied
course if an assignment in that group has been "frozen" when it was
copied.

The previous behavior allowed teachers to delete a group if and only if the
assignment group id was not frozen. Now, if any properties are allowed
through the Assignment Freezer Plugin, the teacher may not delete the
assignment.

test plan:
  - As an administrator, enable the Assignment Property Freezer by going
    to Site Admin -> Plugins (on the left). Enable a few properties such
    as "description" and hit "Apply".
  - As a teacher, create a new assignment group. Create an assignment
    within that assignment group. Click "More Options" or go to the
    assignment's edit page. Under "More Options" on the edit page, check
    the box that says "Lock Properties When Copied".
  - As an administrator, copy the course by going to the Course's
    "Settings" tab and clicking "Copy This Course" on the right hand
    side. Follow the wizard, then enroll a teacher by using the "People"
    tab on the left in the new course.
  - As a teacher (very important you are NOT an administrator), go to
    the assignments index page (/courses/new_course_id/assignments), and
    you should see the new assignment group and assignment you set up.
    Hover over the assignment group's box and click the "x" icon to
    start deleting the assignment group. When you click "Delete Group"
    as the teacher, you should get a flash error message telling you you
    cannot delete a locked assignment.

fixes CNVS-6224

Change-Id: I76c72be9941b32a13303f166c48e2e7a021d379f
Reviewed-on: https://gerrit.instructure.com/21634
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
draft state on quiz_show page

fixes CNVS-5675

This adds the "publish" button to the
quiz show page and includes an ajax callback
to talk to the server about changing the publish
state of the quiz.

TEST PLAN:
1) login as an instructor
2) navigate to the show page for any quiz
3) use the "publish" button to toggle the
state of the quiz to be published and unpublished
4) if you are on a quiz with student submissions
already in, the button should do nothing, and you
should get a rollover showing you the reason
why you can't click on it.

Change-Id: I45543ce9e62a1a4882d9a6b00a559ddd6eda9897
Reviewed-on: https://gerrit.instructure.com/21308
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ethan Vizitei <ethan@12spokes.com>
update rake

Change-Id: Ifc75eeee31fceee17e5c7f944b36dcff147d3424
Reviewed-on: https://gerrit.instructure.com/21740
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>
fix gradebooks query

test plan:
 * view grades as a student, specifying new
   submissions
 * it should work

Change-Id: I25ad52647099ec2591a6bc834b4b1178da53f474
Reviewed-on: https://gerrit.instructure.com/21747
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
change user find approach for sharding concern

refs CNVS-6376

testing steps:
* discussion entry api call should work
  as expected (i.e. no behavior change,
  regression tests)

Change-Id: I5055b9337e805a586e8c90b1be27516777341951
Reviewed-on: https://gerrit.instructure.com/21665
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Mark Ericksen <marke@instructure.com>