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>
profile pic config: kill "avatar" copy

fixes CNVS-12070

test plan:
  * enable profiles and user avatars
  * open user settings
  * edit profile picture
  * verify that it doesn't say "avatar" anywhere

ticket requirements:
  * Select Avatar header text should say Select Profile Picture.
  * Select Image button should say Upload.
  * When the profile picture is saved to the profile pictures folder, the default filename should not be avatar. Change it to profile.jpg.
  * In the Upload a Picture tab, the select a photo link should say select a picture. Once the user has chosen a photo, the crop text should be updated so the button says Upload, not Select Image.
  * In the Take a Picture tab, the Take Snapshot button should say Take Picture.

Change-Id: I8e0ff9712faabb3e0a398332d84fa1981d1b4d2d
Reviewed-on: https://gerrit.instructure.com/32508
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
profile pic configuration: release camera

fixes CNVS-12086

test plan:
  * enable profiles and avatars
  * open user settings
  * edit profile picture
  * select "take a picture"
  * allow access to your camera
  * leave "take a picture"
  * verify that your camera is no longer in use

Change-Id: I675cb7b71869d55d529f85fce34c028a396d0893
Reviewed-on: https://gerrit.instructure.com/32511
Reviewed-by: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
don't allow students to have view reports permission

fixes CNVS-12085

test plan
 - before updating set the "View usage reports
   for the course" permission to enabled
 - /accounts/84968/permissions
 - should not be able to enable "View usage reports
   for the course" permission for students

Change-Id: I60e817641436230564b0a50a8a7d46e29cb355a6
Reviewed-on: https://gerrit.instructure.com/32509
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Rob Orton <rob@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>
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>
AppointmentGroup.context returns first AppointmentGroupContext.context

accessor was hiding a method. looks like we want to use the method
because of multi-context appointment groups

test plan
- from the console, ensure that a new appointment group returns
 non-nil from .context

Change-Id: I36ef6bc073b4e1d0bcf02277b1e4fdec43630382
Reviewed-on: https://gerrit.instructure.com/32254
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
Caused discussion settings headings to be recognized as such by screen readers.

Fixes CNVS-6642

Test plan:
* With a screen reader, visit the discussions list page.
* Open the discussions' settings dialog.
* Verify that the "My Settings" and "Student Settings" headings are read as
  headings by the screen reader.

Change-Id: Iae8723452d5d8a5dd5db6e2548673a9eaa6a9fe9
Reviewed-on: https://gerrit.instructure.com/32396
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
re-add indentation semantics to Gemfile

during a previous commit
(SHA 10e7b5b003bea9aea3286b9170f5e04b8a9e3735)
we removed indentation of gems, but this indentation
had semantic significance for us: any gem which was
not required by canvas but was required by another
gem required by canvas was indented. This allowed us
to clarify that canvas didn't actually use the gems
while still locking into specific versions of each

Also added a comment explaining this to Gemfile

Change-Id: I0f476e1bed6156f2f5969e54d56d44ded5442a0f
Reviewed-on: https://gerrit.instructure.com/32588
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
fix closing dd tag on ember quizzes show page

Change-Id: Icb00257a5ca2e995f7c002bf55368e4c541d9875
Reviewed-on: https://gerrit.instructure.com/32687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
disallow nulls on data_exports table

Change-Id: I69aae29886ddf98fcdee3ce21ed3756aae078920
Reviewed-on: https://gerrit.instructure.com/32702
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>