Make optional fields optional in Discussion Topic

fixes SIS-233

Change-Id: I0df8341113825df5acefdc68eedea8a4543d38aa
Reviewed-on: https://gerrit.instructure.com/33627
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
Ember Quiz Stats - Multiple-Choice and T/F

Question statistics for multiple-choice and true/false questions.

Closes CNVS-12173

TEST PLAN
---- ----

  - create a quiz with a bunch of multiple-choice and true/false
    questions
  - take the quiz by at least 5 students, make different combinations of
    answer selections, and make sure you skip some questions by at least
    one student
  - go to the statistics page and:
    - "Attempts: X out of Y" should display the number of responses that
      question received

Block by block:

  A. the correct answer distribution block:
    - should display a donut chart that visualizes the number of
      responses that were correct for this question
    - should show the percentage in both the donut chart and the little
      explanation beside it, like 33% or 67%, etc.

  B. the answer distribution column chart:
    - each answer defined in the question should be represented by a
      single column
    - the column should be as high as the number of responses the answer
      received
    - the column should be colored green if it represents the correct
      answer, blue otherwise
    - answers with 0 responses should still be visible / hoverable (1
      pixel high)
    - when you hover over a column, it should show a tooltip containing
      the response ratio as well as the answer text
    - the special "No Answer" should have its own bar if any student has
      not specified an answer
      - that bar should be striped

  C. the discrimination index block:
    - should show the point biserial value:
      - red if it is less than or equal to 0.25
      - green otherwise
    - should show a chart that meets the criteria specified in the
      relevant tickets

  D. the answer-drilldown/question-details section:
    - should list every answer
    - the single answer block should be prefixed by a little bubble that
      shows the ratio of responses for that answer
    - that same bubble should be green for the correct answer, blue
      otherwise
    - the answer block should contain the answer text

  E. toggling of question details:
    - clicking the detail-toggle button should expand and collapse the
      answer drilldown section
    - clicking the toggle button in the "Question Statistics" header
      should expand/collapse ALL questions

  F. sorting questions:
    - choosing to sort by discrimination index should sort them
      descendingly
    - choosing to sort by position should mimic the order of creation of
      questions

Change-Id: I784ce21e4f446144f64137295c1fb0923dc321de
Reviewed-on: https://gerrit.instructure.com/32734
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Add custom JS and CSS for the ad-hoc collaboration sub-account
simplify conditional
Fix loop to make it work for non "*00" sections (e.g. d101, d110, g001)
fix mysql build

fixes ALYT-25

some custom logic on the PostrgeSQLAdapter is
breaking the mysql build (due to PostgreSQLAdapter
not being defined). This commit adds a defined? guard
to fix this.

Change-Id: I4bc647d310b9c67d627647a11d5f2567a9b1e73e
Reviewed-on: https://gerrit.instructure.com/34554
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>
treesame commit of origin/stable/2014-05-03

Treesame-Commit-Id: 1f231d1369a4fbfeac4211524210b87d6e1a669a
use the correct url for lit sessionless launch urls

test plan
 - create an assignment with a different launch url then the default for a tool
 - launch the assignment via sessionless launch
 - it should launch to the configured url

 - repeat for module items

fixes PLAT-456

Change-Id: Iafc44dc255dbf1f9917f09bf7ef8959a7c8b90d4
Reviewed-on: https://gerrit.instructure.com/32360
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
discussion topics: fix sorting nil positions

fixes CNVS-12774

test plan:
  * if you don't have legacy discussions with nil positions, run this:

Course.find(1).discussion_topics.where(pinned: true).update_all(position: nil)

  * open the discussions index page
  * move a discussion using the "Move To" gear menu option
  * verify that the discussion is moved
  * reload the page
  * verify that the change persists

Change-Id: Ibb3afc6a876f359cecba360792009b3db1793785
Reviewed-on: https://gerrit.instructure.com/34230
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
discussions: separate group discussions from group assignments

fixes CNVS-4475

pre-checkout plan:
  * create a course
  * open people->groups
  * create a student group with multiple students
  * open discussions
  * create two topics
  * make one topic a group assignment

test plan:
  * open the topics you created
  * verify that a "group discussion" option replaced "group assignment"
  * verify that your group assignment is a group discussion
  * verify that your group discussion uses the same group set
  * verify that the old behavior of presenting child topics is retained
  * verify that your non-group topic is not a group discussion
  * verify that the "group discussion" flag cannot be changed for topics
      with replies

  * create a new discussion topic
  * verify that "group discussion" is available for ungraded topics
  * verify that changes to the field persist

  * create a new graded group discussion topic
  * post to one of the subtopics as a student in its group
  * open the gradebook as the teacher
  * verify that the student who posted has a submission but the other
      group members do not
  * verify that group members can be graded individually

