messageable user: exclude bookmark from serialization (rails2)

fixes CNVS-13309

test plan:
  * set up pg_collkey on rails 2
  * open user settings page
  * verify that the page loads

Change-Id: I4b9bac1b48a974d0f415b9db7fa67468eddea237
Reviewed-on: https://gerrit.instructure.com/35780
Reviewed-by: Drew Bowman <dbowman@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
add feature flags for quiz statistics and moderate pages

fixes CNVS-13228

the old way of enabling fabulous quizzes is no more. Now we're using proper
course based feature flags, and we have two different feature flags for
the new statistics page and moderate pages. You can enable these flags from
your account settings page.

In the code we now check these using:
  @context.feature_enabled?(:quiz_stats)
  @context.feature_enabled?(:quiz_moderate)

In ember we have a new environment attribute to check if moderate is enabled:
  env.get("moderateEnabled")

This also moves "take quiz" to the top item in the list, and changes its icon
to be a play icon to not have so many circles as icons in the menu

test plan:
  - feature flag changes
    - as a site admin
      - disable both quiz stats and quiz moderate
      - visit the quiz index/show/moderate/statistics pages
      - they should all be the non-ember versions of the pages

     - enable the quiz stats feature
       - as a teacher
         - visit the quiz index/show/statistics pages
         - this should be the ember version of these pages
         - visit a quiz page
         - this should enable the ember version of these pages
         - there should be a link to moderate the quiz in the dropdown menu
         - try to visit the moderate page (quizzes/123/moderate)
         - this page should render correctly as the old moderate page
         - the moderate tab should not be there

    - enable the quiz moderate feature
      - as a teacher
        - visit the quiz page
        - the moderate link in the drop down menu should be gone
        - this should enable the moderate tab in ember
        - visit the quiz moderate page, this should be the ember version
        - if you try to visit quizzes/123/moderate directly it should
          redirect you to the moderate page

  - api changes
    - as a teacher
      - request the quizzes api endpoint for a single quiz
      - you should see a new "moderate_url" property in the payload

    - as a student
      - request the quizzes api endpoint for a single quiz
      - you should NOT see the "moderate_url" property in the payload

  - other changes
    - with stats enables, the take quiz should be at the top of the dropdown
    - the take quiz icon has been changed

Change-Id: I04639890b425b1c5abf3305892e4b5b9d804b525
Reviewed-on: https://gerrit.instructure.com/35810
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>
cc 1.3 importing qti from inside manifest

also fix a couple other minor cc issues

test plan:
* import the test packages referenced in the ticket

* should reference the images correctly in the first package
* should import a quiz in the second

fixes #CNVS-13340

Change-Id: I39dca77953d2b46703fa5163240329b039075ec3
Reviewed-on: https://gerrit.instructure.com/35815
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
update cassandra.yml.example docs for clarity

Change-Id: I6f0a17aee45bf98e1a39e93ccadb7ee3ef1c3cae
Reviewed-on: https://gerrit.instructure.com/35679
Reviewed-by: Ethan Garofolo <egarofolo@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Tested-by: Ethan Garofolo <egarofolo@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
outcome results API: include result count on rollups

fixes CNVS-13365

test plan:
  * open /api/v1/courses/1/outcome_rollups
  * verify that each score includes a count
  * verify that counts match the number of results for that
      combination of outcome and student

Change-Id: I0cbbab7d2c1ebb6574e090046c52b7a4159bb9b9
Reviewed-on: https://gerrit.instructure.com/35708
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
fix course copy wiki front page assignment

test plan:
* create a course with a front page
* create a new empty course
* copy from the first course to the second
* should set the front page

* also should not override an already existing
 front page

fixes #CNVS-13398

Change-Id: Iaeb73804d99f362129e3418106d3d9afd5cb4922
Reviewed-on: https://gerrit.instructure.com/35817
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
fix the quiz submission preview inception issue in ember quizzes

fixes CNVS-13390

- test plan
  - enable draft state and quiz stats features
  - as a teacher
    - create a quiz with multiple attempts

  - as a student
    - take the quiz

  - as a teacher
    - go to speedgrader for this student's submission and add a note in the
      sidebar

  - as a student
    - go to your dashboard, the teacher's note should be in the sidebar
      under "Recent Feedback"
    - click on the note
    - it should bring you to the submission details page.
    - the ember version of the page should display in the frame
    - clicking on 'take the quiz again' should not cause inception

Change-Id: I1eb7d467ec08f8d3a1510602b4720483c1b1167c
Reviewed-on: https://gerrit.instructure.com/35871
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 quiz show and edit pages

fixes CNVS-13320

test plan:
 - navigate to /quizzes
 > it should load without an error message
 - navigate to a single quiz (quizzes/:id)
 > it should load without an error message

Change-Id: Ic83f6ff6d5a9ae146057efb2418c8686cf52ec49
Reviewed-on: https://gerrit.instructure.com/35533
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Accessibility: heading levels reflect discussion reply nesting

Fixes CNVS-12502

Test plan:
- Create a discussion with threaded replies.
- Using a screen reader, verify that replies with varying levels of depth
  have varying heading levels to match.

Change-Id: I85fc47d54ef86e4ddcc0c5bdb184ec483e649b03
Reviewed-on: https://gerrit.instructure.com/35770
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
remove asterisks from API doc generated methods

Method names generated for swagger could include asterisks, and
this would cause syntactically incorrect Ruby code to be generated
in Pandarus as a result.

Test Plan:
- method names generated by "rake api:doc" should not include "*",
  e.g. "resolve_path_courses_full_path" used to have be called
  "resolve_path_courses_*full_path" and should no longer be so.

