fix downloading of student analysis CSV

test plan:
  - Have some students take a quiz
  - You should be able to download the quiz statistics CSVs as a teacher.

refs CNVS-12023

Change-Id: Iab958dd26ed15cce48347f8a076d6a311f9595aa
Reviewed-on: https://gerrit.instructure.com/32515
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
fix draft state module manipulation for rails3

test plan (rails3; draft state enabled):
 - on the modules page of a course
 * create a new module
 * add items to the module
 * edit the module
 * edit the items in the module
 * refresh the page, all modifications should remain

fixes CNVS-11924

Change-Id: I273d38880d5d1736ce667895ef26a29df546d539
Reviewed-on: https://gerrit.instructure.com/32137
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
spec: selenium 2.40 firefox 2.70 upgrades

Change-Id: I1b07116abbc86fe72cc2bda571fc07c71c016d0c
Reviewed-on: https://gerrit.instructure.com/32573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
Revert "spec: selenium 2.40 firefox 2.70 upgrades"

This reverts commit de462a82d2682f8d70cce4f54f72e88523c9e461.

Change-Id: I70f6ae29a4e8955b84d2be03672b3a7c9c1a6bd3
Reviewed-on: https://gerrit.instructure.com/32575
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
spec: http timeout decrease selenium

Change-Id: I821b60f59f4c08789b14c6f975086655ccd20529
Reviewed-on: https://gerrit.instructure.com/32577
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
Added instructions for alternate means to pin a discussion .

Fixes CNVS-11971

Test plan:
* Visit a discussions listing page.
* Unpin all discussions, if any.
* Verify that the instructions on how to pin a discussion include information
  on how to do so without requiring the use of a mouse.
* Verify that the instructions are clear and correct.

Change-Id: Ic330b21cbbc4645c0c44bc5cc41442a8519170b3
Reviewed-on: https://gerrit.instructure.com/32391
Product-Review: Jon Willesen <jonw@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Dana Danger <dana@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
api to create grading standard

refs: PS-923, PS-924

**test plan
1. create account and course level grading
standards via api, see docs for example
2. associate course and account level
grading scheme to course via course
update api, see docs
3. associate course and account level grading
scheme to assignment via assignment update api,
see docs

Change-Id: Ib4d7606e23115376f111f3aabbbd8c51e102fe1b
Reviewed-on: https://gerrit.instructure.com/30601
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
fix hashwithindifferentaccess deserialization in rails 2

fixes #CNVS-12075

Change-Id: I836be953ae927e3e575562e118634db84fb8167f
Reviewed-on: https://gerrit.instructure.com/32555
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Remove duplicate code for finding uniq array elements.

Change-Id: Ib574f903a52b27d0075029f2afb7845c58d61dba
fixes: CNVS-11932
Reviewed-on: https://gerrit.instructure.com/32153
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
restore quiz submission loading in quiz serializer

This reverts changes from 8018ce8374e9364170e639952909cd9fc588287a.

Instead of using `present?` on has_many associations for
Canvas::APISerializer, use `empty?` so that we don't overload the
database or app memory with large queries for big data sets.

Test Plan:
  - Create a quiz.
  - In your console, run:
    quiz = Quizzes::Quiz.find(your_quiz_id)
    10_000.times { quiz.quiz_submissions.create! }
  - Get a cup or two of coffee and wait for that to finish.
  - You should be able to load the quiz show page for that quiz.
  - Making an API for that request as the teacher should not time out.

closes CNVS-12098

Change-Id: Ib14bc30583f521bd91a3de115218a33fb3bd73c4
Reviewed-on: https://gerrit.instructure.com/32553
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
fix path to RAILS_LTS file in Gemfile

fixes CNVS-12130

test plan:
- have a RAILS_LTS file in a vendor/plugin folder
- it should be found by bundler

Change-Id: I9edeb6b24246b7bf5373367c168db77a14a35453
Reviewed-on: https://gerrit.instructure.com/32596
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
'Move To' string translation

fixes CNVS-12090

test plan:
 - the following strings should be displayed as 'Move To'
   - assignments.assignment_group_list_item.move
   - assignments.assignment_list_item.move
 - with draft state on
 - on the assignments index page
 - it should still display 'Move To...' for assignments and AGs

Change-Id: I0fa5408aebc2f0685a08b3d8e4f33f9d818ed549
Reviewed-on: https://gerrit.instructure.com/32521
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
fix rce equation editor close bug

closes CNVS-4460

test-plan:
  - open the RCE somewhere
  - type in some text
  - hit the "math equation" button
  - close the equation box without inserting anything
  - type in something else
  - save page/assignment/whatever
  - verify the content typed after aborting the math editor shows up

Change-Id: Ibb3cf0704147ba23d235156619d17ada03707595
Reviewed-on: https://gerrit.instructure.com/32569
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
extract JSONToken gem

fixes: CNVS-11785

Test Plan:
Automated tests will check most of it.  Make sure Canvas is not broken.

Change-Id: I797a71b492a043fc7d14b88457842bbde4295bb2
Reviewed-on: https://gerrit.instructure.com/31719
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Crocodoc: handle nil response from upload

Test plan:
  submit a Crocodocable assignment.  it should upload successfully (if
  Crocodoc cooperates)

Change-Id: I16f99526bb4a32467a584cc2ab6b6b824e13b358
Reviewed-on: https://gerrit.instructure.com/32523
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
bugfix for course progress api (fixes CNVS-12106)

Issue:
  * When creating a module, then a new assignment under that module,
    the ContextModuleProgression.requirements_met field comes back
    as nil, causing course_progress_json to bomb. The previous code
    assumed an array would always be returned, but this is not the case.

Solution:
  * Cast requirements_met to an array.
    + nil.to_a -> []
    + [1].to_a -> [1]

Test plan:
  * Test against Gallery course progress commit (g/32571) with some new modules
    and blank assignments created through the module interface.

Change-Id: Ie666fcc0031009b5ff32ad151659cb2818bf7b6e
Reviewed-on: https://gerrit.instructure.com/32570
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
spec: selenium 18n spec fix

Change-Id: Ib47b2099afc1a54d04b9746a7ee482d1d2b47424
Reviewed-on: https://gerrit.instructure.com/32574
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
respect "leave different" option on rubric association

fixes CNVS-11195

Test plan:
  * make an assignment with 10 points possible
  * add a rubric with 20 points possible
  * choose "leave different"
  * refresh the page
  * the assignment should still have 10 points possible

Change-Id: I0e606a946ab0c67de5878eddf949f30ad09af677
Reviewed-on: https://gerrit.instructure.com/32486
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
Revert "Revert "spec: selenium 2.40 firefox 2.70 upgrades""

This reverts commit 4498b890bdf50b6702b8fc54eadd0c7573638298.

Change-Id: I73865e62e6953f78fa583427a99855719e300880
Reviewed-on: https://gerrit.instructure.com/32578
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
add pt-BR translation

closes CNVS-12126

test plan
 - change your user settings to Português do Brasil
   and verify that the new translations appear
   properly

Change-Id: I3be754708aaa53eb5af09a600489f8eb341527d5
Reviewed-on: https://gerrit.instructure.com/32619
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>