fix issue with republish quiz not working correctly pre-draft state

fixes CNVS-13391

test plan:
  - turn off draft state
  - as a teacher
    - create a new quiz
    - publish the quiz
    - make changes to the quiz questions
    - make sure the notification shows that you have unpublished changes
    - republish the quiz
    - the quiz changes should be published

  - make sure there are no regressions with CNVS-13003

  - make sure that publish/unpublish of a quiz with DS continues to work
    as expected
  - mess around with any way you can think to publish the quiz via modules
    etc.

Change-Id: I1365609f8c4fc10056de42a806a3629155e6643e
Reviewed-on: https://gerrit.instructure.com/35754
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
treesame commit of origin/stable/2014-05-24

Treesame-Commit-Id: 1cc0e6006cbab4b5570691a2e2cf333d7af801e2
don't force MFA reconfig after successful CAS login when MFA is needed

fixes CNVS-13348

the problem was CAS login uses a GET, so we were taking the reconfig
path. so check more specifically for the reconfigure action

test plan:
 * configure MFA for an account
 * make sure you can log in, but *don't* remember the device for
   MFA purposes
 * configure CAS on the account
 * login with CAS
 * it should ask for your MFA code, not to reconfigure MFA

Change-Id: If955ee3ed48456c64c9732fa90c7fb911e1c402d
Reviewed-on: https://gerrit.instructure.com/35668
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
add notification that ember quiz has been regraded

fixes CNVS-12440

test plan:
  - enable fabulous quizzes
  - as a teacher
    - create a quiz
    - take the quiz

  - as a student
    - take the quiz

  - as a teacher
    - change the answer and choose to regrade the quiz
    - view the quiz
    - it should show you a regrade notification

  - as a student
    - view the quiz
    - it should show you a regrade notification

  - try variations where
    1. the student's grade isn't affected, should say:
      This quiz has been regraded; your score was not affected.

    2. there is one question regraded, should say:
      This quiz has been regraded; your score was affected.

    3. there are two or more questions regraded, should say:
      This quiz has been regraded; your new score reflects 2 questions that were affected.

Change-Id: I4f12334d553b20314e37bf45ba16d3221778ad85
Reviewed-on: https://gerrit.instructure.com/35585
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
add launch_type parameter to external_tools show action

some planned extensions will need to launch their tools in a
manner similar to a module item tool, but with their extension
specific settings. Added the launch_type parameter to the show
action to make this possible.

refs RAN-53, RAN-55

test plan:
 - configure an external tool that has a an integration type
   other than account_navigation or course_navigation.
 - enter the url for the tool in a browser:
     /course/<course-id>/external_tools/<tool-id>
 - this should display an error.
 - add the launch_type parameter to the url:
     ?launch_type=<extension_name>

Change-Id: I1495db4deca8042ddf6f09548b006a0f7741db35
Reviewed-on: https://gerrit.instructure.com/35159
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
add display_type configuration to external tools

this setting should allow tools to choose how they are displayed
in the canvas interface. the new full width display removes the
canvas sidebars, footer, and breadcrumbs.

test plan:
 - install a tool with course_navigation and account_navigation
   extensions.
 - make sure the tool displays normally without a display_type
   configuration.
 - use a console to set display_type = 'full_width' in a tool's
   course_navigation settings.
 - the tool should display as a "full width" tool when viewed
   by the course navigation link. full width means without the
   left or right side bar, without breadcrumbs, and without a
   footer. the canvas header should still be displayed.
 - the tool should display normally when viewed by the account
   navigation link.
 - use the console to set the display_type = 'full_width' in the
   tool's top level settings.
 - tool tool should now display full width using the account
   navigation link.

Change-Id: Idc19c0c96031bd80a45ce984241c23e4ce1efe78
Reviewed-on: https://gerrit.instructure.com/35160
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
ignore unpublished module items for course progress

fixes CAT-79

test plan:
1. Enable Draftstate on a course that has gallery set up
2. Set up a module with multiple module items
3. unpublish some of the module items ( individually)
* verify that the "requirement_count" adjusts to the
* unpublishing of items for the following endpoint:

/courses/:course_id?include[]=course_progress

Change-Id: I092b8c7a76a1abf4b05bd0a0ed654bee98de0217
Reviewed-on: https://gerrit.instructure.com/35654
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
publish and unpublish with the api instead of changing workflow state directly

fixes CNVS-12975