Change-Id: Iada30628f0abdb7d7df4267d695553baf8b952d3
Reviewed-on: https://gerrit.instructure.com/33253
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>
Merge pull request #155 from grahamb/conversation-path

add message_user_path to the sfu profile endpoint
Merge pull request #157 from grahamb/collab-space

Add custom CSS and JS for ad-hoc collaboration sub-account
Ember Quiz Statistics - Summary section

Closes CNVS-11697

TEST PLAN
---- ----

  - create a quiz with a number of questions, you can use multiple
    choice or T/F exclusively for this patch
  - take the quiz by like 5-10 students
  - visit the statistics page
  - verify the following items have proper values:
    - avg score
    - high score
    - low score
    - std. deviation
    - avg time taken
  - verify that the trend line/median of score distribution line graph
    is visually correct
  - verify that the score percentile column chart is correct
  - try generating student and item analysis:
    - verify you see a progress bar that updates as the thing gets
      generated
    - verify that hte tooltip content changes to reflect the states of
      the report and/or its generation
    - verify that it auto-downloads the report when it's generated
    - verify that once its generated, you can click the link to download
      the file
    - extra: click generate, refresh before the report is generated, and
      verify that the auto-download no longer occurs
    - verify that you can't spam the generate button; it will generate
      the report only once and prompt you to download only once (it
      should become gray/disabled once you start generating)

Please see the following document for the AC I'm working with alongside
the JIRA ticket, and for the status of some of the items:

http://docs.amireh.net/canvas/cnvs-4338#Summary-section

Change-Id: I2348e21daf6e33cc9af3746a445aa192a371fb35
Reviewed-on: https://gerrit.instructure.com/32733
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
recognize IE11 user agent string for page views

fixes CNVS-9912

test plan:
 * enable page views
 * visit canvas using IE11
 * go to your user, and look at the page views
 * it should show "Internet Explorer 11.0" as your browser, not
   "Mozilla"
 * for good measure, visit some pages with a few other browsers, and
   ensure they make sense

Change-Id: Ida0905bdc74f971f31f0302b2a091b415c81b537
Reviewed-on: https://gerrit.instructure.com/34491
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
improve safari version detection for page view

refs CNVS-9912

test plan:
 * enable page views
 * visit canvas with safari
 * view your page views
 * it should show the safari version number (i.e. 7.0), instead
   of the webkit version number (i.e. 575)

Change-Id: I6f0efcf3c2108fc92accfa86292af1ca7ee6ddaf
Reviewed-on: https://gerrit.instructure.com/34492
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
create media objects on the account's shard

fixes CNVS-9711

Change-Id: If6f49101350e8adca55254906f45f5c3381af74b
Reviewed-on: https://gerrit.instructure.com/34509
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
respect 'include' parameter in /groups/x/users API

when fetching the users in a group via the
/api/v1/groups/:group_id/users endpoint, respect the same set of
include[] query parameter flags as when listing users in a course.

refs MBL-1961

test-plan:
 - have a group with a user with a specified avatar
 - fetch /api/v1/groups/<that group>/users
 - returned user record should not have an avatar_url field (default)
 - fetch /api/v1/groups/<that group>/users?include[]=avatar_url
 - returned user record should have an avatar_url field

Change-Id: Ib7eda3b077faa79e2a8a1a4c8481775c1d54aa0e
Reviewed-on: https://gerrit.instructure.com/32962
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
remove barista initializer, we don't use it anymore

a long time ago we stopped using barista to compile
our coffeescript for us but we forgot to delete this
initializer

Change-Id: I920ec88ff9f9021371e22fa5eb3e7f1fff022d63
Reviewed-on: https://gerrit.instructure.com/34568
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Add integration_id to submissions API

Added integration_id to the user (pseudonym) as well as the
assignments when querying for submissions.

Test Plan:
- query for submissions from a student with an sis_id and
  an integration_id, and for an assignment with an integration_id
- use grouped=false
- results should have integration_id for students, and
  integration_id for assignments
- e.g. curl -H 'Authorization: Bearer [your API key]' \
  -XGET http://localhost:3000/api/v1/courses/1/students/submissions \
  -F 'include[]=assignment' -F 'student_ids=all' -F 'grouped=false'

Fixes SIS-252

Change-Id: I0339fa19bc50dfea3719598924a90746b62f7ebe
Reviewed-on: https://gerrit.instructure.com/34456
Reviewed-by: Eric Adams <eadams@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
fix some crumbs I18n

fixes CNVS-3106

test plan:
 * change language
 * /accounts/X/account_authorization_configs
 * /accounts/X/avatars
 * go to a user page, and click "Delete from X" (where X is the account)
 * all three of those pages the bread crumbs should be localized

Change-Id: I198275963999bb08fceb0659a7097af6287d8684
Reviewed-on: https://gerrit.instructure.com/34484
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>