fix dropdown menu css so second menu item works correctly

Test plan:
  - The second dropdown menu on the ember quizzes show page should work
    smoothly instead of skipping focus over the second item.

fixes CNVS-13050

Change-Id: I7c7645f09571f8664cc5c09fe7ea805d46799f1c
Reviewed-on: https://gerrit.instructure.com/34909
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
scope account_user deletion to the calling user's account

test plan:
 1. have two root accounts, with no trust links between them,
    each with an account admin who is not a site admin
 2. as a site admin, go to Account 1's settings page,
    Admins tab, and inspect the element of the (X) icon that
    would delete the user. you will see a URL like this:
    https://<site>/accounts/1/account_users/1234
 3. as the admin of Account 2, go to Account 2's settings page
    and inspect the element of the (X) icon that would remove
    an admin (any admin, doesn't matter which).
    it should look like
      https://<site>/accounts/2/account_users/5678
 4. edit the page to change the last number in the URL found
    in step 3, to that found in step 2, then click the X
      e.g., https://<site>/accounts/2/account_users/1234
 5. you should get a page error. the admin from Account 2
    should not be able to demote the admin from Account 1

Note that an actual attacker probably doesn't know the
AccountUser ID of anyone in particular, but they could just
enumerate starting at 1 and ruin the day for a whole lot of
people (including us).

fixes CNVS-13032

Change-Id: If5436b10ec986f1b17635cb8cae46c951cb9ff83
Reviewed-on: https://gerrit.instructure.com/34859
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
left-align quiz show dropdown items - order bug

links within the ember quiz show page should be left aligned. items in
the menu should be keyboard navigable and maintain order.

closes CNVS-13053

test plan:
  - enable ember quizzes
  - as instructor visit the quiz show page for a quiz
  - click on cog in top right corner
    - verify that items are left aligned within the dropdown
    - use keyboard arrows to move up and down the list
      - verify that selected item moves linearly through list

Change-Id: I52d5af3a7b4ae8a0da95425108fe1b83c5dd1831
Reviewed-on: https://gerrit.instructure.com/34915
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
only export active learning outcomes and groups

test plan:
* create a course with multiple learning outcomes
* delete one of them
* copy the course
* the deleted outcome should not re-appear in the copy

fixes #CNVS-4358

Change-Id: I2ec16a250d2bcaf70ab0e06d5711e18a2839c415
Reviewed-on: https://gerrit.instructure.com/34798
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>
optimize User#find_pseudonym_for_account

refs #CNVS-12929

Change-Id: Id3528896d9e8a6a0e098478dc30742a9b0a43c05
Reviewed-on: https://gerrit.instructure.com/34692
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Ember Quiz Stats - Essay Questions

Essay stats include a donut chart of the ratio of students who received
full-credit, as well as an area graph showing the score distribution.

Also, the serializer now prepares the data in a way for ED to properly
populate the questionStatistics association with quizStatistics, so we
got rid of the hack in the route's #afterModel hook, and exterminated
the bug that caused the question stats not to be updated when the quiz
changes (e.g, via the URL).

Closes CNVS-12466, CNVS-13009, CNVS-13021

TEST PLAN
---- ----

  - create a quiz with essay questions
  - take the quiz by a number of students
  - before grading, take a look at the stats page, make sure nothing
    funny happens
  - grade the responses with different scores
  - revisit the page, make sure the graphs are rendered appropriately
  - clicking the View in SpeedGrader link should open a new tab with the
    SpeedGrader for the quiz
  - hover over the circles and verify that you get tooltips similar to
    those for MChoice and T/F questions
  - verify that sorting by DI/Position is again functioning correctly

Change-Id: I3ab6818d86632720c6da2c37b2126b4abe63cefa
Reviewed-on: https://gerrit.instructure.com/33991
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
include hostname and pid in error reports

to make it easier to go from error reports to logs

Change-Id: I38015db9dd616460f84d9792db6c2bbbfbbde330
Reviewed-on: https://gerrit.instructure.com/34965
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>
remove params[:id] from ProfileController#communication

because it is an information leak and I can't imagine any
legitimate purpose for it

fixes CNVS-13057

test plan:
- you should not be able to retrieve other users' notification
  preferences by appending ?id=X to /profile/communication

Change-Id: I744792020d88ce15071a6332571ca1e3289885ed
Reviewed-on: https://gerrit.instructure.com/34939
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
discussion rubrics show points when used for grading

fixes CNVS-5378

test plan:
  - make a graded discussion
  - go to its show page
  - click add rubric in settings
  - use the rubric for grading
  - with the same # of points as the assignment
    - no warning should pop up
  - with a different number of point
    - a warning should pop up
    - the point value should be accurate
    - this should work multiple times without reloading
      the page
  - assignments rubrics work as usual

Change-Id: Iee12859b73a118b5339573ae26de9c589d41feb4
Reviewed-on: https://gerrit.instructure.com/33932
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
assigments page keyboard menu working

fixes CNVS-12426

test plan:
  - with draft state on go to assignments page
  - hit ","
  - the shortcuts menu should pop open

Change-Id: I69b0e477fb638e1127cdef188c0bbcfcb6648ecb
Reviewed-on: https://gerrit.instructure.com/34824
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
correctly show completion icons on peer review listings

Because of concerns with a potential race condition on using just the 
incomplete peer review count we've also added the total count of
assigned reviews to the cache key. These two additions still allow us
to take advantage of caching yielding a 90% performance improvement 
against a hot cache locally. These numbers may not translate perfectly
to production given that this page may have frequent cache misses. This
is something we should probably take a look at in the logs once this is
in beta/production.

fixes CNVS-7523

Test Plan:
- As an instructor build a class with at least 2 students
- Add an assignment to the class with peer review enabled
- Assign peer reviewers manually
  - These should start marked as incomplete with a yellow icon
- As the first student navigate to the assignment and submit it
- As the second student navigate to the assignment
  - In the sidebar this student should see that they have an incomplete
    review, indicated by the yellow icon
- Complete the review and view the assignment again
  - The review should indicate that it is complete with a green
    checkmark
- As the teacher view the peer assessments page
  - The review you previously completed should show as completed using
    the same green checkmark.

Change-Id: I8b71fd8f25c71b8031ab74b57d280c98add2c14e
Reviewed-on: https://gerrit.instructure.com/34420
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
send delayed jobs stats to statsd

closes CNVS-12739

log timing for pops, time spent in queue, time to perform job,
sliced by tag (where applicable), shard, and job shard.

test plan:
 * configure statsd.yml to go to 127.0.0.1 port 7856
 * nc -lu 127.0.0.1 7856
 * run jobs
 * you should see lots of job timings sent to netcat

Change-Id: I60a4b6b10d30edd96011e8e8bc8aa6104dfc6daa
Reviewed-on: https://gerrit.instructure.com/34724
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>
improve sis user importer spec

 * use timecop instead of sleeps
 * use stubs instead of manually adding and deleting callbacks to the class

Change-Id: I72f859f9a387cec88a77edfdf2b4b926852945dc
Reviewed-on: https://gerrit.instructure.com/34963
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix issue with flash message close button not working

the preventDefault function expects a function to be passed in to work correctly

fixes CNVS-12893

test plan:
  - as a teacher
    - create a quiz
    - turn on fabulous quizzes
    - view a quiz
    - click the menu and 'show student quiz results'
    - the flash message should appear
    - click on the x icon on the message
    - the message should close, and you should remain on the same page

  - try other variations that bring up this type of message at the top
  - clicking the close on them should work as well

Change-Id: Ia7e13e01c031d09b08ef6f6bdff9c0cf6f375396
Reviewed-on: https://gerrit.instructure.com/34999
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Upgrade MediaElementJS to 2.14.12

This commit just updates the vendor mediaElementJS code
so that we can see clearly what changed from upgrading
and what our changes are (yes, sadly we have to make
modifications to mediaelement-and-player.js's source)

so don't focus on QAing this in isolation. the actual changes
come in the commit after this.

refs: #CNVS-12293

Change-Id: I71f18f8dc8f30acd5cbb0730b1a97065e2aed2e3
Reviewed-on: https://gerrit.instructure.com/34015
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
Don't try to link to mp3 flavors from kaltura

refs: CNVS-12293
refs: CNVS-12998

This commit needs to go out with changeid:
I5b77f58133fb9081909771d50bb8f0a91db23d63
because it fixes audio playback in firefox.

it is it's own commit so that if we fix our mp3s
being served from kaltura (this ticket: CNVS-12998)
, we can just revert this one commit.

long story:
all our browsers except firefox will allow
<audio><source type="video/mp4" src="blah.mp4"></audio>
...and play back the audio inside the mp4 container

but firefox won't, so it was falling back to the
last of the options returned by /media_objects/<id>/info;
an 'audio/mp3' url. but the thing that url points to
right now in production
(e.g.: http://www.instructuremedia.com/p/100/sp/10000/download/entry_id/0_4b4pgy5p/flavor/0_092j8kek/ks/NWRiYzk5Njk2MTRjZTlhYWEwODBkYjVlOWQ2MTc2MzZmMGNhMDc0MHwxMDA7MTAwOzEzOTk2NzM4NjI7MDsxMzk5NTg3NDYyLjkwNzg7O2Rvd25sb2FkOjBfNGI0cGd5NXA7)
just returns text/html that says:
"This URL is expired"

Change-Id: Ie9bc2551b839247042fc7f3261f82845331e04fc
Reviewed-on: https://gerrit.instructure.com/34748
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
user merge supports versions

closes CNVS-12967

test plan (backend):
- create some submissions, quiz submissions, rubric assessments, and wiki pages
  as a user
- merge that user into another user
- the version objects associated with those objects should have an updated user
  id

test plan (user facing):
- upload multiple submissions to a file assignment
- merge the student with another student
- as a teacher, go to the students submission in SpeedGrader
- attempt to download the submission, it should work

Change-Id: I96caf214e5bb43eeb8251470c71f708125cfdf41
Reviewed-on: https://gerrit.instructure.com/34887
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
support adding custom meta tags

refs CNVS-12627

test plan:
- load any page, it should render

Change-Id: I66bca1e87296edfd841992d2262b9d73dd263747
Reviewed-on: https://gerrit.instructure.com/34466
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Updated pl translation
Updated pt translation