tweak embedded views to support dialog-title-styled h2s

refs CNVS-4554

this makes it possible to have an embedded iframe dialog that controls
the content of its titlebar. this is useful for dialogs that take you
through multiple steps (pages)

test plan:
N/A, see g/19071 where we use it

Change-Id: I580b263321467c8e5445f60206517fb8f27d94be
Reviewed-on: https://gerrit.instructure.com/19620
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
better error handling in ValidatedFormView

refs CNVS-4554

ensure ValidatedFormView doesn't puke on non-json responses (e.g. invalid
authenticity token)

test plan:
N/A, see g/19071

Change-Id: I7e3e6e9aa35af7c32d49dc818b5e7688b31e3552
Reviewed-on: https://gerrit.instructure.com/19627
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
upgrade ruby_parser for 1.9 syntax support

fixes CNVS-5367

this allows hairtrigger and our i18n extraction code to parse 1.9 syntax
correctly.

also fixed a issue with the i18n rake tasks, so symlinks in
vendor/plugins are now followed.

test plan: without this commit, run rake i18n:generate. then copy
config/locales/generated/en.yml somewhere.

then apply this commit, update your bundle, and run rake i18n:generate again.

compare the new en.yml against the saved one, they should be the same
(unless you have symlinks in vendor/plugins, in which case the new one
will have more strings but existing strings should be the same)

Change-Id: If0df5eae25c59822a9d3c2738fe9549a756ff9e9
Reviewed-on: https://gerrit.instructure.com/19693
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
bootstrapified new calendar event form

fixes CNVS-5249
fixes CNVS-5267

test steps:
- go to the cal2 and click on a calendar date
- click 'more options'
- ensure that the create new calendar event form is bootsrapified

Change-Id: I6be65d4c8ebf74d5c6b8015cc89b048049a8cb14
Reviewed-on: https://gerrit.instructure.com/19551
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fix failing specs (caused by libxml2 upgrade)

test plan:
 * specs pass

Change-Id: I2041fa39cbabfd11a51de5aae28d611cacb280e5
refs: #CNVS-5269
Reviewed-on: https://gerrit.instructure.com/19687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
add thumbnail_url to files api

test plan:
 - upload images to a course
 - retrieve these files via the files api
 - a thumbnail_url should be in the response
 - confirm that this thing is downloadable

fixes CNVS-5329

Change-Id: I583cba7d08566770223821de554b76f9c767b38f
Reviewed-on: https://gerrit.instructure.com/19612
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
always send quiz due date changed notifications.

fixes CNVS-5102, CNVS-5255

when a quiz due date has changed, always send notifications
to affected users; don't require the editor to check the
"notify users this quiz has changed" checkbox.

test plan:
  * as a teacher, change the due date of an existing quiz
    and save the change without checking the "notify users
    that this quiz has changed" checkbox;
  * verify that affected students with ASAP notifications
    receive a message.
  * verify that these notifications also work as expected
    for quizzes with multiple due dates.

Change-Id: Iba4bc32c2eb7629fd475201938ba7adb345c0e6a
Reviewed-on: https://gerrit.instructure.com/19609
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
hide 'link question bank' after question group create

the backend only allows linking a question bank while creating a question
group, so have the frontend match that

fixes CNVS-4647

test plan:
- create a quiz
- add a new question group
- notice that 'link question bank' is there and functions
- hit create group
- without reloading, edit the group
- the link should be gone
- reload the page
- the link should still be gone

Change-Id: I1ecb924e8104fa306b391f80bd931b192747de04
Reviewed-on: https://gerrit.instructure.com/19604
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
option to include js translations in development mode

?include_js_translations=1 will cause js translation files to be required
and used... this way you don't need to use optimized js

note that you need to run `rake i18n:generate_js`, otherwise you will get
amd loading errors or out-of-date translations

test plan:
1. rake i18n:generate_js
2. switch to another language in the ui
3. go to the conferences page for a course and tack on
   ?include_js_translations=1 to the url
4. click to create a new conference
5. note that the submit button (i.e. "Create Conference") is now
   translated

Change-Id: Id676fce6dbf3f2fbe739b00427e09541fdc8c639
Reviewed-on: https://gerrit.instructure.com/19716
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
add submission_versions table and index

This change is in anticipation of adding a more data inclusive grade
history API. Adds user_id and assignment_id to index as well.

Test Plan: n/a

refs CNVS-2802

Change-Id: Ib9f305612bbc48a6423ed955cd591d6de0658eb0
Reviewed-on: https://gerrit.instructure.com/19505
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
accessibility fixes for tokeninput in conversations.

