refactor + fix message students who dialog for quiz show

test plan:
  - as a teacher make a new quiz and publish it.
  - make sure one or two students in the course have taken the quiz
  - in the cog menu on the quiz show page
    (/courses/:course_id/quizzes/:quiz_id), click on "Message Students
    Who..."
  - You should see students who have taken the quiz in the dialog when
    you select "Have taken the quiz". You should see students who
    haven't taken the quiz when you select "Have NOT taken the quiz"
  - Try submitting the message with a blank message. You should get a
    warning box. Now, make a message to each group of students and save
    the message. Check that each student received the message.
  - Now make the rest of the students finish the quiz. Open the dialog
    again and fill out a message in the textbox. Select "students who
    have NOT taken the quiz". It should be empty. Try sending the
    message by clicking "Send Message". You should immediately get an
    error that the group of students you selected is empty and you
    should choose a different group of students.

fixes CNVS-4743

Change-Id: I2199bd7a18089726251bd0244bc618446db26d07
Reviewed-on: https://gerrit.instructure.com/18869
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
show quiz results at top of quiz show page

This commit also moves the quiz results (who has/hasn't taken a quiz or
survey) to a table with the styleguide in place.

test plan:
  - As a teacher, create a quiz with an essay question.
  - While the quiz is stil unpublished, go to the quiz show page. it
    should look like it did before this patchset (e.g. dates visible,
    you can still find the edit/manage buttons, etc)
  - have some students in the course take the quiz, but make sure some
    students in the course haven't taken the quiz.
  - Click "Show Student Quiz Results" from the cog menu.
  - The list should look good, and display students under Taken/Haven't
    Taken when the list loads asynchronously.
  - Try different combinations of have/haven't taken including all taken and
    non taken
  - Try with an anonymous survey as well.

fixes CNVS-4381

Change-Id: Ida743125abaf836da5038fc7bc5f376597f47534
Reviewed-on: https://gerrit.instructure.com/18454
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
make due date change stick when updating assignment overrides through UI

test plan:
  - create an assignment with a few different due dates and save the
    assignment.
  - come back to the assignment edit page and change the dates for one
    of the sections (but not the section itself, just the dates).
  - The new dates should be showing for the section on the assignment's
    show page, and should also be showing on when you go back to edit
    the assignment.

fixes CNVS-4847

Change-Id: Ib1fb629014f7e614c53d0c11076822be6daf23be
Reviewed-on: https://gerrit.instructure.com/19216
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
don't disallow deleting a section due to StudentViewEnrollments

fixes CNVS-2623

test plan:
 - create a course
 - create a section
 - use student view
 - delete the empty section
 - it should not give you a snarky message about you can't
   delete a section with enrollments

Change-Id: Ieabf6dfa6c25eed7f637d529cd755490bde5635a
Reviewed-on: https://gerrit.instructure.com/19120
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
remove unnecessary lib/sis requires

We were inconsistent about whether to require
'lib/sis/csv/base_importer' or 'sis/csv/base_importer', causing warnings
in the logs about already initialized constants (not to mention
evaluating the same file twice, though that seems to be ok in this
case).

rather than fix the requires to be consistent, i've just removed them,
as rails autoloading works for all but the sis/common require (doesn't
work for sis/common because that defines things other than a SIS::Common
module)

test plan: doing SIS imports should still work as normal, and you
shouldn't see any warnings in the logs about already defined constant
PARSE_ARGS

Change-Id: I787ee7486d967201bfb360bc95e61e48b385c449
Reviewed-on: https://gerrit.instructure.com/19190
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
spec: calendar2 fixes for clicking calendar entry.

Change-Id: I88145b7dadf8731b08a10be7a1c7c3cec561a9eb
Reviewed-on: https://gerrit.instructure.com/19279
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>
remove :include => { :exclude } support in favor of except(:includes)

refs CNVS-4705

Change-Id: I579c25d536a5154be3978398ef8b938b0876ca68
Reviewed-on: https://gerrit.instructure.com/18683
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
multiple due date summary tooltip

Notes:
* On index pages, assignments and quizzes with multiple due dates
  now show a summary of due dates in a tooltip when hovering over
  "Multiple Due Dates"
* The tooltip shows a max of 10 dates, and if there are more, it
  ends with "and # more..." showing how many dates are not shown
* The ticket requested that the "and # more..." links to the
  assignment page, but that would be hard to click since leaving
  the anchor link makes the hover disappear; instead the actual
  "Multiple Due Dates" anchor link will link to the show page
* Tooltip appears for teachers on the following pages:
  - Global assignments page
  - Course assignments page
  - Course quizzes page
  - Course modules page

Test Plan:
* Create assignments and quizzes with multiple due dates
* Navigate to the pages above and verify that there are tooltips for
  items with multiple due dates
* Verify that the section names and dates are correct for each item
* Verify that when there are more than 10 due dates, the tooltip only
  shows 10 dates and ends with "and x more..." with the number of
  dates not shown

fixes CNVS-2646