test plan:
  - create a quiz with two questions (save but don't publish)
  - turn on fabulous quizzes
  - view the number of questions for the quiz on the ember quiz index page
  - it should show you the correct number
  - publish the quiz
  - refresh the page
  - it should continue to show you the correct number of questions

Change-Id: I47b3117a3346de62d167f0959c10b1ea620b8b2b
fix issue with republish quiz not working correctly pre-draft state

fixes CNVS-13391

test plan:
  - turn off draft state
  - as a teacher
    - create a new quiz
    - publish the quiz
    - make changes to the quiz questions
    - make sure the notification shows that you have unpublished changes
    - republish the quiz
    - the quiz changes should be published

  - make sure there are no regressions with CNVS-13003

  - make sure that publish/unpublish of a quiz with DS continues to work
    as expected
  - mess around with any way you can think to publish the quiz via modules
    etc.

Change-Id: I1365609f8c4fc10056de42a806a3629155e6643e
Reviewed-on: https://gerrit.instructure.com/35754
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
don't force MFA reconfig after successful CAS login when MFA is needed

fixes CNVS-13348

the problem was CAS login uses a GET, so we were taking the reconfig
path. so check more specifically for the reconfigure action

test plan:
 * configure MFA for an account
 * make sure you can log in, but *don't* remember the device for
   MFA purposes
 * configure CAS on the account
 * login with CAS
 * it should ask for your MFA code, not to reconfigure MFA

Change-Id: If955ee3ed48456c64c9732fa90c7fb911e1c402d
Reviewed-on: https://gerrit.instructure.com/35668
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
fix issue with republish quiz not working correctly pre-draft state

fixes CNVS-13391

test plan:
  - turn off draft state
  - as a teacher
    - create a new quiz
    - publish the quiz
    - make changes to the quiz questions
    - make sure the notification shows that you have unpublished changes
    - republish the quiz
    - the quiz changes should be published

  - make sure there are no regressions with CNVS-13003

  - make sure that publish/unpublish of a quiz with DS continues to work
    as expected
  - mess around with any way you can think to publish the quiz via modules
    etc.

Change-Id: I1365609f8c4fc10056de42a806a3629155e6643e
Reviewed-on: https://gerrit.instructure.com/35754
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fix typo in account reports

Change-Id: Ice80bbb6a4cd4ad5ee2390414b106670ee6ce416
Reviewed-on: https://gerrit.instructure.com/35776
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
stop appending digits to long assignment names

fixes CNVS-1662

test plan:
  - turn draft state off
  - go to the asignments index
  - create an assignment group w/ a 254 char name
  - click the add assignment link on the right side
    with the newly created assignment group selected
    - the assignment created should not have a number at the end
    - it should save properly
  - click the add assignment link on the right side
    with a different group (without a long name)
    - the assignment created should have a number at the end
      (like usual)

Change-Id: I1cb7c1aa80eb698e1e5b84098448817e943e79fa
Reviewed-on: https://gerrit.instructure.com/35300
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
spec: vendored_gems pin rspec versions

Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
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>
update enrollment activity while window is open

fixes ALYT-32

test plan:
  * open a course page as a student
  * check the student's enrollment's total activity time
  * leave the page open and in the foreground for at least three minutes
  * verify that the student's activity time is updated

Change-Id: I0448ea48dc6739ae1199996d0a4b88b030f43856
Reviewed-on: https://gerrit.instructure.com/35553
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
update ic-menu to 0.1.9

this release of ic-menu has fix for conditional items being ordered
correctly and adds ability to have a disabled menu item

closes CNVS-13355

test plan:
  - enable ember quizzes
  - navigate to an existing quiz overview / show
  - click the admin cog in the top right
    - lock, or unlock the quiz
    - click the cog again
    - using up and down keyboard arrows navigate through menu
      - verify that the key navigation order syncs with the visual order
        in the list

Change-Id: Ica4809c1454fcc0204155d60a429852f1af1bbc3
Reviewed-on: https://gerrit.instructure.com/35803
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
fix duplicate dependency in event_stream spec

to avoid bundler warnings

Change-Id: Ie997a7bb06c6d3334ea8973a80902a5239f67eb5
Reviewed-on: https://gerrit.instructure.com/35516
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Ember Quiz Stats - Discrimination Index Sorting

Fixes an issue where sorting by the DIndex would position questions with
negative indices below questions that don't have a DI at all.

Closes CNVS-13384

TEST PLAN
---- ----

  - create a quiz with a few questions of type multiple-choice, and
    another of a different type
  - go to ember quiz stats:
    - sort by discrimination index
      - verify that MC/TF questions are sorted below each other, and
        other questions that don't have a DIndex are below them

Change-Id: I512b7e9fe5e2c909d7145415e022ab49abc1d889
Reviewed-on: https://gerrit.instructure.com/35737
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
disable take quiz / speed grader menu items in ember if they're not available

fixes CNVS-13258, CNVS-13300

test plan:
  - enable fabulous quizzes
  - as a teacher
    - create an unpublished quiz with only a single attempt allowed
    - go to the ember quiz page
    - the speedgrader link in the menu should be greyed out, and will give you
      a warning if you attempt to go there
    - the "take the quiz" menu item should be greyed out, and will warn you if
      you attempt to take it.
    - publish the quiz
    - the "take the quiz" menu item should now be enabled
    - take the quiz using this menu item
    - attempt to retake the quiz
    - now (since we're limited to 1 attempt) it should be disabled again

Change-Id: I634b0727fccee377c08a390e5507c71c9b9cdd25
Reviewed-on: https://gerrit.instructure.com/35687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
bundle check before bundle install for gem tests

they're likely already installed, and it will save a ton of trips
to rubygems.org

Change-Id: I9ccf2194619a6e8f97d7f21b4e232dac7ff20d3c
Reviewed-on: https://gerrit.instructure.com/35694
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>