fixes CNVS-3887

filter and user select inputs are now keyboard navigable.
arrow keys move throughout the list, and enter adds the
selected user/context to the list of recipients or filter.

test plan:
  * attempt to use the recipient finder using only the
    arrow/enter keys;
  * using a screenreader, verify that each entry in the
    results is read as expected.

Change-Id: I5b75d13b7baf7a090bfa341d21d8fb3d7f91c140
Reviewed-on: https://gerrit.instructure.com/19503
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
dismissible minimum browser banner, closes #CNVS-5043

dismisses the banner for the browser session

test plan:
- use canvas in an unsupported browser (e.g. ie8, old firefox,
  or set your user agent to an unsupported one)
- click the minimum browser warning at the top of the page
- the warning should be dismissed
- when visiting other canvas pages the warning should still be dismissed
- restart the browser
- the warning should be visible again

Change-Id: I0d8bc966e8512e07dab0448f68a538a256228c4e
Reviewed-on: https://gerrit.instructure.com/19623
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
add users from courses/:id/users page

test plan:
1. go to /courses/:id/users
2. click 'add users'
3. should work much like the add users UI in
   the course settings -> users tab, but look
   a little different

Change-Id: Icec24a41385e595d8b79dc5a7232545f0aff926e
Reviewed-on: https://gerrit.instructure.com/18888
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>
gradebook2: escape html values to prevent xss

Escapes the presentation and capturing of grades in gradebook2 to guard
against xss attacks

test plan:
  - as a teacher, edit a grade in the gradebook with
    "><img src=/ onerror=alert(document.cookie);>
  - you should not see an alert

fixes CNVS-5369

Change-Id: I67a9892ca71db62a2462789b6cf7f28dce47335e
Reviewed-on: https://gerrit.instructure.com/19706
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
gradebook1: escape html in scores

prevent xss when inputting scores in gradebook 1.

test plan:
  - as a teacher, enter a grade in gradebook1 for the following grading
    types:
    - points
    - percent
    - letter grade
  with the text:
    "><img src=/ onerror=alert(document.cookie);>
  - make sure you don't see an alert for all of these file types.

fixes CNVS-5381

Change-Id: I27d102b83dce5f510f486e30613a1685aa11f2be
Reviewed-on: https://gerrit.instructure.com/19724
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
use exclusive scoping on api html datafix

The find_in_batches scope was applying to the self.assignment
when a discussion topic was saving itself. So the topic
wouldn't find the assignment and would set its assignment_id
to nil.

This also just updates the specific column for the assignment.
Either of these would fix the problem, but I added both anyway.

refs CNVS-5217

Change-Id: Ic77704999b6835688d9c3c88dbfce9607fe4c662
Reviewed-on: https://gerrit.instructure.com/19664
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
fix various handlebars i18n bugs

fixes CNVS-1641, CNVS-3143, CNVS-5356

now it actually works :-/

* fix key getting stomped by iteration of options
* fix double-scoping (explicit and in options)
* fix absolute key bug (they were getting scoped)
* fix camelCased filenames having the wrong scope
* support single-quoted keys

test plan:
1. change your language
2. go to pages where translations didn't show up (e.g. outcomes, calendar2)
3. use optimized js, or tack on ?use_js_translations=1
4. the content should be translated

Change-Id: I9742d60e5dcbccf971ce30b1302e85d4f4033b77
Reviewed-on: https://gerrit.instructure.com/19717
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
track quiz_statistics.csv progress

refs CNVS-4887

Test plan:
  This isn't exposed anywhere in the UI yet, but if you really wanted to
  test this, you could download quiz stats csv for a large course and
  watch the progress attached to the quiz_statistics model increase
  while the csv was being generated

Change-Id: I0f1d703df38c2525a412414ce767505a6caf157d
Reviewed-on: https://gerrit.instructure.com/19323
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
groundwork for background generation of quiz stats

This actually did do the stats generation in the background, but that
has been disabled temporarily since we don't have a front-end UI yet.

Test plan:
  make sure you can still download quiz stats csv

closes CNVS-4887

Change-Id: Ia84af0c8392396a054ceba2f6edbcaf7c8c40c90
Reviewed-on: https://gerrit.instructure.com/19397
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
fix taking public non-graded quiz while logged out

fixes CNVS-4562

test plan:
- in a public course, create a practice quiz
- log out
- take the quiz
- it should work

Change-Id: I0e98d6d165622ee58ddc63896d71bad57075a3cd
Reviewed-on: https://gerrit.instructure.com/19602
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>