treesame commit of origin/stable/2014-05-24

Treesame-Commit-Id: 937d87a01bfd8aed04e7e54b13620d359872f871
learning mastery student view: outcome hierarchy

fixes CNVS-13307

test plan:
  * enable learning mastery student view
  * open a student's grades page
  * open the learning mastery tab
  * verify that outcome groups are presented in a hierarchy
  * verify that very deep outcome trees are compressed to paths

Change-Id: I1f74dca2876b39b01a6ec70935f60d5e233fe02b
Reviewed-on: https://gerrit.instructure.com/35481
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
bump moodle2cc to 0.2.9

test plan:
* import the package referenced in the ticket
* should not fail

fixes #CNVS-13417

Change-Id: I1359c789edefa50e78daf2981b15c7823643e3d8
Reviewed-on: https://gerrit.instructure.com/35968
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
bump up pagination for feature flags to 20 instead of 10

It seems like eventually we'll want to update the front-end backbone code to
do proper pagination on this, but we can certainly handle 20 feature flags
before doing this.

fixes CNVS-13461

test plan:
  - as an admin
  - visit the account settings page
  - click on the feature flags tab
  - all 11 feature flags should show up including draft state at the bottom
  - try turning the feature flags on/off to make sure things still work fine

Change-Id: Ifc7c31a48159f77d63a846c472567ae88f913f76
Reviewed-on: https://gerrit.instructure.com/35967
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
change 'show results' to 'show responses' in quiz overview

fixes CNVS-13459
This commit changes the wording from 'Show Results' to 'Show Responses'
in the Quiz overview page, to prevent confusion.

Test plan
- View the ember quiz overview page
- The 'Show Results' setting should now read as 'Show Responses'

Change-Id: Ife3729f5cbca7bdccd7ab2f9bfd4b2c77b2d8687
Reviewed-on: https://gerrit.instructure.com/35970
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
don't create observer enrollments in foreign root accounts

test plan:
 1. have a student enrolled in courses at multiple institutions
    (with no trust relationship between them)
 2. enable parent self-registration at one institution
 3. sign up a parent at that institution
 4. the newly enrolled parent should only receive course invites
    for that institution, and should not see the other
    institution's courses

fixes CNVS-13421

Change-Id: I20baa6fab1989aeb0a1f4eab02b0ca0660333bf6
Reviewed-on: https://gerrit.instructure.com/35937
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
add page to preview submission results after previewing a quiz in ember

fixes CNVS-13439

test plan:
  - enable draft state and quiz stats
  - as a teacher
    - create a quiz
    - 'preview' the quiz
    - after you submit the preview of the quiz, it should redirect you to
      the results page.
    - this page should show a notice that this is a preview of the draft
      version of the quiz
    - this page should show the preview results in the submission results
      below.

Change-Id: Ia5e54873af49a943a3e00a99e7b326ec682614cc
Reviewed-on: https://gerrit.instructure.com/36018
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
api: fix docs for submission media_comment_id

test plan:
- generate the api docs
- look at the type of media_comment_id in the submission grade/comment endpoint
- it should be a string

Change-Id: I5d88edb04e7f836173099295877af795b22f00be
Reviewed-on: https://gerrit.instructure.com/35890
Reviewed-by: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
remove 'the' from API doc generated nicknames

Auto-generated method names sometimes have 'the' in them. Remove 'the' to be consistent with the removal of articles 'a' and 'an'.

Test Plan:
- The following APIs should no longer have "the" in their
  nicknames (autogenerated JSON files):

  Accounts API:
    get_the_sub_accounts_of_account
    change_the_domains_for_account

  Assignments API:
    redirect_to_the_assignment_override_for_group
    redirect_to_the_assignment_override_for_section

  Discussion Topics API:
    get_the_full_topic_courses
    get_the_full_topic_groups
    get_the_full_topic_collection_items

  Groups API:
    list_the_groups_available_in_context_accounts
    list_the_groups_available_in_context_courses

  Quiz Statistics API:
    fetching_the_latest_quiz_statistics
    create_the_quiz_submission_start_quiz_taking_session
    complete_the_quiz_submission_turn_it_in

  Users API:
    list_the_activity_stream_self
    list_the_activity_stream_activity_stream
    list_the_todo_items

Fixes SIS-312

Change-Id: I6de521305605fe75b399889563f6d0b290cdf468
Reviewed-on: https://gerrit.instructure.com/35917
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
expose poll_choice#is_correct to students when available

fixes CNVS-13474
This commit exposes the is_correct attribute on poll_choices when a
student has submitted their answer to the latest poll_session, and that
poll_session has been closed.

Test plan
- As a teacher, create a poll, relevant poll choices, and a poll session
- Publish the poll session
- As a student, at this point is_correct should not be viewable on poll
  choices
- As a student, submit a poll submission
- As a student, at this point is_correct should not be viewable on poll
  choices
- As a teacher, close the poll session
- As a student, at this point is_correct should be viewable on poll
  choices

Change-Id: I20a8bb534affe5e1a23c1dddbb727043535dd23d
Reviewed-on: https://gerrit.instructure.com/36031
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
update page titles in ember quizzes