Change-Id: I96d12b25d6690393c942c90b8e121da6e20191e0
Reviewed-on: https://gerrit.instructure.com/18769
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
switch position of save profile and cancel buttons when editing user profile

Test plan:

Go to a users Profile page > Edit Profile >  Save Profile button is now on right

Change-Id: I82b95d1fd3783de6b29b9fbbfecfb43029366d4d
Reviewed-on: https://gerrit.instructure.com/18897
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
refactor disableWhileLoadings that don't resolve

make it a little easier to have a form spinner that doesn't go away on
success (e.g. if you are going to change location.href or something)

test plan:
1. /register should still work
2. the self enrollment form should still work

Change-Id: I0040a64ecadea2bae2899364ef820df3d2bc62c0
Reviewed-on: https://gerrit.instructure.com/19270
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
errorFormatter support for formSubmit

just a refactor to make the password policy commit more DRY

test plan:
1. ensure that /register works and error messages show up appropriately

Change-Id: I0eea8c4107fa9ae69d45941f45edd5a9621ee3c8
Reviewed-on: https://gerrit.instructure.com/19271
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
upgrade nokogiri and libxml-ruby

delayed job workers segfault often when using libxml2 and ruby 1.9

these issues are not present when using version 2.9.0 of libxml2,
however, newer versions of nokogiri and libxml-ruby are required in
order to compile against the newer libxml2

fixes #CNVS-4669

Change-Id: I5100ba6e0f4779da49bce471cff03cb83b3c06b2
Reviewed-on: https://gerrit.instructure.com/18658
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
switch mathjax cdn to https

test plan:
* make sure that the advanced math editor works
when using https

fixes #CNVS-5061

Change-Id: I99e173574897498086b000b505262bb67fa2135a
Reviewed-on: https://gerrit.instructure.com/19299
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
work around a lockdown browser rendering issue

lockdown browser has an issue when the base explorer install is IE9 where the
first page rendered after a popup window is opened does not render correctly.
since it only happens in the first page after the popup is created, we are
working around it for now by loading a dummy page as the first page which
automatically redirects to the actual quiz page.

fixes CNVS-3881
refs CNVS-4853

test plan
- make sure taking quizzes works fine with LDB
- in a system with LDB and a base IE9 installed
- start taking a quiz, it should render correctly
- try with/without oqaat, and other quiz options

Change-Id: I5bf51cce9d7722e62941dd8db0d40163ccc032bd
Reviewed-on: https://gerrit.instructure.com/19272
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
bootstrap: make 'flag quiz question' button visible

fixes CNVS-5028

test plan:
- Edit a Quiz and create a new Matching question. Make sure students
  can see the correct answers by enabling that option in the quiz.
- Resize the window, horizontally, as small as you can
- Ensure that the text fields don't appear as scrollable
  horizontally
- start taking a quiz. make sure you get at least one question wrong.
- the button to flag questions should be available
- after you take the quiz, make sure the red/green/arrows that show up
  for the submission on results on the left look fine.

Change-Id: I9367ef6ab5b40d48d9d640a3c8f4c0c7c628e12d
Reviewed-on: https://gerrit.instructure.com/19191
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
plumb media comment types to grade summary page

fixes CNVS-1839

test plan:
 - as a student, submit an assignment
 - as a teacher, record video and audio comments for the submission
   in speedgrader
 - (wait for kaltura to process the media comments...)
 - as the student, go to the grades page and click the "full details"
   button
 - make sure that the video and audio comments both play properly

Change-Id: I2ab093fde1a2ceec292f149cd535739eca3b1880
Reviewed-on: https://gerrit.instructure.com/19070
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
spec: remove shared specs refactor

Change-Id: I0810243e6b6b9bca992eb58d071e8c6d5fbeaee5
Reviewed-on: https://gerrit.instructure.com/19175
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>
missed arel-ify datafixup

refs CNVS-4506

Change-Id: I7bf4b823e5b9ef2133d385feb5759347e0863b5f
Reviewed-on: https://gerrit.instructure.com/19233
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>
show student progression on module page for large_roster

The module progressions for individual users were removed
for courses with large_roster set. Only the teacher's call
that loads all the progressions for the whole class should
be blocked while still allowing individual's info to load.

Test Plan:
 * on a course with large roster set:
 * create a module with a completion requirement
 * when a student fulfills that requirement, the module page
   should show the green checkmark indicating it is done

closes 	CNVS-5055

Change-Id: Id493459a77c32a7d2a99b19376a822f058896912
Reviewed-on: https://gerrit.instructure.com/19319
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
fix messageable_users query for mysql

fixes CNVS-5067

test-plan:
  - use mysql database
  - create an account admin
  - create a course with a teacher in that admin's account
  - as the account admin
    - go to the conversation inbox
    - open the recipient browser for a new conversation
    - search for the teacher
  - should find the teacher without any server errors

Change-Id: Iff383bb8eff62dd1caf27f57b3300675a1ca1dbb
Reviewed-on: https://gerrit.instructure.com/19306
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>