Fixes SIS-307

Change-Id: I0c618bb9f1589721675766c4d307ff21c816c2fc
Reviewed-on: https://gerrit.instructure.com/35792
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Adams <eadams@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Accessibility: Errors on the login screen are now read to screen reader users

Fixes CNVS-12223

test plan:
- Using a screen reader, visit the login page and trigger an error.
- Confirm that the error ("invalid password" or similar) is read automatically.

Change-Id: I0e9f19943a6bcdd78a73949cba58b88531e6eaf0
Reviewed-on: https://gerrit.instructure.com/35617
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
change 'muted' attr of Assignment to boolean

Assignment object is documented as having a "muted" attribute of
Integer type. It should be "Boolean".

Fixes SIS-309

Change-Id: Ibad9ff20bae0f68fa642187fc1a250f869e80633
Reviewed-on: https://gerrit.instructure.com/35816
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
roster: show activity columns based on "usage reports" permissions

fixes CNVS-13436

test plan:
  * for teachers, disable these permissions:
    * Add/remove other teachers, course designers or TAs to the course
    * Add/remove students for the course
  * enable View usage reports for the course
  * log in as a teacher
  * view the course roster
  * confirm that the activity columns are visible

Change-Id: Ida208431c5d94b5f6f3a7a2df2901e5c4300b3a0
Reviewed-on: https://gerrit.instructure.com/35891
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
Accessibility: Cause screen readers to read "message sent" flash message

Fixes: CNVS-12806

Screen readers were not working with the flashMessage
method. Determined that adding a timeout on it will
make the screenReaderFlashMessage method fire as
intended. This results in screen readers properly
picking up on the alert.

Test plan:
Using a screenreader
1.) Navigate to conversations
2.) Send a message
3.) Verify that the screen reader reads the "message sent" flash message


Change-Id: I83985690fc672ceb146ceed3a17b0f997d360f75
Reviewed-on: https://gerrit.instructure.com/35858
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Aaron Cannon <acannon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
dont overwrite settings that exist on new assignments

fixes CNVS-13238

test plan:
  - on new assigment index page
  - hit the + on an assignment group to make an assignment
  - hit More Options on the modal
  - on the edit page the right assignment group should be selected
  - other assignment settings should act normally

Change-Id: Idbba3b43767aae6dd45b7d34f286cde8c1e81403
Reviewed-on: https://gerrit.instructure.com/35365
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Ember Quiz Stats - Cleanup

All-round cleanup and refactors. Changes detailed below.

Closes CNVS-12947

  - now using parseFloat() instead of multiplying by 1.0
  - guarded against division by zero
  - renamed occurrences of Em to Ember according to guideline
  - Ember optimizations; making use of what it provides in things like
    ObjectController property proxying, array utilities, etc.
  - using @toggleProperty for togglable booleans
  - null return explicitly in controller action handlers to disable
    bubbling
  - dereferences are now only set for methods that are called more than
    once
  - multiple dependencies listed in define([]) broken down into separate
    lines, no commas
  - refactored some of the chart code to make the distinction between
    configurable constants and computed variables more clear
  - in objects that defined them, moved all private/internal methods
    outside of the object API to the closure/define scope so that now
    they really can't be accessed by anybody but the objects themselves

TEST PLAN
---- ----

  - create a full quiz with all kinds of questions
  - take it by a number of students
  - play around with the ember stats page and try to break it
  - watch the console for any errors

Change-Id: Id7931157205767f154c8fc7246926d704a3e4ecd
Reviewed-on: https://gerrit.instructure.com/35560
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Quiz Stats - Multiple Choice & True/False

Changes:

  - no longer exposing user_ids
  - no longer exposing response_values
  - new metric: "responses" at the root-level

Closes CNVS-13385

TEST PLAN
---- ----

  - create a quiz with those question types
  - take the quiz by a number of students, choose different answers
  - get the stats from the API:
    [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - verify you get the documented metrics and they have the proper
      values
  - verify the relevant sections in ember quiz stats is still functional

Change-Id: I470912060042405629812585ef6667693b1302a1
Reviewed-on: https://gerrit.instructure.com/35734
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fix polling api 500 errors

fixes CNVS-13434
This commit addresses several 500 errors the polling api was emitting in
various circumstances.

Test plan
- Create a poll session with an invalid course section id
  - The API should return a 404 and JSON response of 'resource not found'

- Create a poll session with a blank has_public_results attribute
  - The poll session should be created with a 'false' has_public_results
    attribute

- Update a poll session with a new course_id and valid course_section id
  - The poll session should be updated successfully

- Create a poll submission with no poll_choice_id supplied.
  - The API should return a 404 and JSON response of 'resource not found'

- Create a poll submission who has made a submission for a different
  session on the same poll
  - The poll submission should be created successfully

Change-Id: I435067488914b2d1a3e48e2df5eda835228759c2
Reviewed-on: https://gerrit.instructure.com/35936
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
bundler 1.6 support

native bundler api for changing github sources to https

Change-Id: Ie6cc75b7279bf7bdb7bbb0e3f7423206ae5a05c7
Reviewed-on: https://gerrit.instructure.com/35834
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>
Quiz Stats - Short Answer

Closes CNVS-13386

TEST PLAN
---- ----

  - similar to multiple-choice in https://gerrit.instructure.com/35734
    but with this question type with a few minor differences:
    - "correct" metric, see docs
    - "other"/"unknown" answer should be generated only if any student
      writes an answer that is not correct

Change-Id: I2d56afc0d9c1a3620d4de96059ebdadc56baecf9
Reviewed-on: https://gerrit.instructure.com/35735
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>