update the document.title to be consistent with the page that the user
is viewing. update existing moderate page title to be consistent

closes CNVS-12974

test plan:
  - enable :quiz_stats feature
  - enable :quiz_moderate feature
  - visit quiz index
    - title should display 'Quizzes'
  - select a quiz
    - title should display '<quiz title>: Overview'
  - select the moderate tab
    - title should display '<quiz title>: Moderate'
  - select the statistics tab
    - title should display '<quiz title>: Statistics'

Change-Id: I36d94014e2225d78d59d35c77b16bb82af48d644
Reviewed-on: https://gerrit.instructure.com/36016
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
learning mastery student view: basic info and progress bars

fixes CNVS-12922
fixes CNVS-11552

test plan:
  * enable learning mastery student view
  * open a student's grades page
  * open the learning mastery tab
  * verify that outcome groups have the correct statuses
  * verify that the outcome have the correct statuses
  * verify that the progress bars are correctly color coded
    and in the correct percentages

Change-Id: I2aa0a73d4a831d9795308efc10cdf13123fe7dce
Reviewed-on: https://gerrit.instructure.com/35844
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Drew Bowman <dbowman@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>
expose poll_choice#is_correct to students when available

fixes CNVS-13474
This commit exposes the is_correct attribute on poll_choices when a
student has submitted their answer to the latest poll_session, and that
poll_session has been closed.

Test plan
- As a teacher, create a poll, relevant poll choices, and a poll session
- Publish the poll session
- As a student, at this point is_correct should not be viewable on poll
  choices
- As a student, submit a poll submission
- As a student, at this point is_correct should not be viewable on poll
  choices
- As a teacher, close the poll session
- As a student, at this point is_correct should be viewable on poll
  choices

Change-Id: I20a8bb534affe5e1a23c1dddbb727043535dd23d
Reviewed-on: https://gerrit.instructure.com/36031
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
add Poll#associated_shards

This commit adds the Poll#associated_shards method so that
with_each_shard acts sane.

Test plan
- The poll_choices index endpoint should work correctly

Change-Id: Iabb0f3db25aec7e60ec1013424b534fa2c08102a
Reviewed-on: https://gerrit.instructure.com/36068
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
add Poll#associated_shards

This commit adds the Poll#associated_shards method so that
with_each_shard acts sane.

Test plan
- The poll_choices index endpoint should work correctly

Change-Id: Iabb0f3db25aec7e60ec1013424b534fa2c08102a
Reviewed-on: https://gerrit.instructure.com/36068
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
don't break unicode sequenecs when truncating filenames

also, don't round-trip the display_name through the truncated
CGI-escaped filename, since UTF-8 chars become nine-character
sequences, limiting entirely non-Latin filenames to 28 chars
(255 / 9).

fixes CNVS-13426

test plan:
 - all files attached to the ticket should
   (1) upload to the files page without error
   (2) with the filename preserved and untruncated

Change-Id: I41322595e858892313276544607fd3ff2a0310ec
Reviewed-on: https://gerrit.instructure.com/36046
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
fix speedgrader xss vulnerability

closes CNVS-13427

test plan:
- create a course with multiple sections, and name one of them with html in the
  name
- also create multiple teachers and name them with html in the name
- create an assignment with a rubric
- go to speedgrader
- in the student dropdown menu, where you can pick which section to filter, the
  section name should be escaped (should show the raw html)
- fill out the rubric with multiple teachers
- reload speedgrader, there should be a dropdown that lets you pick which
  rubric assessment to look at it, and in that dropdown, the teacher name with
  html should be escaped

Change-Id: I2521e2fb4130cc97d47fa233a0fdc105302e9874
Reviewed-on: https://gerrit.instructure.com/35983
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix speedgrader xss vulnerability

closes CNVS-13427

test plan:
- create a course with multiple sections, and name one of them with html in the
  name
- also create multiple teachers and name them with html in the name
- create an assignment with a rubric
- go to speedgrader
- in the student dropdown menu, where you can pick which section to filter, the
  section name should be escaped (should show the raw html)
- fill out the rubric with multiple teachers
- reload speedgrader, there should be a dropdown that lets you pick which
  rubric assessment to look at it, and in that dropdown, the teacher name with
  html should be escaped

Change-Id: I2521e2fb4130cc97d47fa233a0fdc105302e9874
Reviewed-on: https://gerrit.instructure.com/35983
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix speedgrader xss vulnerability

closes CNVS-13427

test plan:
- create a course with multiple sections, and name one of them with html in the
  name
- also create multiple teachers and name them with html in the name
- create an assignment with a rubric
- go to speedgrader
- in the student dropdown menu, where you can pick which section to filter, the
  section name should be escaped (should show the raw html)
- fill out the rubric with multiple teachers
- reload speedgrader, there should be a dropdown that lets you pick which
  rubric assessment to look at it, and in that dropdown, the teacher name with
  html should be escaped

Change-Id: I2521e2fb4130cc97d47fa233a0fdc105302e9874
Reviewed-on: https://gerrit.instructure.com/35983
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>