Updated tr translation
remove OpenDataExport permissions/routes

the gem will handle the process of including them

Change-Id: I2237b4cad388756f91f67138a716ae5a8472d9df
Reviewed-on: https://gerrit.instructure.com/32586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
profile: allow changing avatar from course or group context

fixes CNVS-12335

test plan:
  * open your profile from within a course or group's People page
  * change your profile picture
  * verify that it is changed successfully

Change-Id: I53c93fbabe09a57801154cc6e4f9743c8945f1c3
Reviewed-on: https://gerrit.instructure.com/33259
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
fix issues with quiz question creation on quizzes with existing submission data

fixes CNVS-11539

test plan:
- as a teacher
  - create a new quiz with multiple choice questions
  - publish the quiz

- as a student
  - take the quiz

- as a teacher
  - edit the quiz, and add new questions to the quiz
  - try to remove answers for the new question as you're creating it
  - try to create different question types for the new question
  - it should allow you to add new questions fine with no errors
  - when you remove or change answers you should not get any regrade options
  - click 'update question' for this question
  - after you have successfully update the question, you should get all the
    regrade options and restrictions around deleting answers or changing
    the question type.

- make sure there are no regressions with the test plans in:
  - CNVS-9853
  - CNVS-10868

Change-Id: I08f350db8f0f09e2c3d8480d1b4a55853d86b09a
Reviewed-on: https://gerrit.instructure.com/33226
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
calendar: handle concluded checked courses

fixes CNVS-12384

test plan:
  * create two courses
  * open calendar 2 and show events from both
  * conclude one of your courses
  * open calendar 2
  * verify that events from the remaining course are displayed

Change-Id: Ia17b0e0391aed343af2c45dc62a4bc9284830259
Reviewed-on: https://gerrit.instructure.com/33262
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
Quiz Reports API - Index

An endpoint for retrieving all quiz reports for a given quiz.

Closes CNVS-12172

CHANGES
-------

The biggest effort in this patch was to normalize the way QuizReport
objects are interfaced with, and the generation of their CSV attachments
in particular:

  - Quiz#current_statistics_for() now ALWAYS returns a persisted object
    while still considering the freshness of the stats
  - Quiz#statistics_csv() is no longer responsible for testing whether
    the attachment should be generated or not, but instead ensures
    that the CSV will be generated ASAP
  - QuizStatistics#generate_csv() now guards against generating multiple
    attachments
  - QuizStatistics#generate_csv_in_background() now guards against
    queueing multiple generation jobs (by testing the status of the
    Progress object)

QuizReport API changes:

  - new property: "generatable"
  - new property: "readable_type"
  - new property: "url"
  - now accepts JSON-API format for all endpoints:
    - JSON-API allows you to embed file and progress objects directly in
      the QuizReport document, just pass ?include=file,progress

Quizzes API changes:

  - new property (JSON): "quiz_reports_url"
  - new property (JSON-API): "links.quiz_reports"

Some AMS changes:

  - added support for accepting side-loading requests from controllers
    by passing an :includes array to the serializer initializer
  - added support for embedding objects in root, using `embed: :object
    and embed_in_root: true` for has_one associations
  - also, in that same scenario, AMS's default behavior is to wrap
    single objects (has_one) in an array, which didn't work for me, so I
    added a new option called "wrap_in_array" which you can set to false
    when defining the association to override this behavior

Other changes:

  - covered the front-end/javascript that utilizes the reports and
    allows teachers to generate them
  - QuizReport in the front-end no longer relies on magical course_id
    exposed in window.ENV, but instead uses its URL to construct the
    generation URL (see QuizReport#baseURL)
  - Attachment now has a shallow-AMSerializer that proxies to the legacy
    one in lib/api/v1 which allows us to at least side-load them
  - Progress now has an AMS
  - QuizReport legacy serializer in lib/api/v1 removed entirely,
    replaced by the new AMS one

TEST PLAN
---- ----

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports

  - as a teacher, make a request to the endpoint above:
    - it should return a set of two quiz report objects
  - add a parameter "includes_all_versions=true" to the query parameters
    and verify that the "student_analysis" report in the returned set
    now reflects the new value (the reports have a field called
    "includes_all_versions" which should be true in this case, false
    otherwise)
  - as a student, make the request and verify that it rejects you

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports/:id

  - turn on JSON-API mode
  - as a teacher:
    - don't generate the report from the UI yet
    - make the request, and verify that you get only the report
    - generate
    - repeat the request, verify that you still get only the report
    - add a ?include=file query parameter
      - you should read the file document now
    - add a ?include=progress query parameter
      - you should read the progress document now
  - turn off JSON-API mode
  - as a teacher:
    - make the request, and verify you get the "progress_url" field and
      that the file document is embedded automatically without having to
      specify the ?include= parameter

Front-end testing:

  - go to the statistics page
  - generate all reports:
    - verify that the progress bar updates
    - verify that you can download them
    - verify that auto-download occurs unless you refresh the page
      before the report is generated
  - toggle on the "Count All Attempts" button and repeat the above:
    - verify that Item Analysis is not generatable anymore since it's
      not affected by that parameter

Please note that "item_analysis" reports will always have
"includes_all_versions" as true.

Change-Id: I0dc6d5108cbcef78b2fa17ba0476f470d33d402d
Reviewed-on: https://gerrit.instructure.com/32731
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
srgb Submission Download Dialog

fixes CNVS-11500
fixes CNVS-11549

test plan:
 - in srgb, select an assignment
 - click the 'Download all submissions' button
 - a dialog should appear that should say it is zipping the file
 - after it zips, it should download the file immediately
 - closing the dialog should cancel the download
 - reopening the dialog should restart the download

Change-Id: I0c312ec352f8ffa5d39977aab901e8873e1156fb
Reviewed-on: https://gerrit.instructure.com/31275
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
fix polymorphic quiz_submission association on delayed_message

fixes CNVS-12395

test plan:
  please check for regressions around notifications on quiz submissions.
  this includes:
  - to teachers when the submission needs grading
  - to students when the submission is graded
  - to students when the grade changed

this one is very difficult to reproduce manually. data needs to be in a state
where a delayed job has been queued to send a notification message for a quiz
submission before the namespace change was deployed, and then it attempts to
execute the delayed job after the namespace change. it appears that messages
are only sent to a delayed message queue when there there are more than 500
messages per day.

Change-Id: I0869b4decaec900a2c4c8df5c6e0b8b29dd08c5c
Reviewed-on: https://gerrit.instructure.com/33307
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
remove discussion replies cruft

fixes CNVS-11990

test plan
- ensure nothing changed, especially things having to do with
 inboxes and discussions

Change-Id: I07cfbf17ca04459f5048bf6fe8befc200dbfd965
Reviewed-on: https://gerrit.instructure.com/32441
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
use the current time for grade change audit events

fixes CNVS-12400

test plan: Enable auditors and trigger some grade change events, such as
auto-graded quiz or teacher-graded submission. They should show up in
the audit logs with the timestamp of the time the event happened.

Change-Id: I596242e09d8acb34443ca0974b7393fc9faa51f6
Reviewed-on: https://gerrit.instructure.com/33342
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
profile pics: display round border on cropping interface

fixes CNVS-12382

test plan:
  * open your profile page
  * edit your avatar
  * select an image file
  * verify that the cropping interface presents a round border

Change-Id: I23842540c9923916d95031495c5f609fd897fad6
Reviewed-on: https://gerrit.instructure.com/33260
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
QA-Review: Braden Anderson <banderson@instructure.com>
Tested-by: Braden Anderson <banderson@instructure.com>
add timestamps to crocodoc_documents

Change-Id: Ib1226b0aed4be89456b5c8f2ca250318ec254b13
Reviewed-on: https://gerrit.instructure.com/33317
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
don't show rubric assess scores in api on muted assignments

fixes CNVS-12403

test plan:
- create an assignment with a rubric, and mute it
- grade the assignment with the rubric for a student
- as the student, query the api for the submission object
- it should not contain the rubric assessment data

Change-Id: Id83a9444f06c59938cd1bd5cac7a6ddb4019d45f
Reviewed-on: https://gerrit.instructure.com/33316
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QuizStatistics API

Closes CNVS-8989

CHANGES
-------

  - ItemAnalysis can now be generated to a Hash as well as CSV

TEST PLAN
---- ----

  - create a quiz with a number of questions (true/false and
    multiple-choice a must-have)
  - take the quiz by 2-3 students
  - perform an API request as described below and verify that you get a
    statistics object that matches the API docs
  - do it once in legacy JSON format, e.g:
    "Accept: application/json"
  - do it once in JSON-API format, e.g:
    "Accept: application/vnd.api+json"
  - read the API docs and report any mistakes or stuff that's not clear,
    the stuff is written in the QuizStatistics module

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/statistics

Change-Id: I1588e1cdc8955b890c739df4c730507dad7118d1
Reviewed-on: https://gerrit.instructure.com/31141
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fix activesupport-suspend_callbacks for 4.1

activesupport 4.1 doesn't have CallbackChain inherit from Array anymore,
instead, it houses an internal array and delegates to it.

Change-Id: I5730f734be5e7c0422ac56245609043f52b6425a
test-plan: specs
Reviewed-on: https://gerrit.instructure.com/33081
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Revert "work around more ipad speedgrader json calls"

This reverts commit f1e3e09b3f8255cfbfbe0c4d880e4ca16b349384.

refs CNVS-12163

test plan: With this commit, make sure that the ipad speed grader app is
able to log in and post comments on submissions.

Change-Id: I0eec14d17c4f4d65b1a33832c1689523caa04c51
Reviewed-on: https://gerrit.instructure.com/32722
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix time issues in grade change auditor specs

Turns out these only passed yesterday because of the timestamp that I
chose.

Change-Id: I0e56ca5670dc5da989e4e3f493a7c93b8bbc1994
Reviewed-on: https://gerrit.instructure.com/33383
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
add ember-qunit for ember unit tests

closes CNVS-11294

test plan:
  - enable ember quizzes
  - ensure that existing ember quizzes continue to work
  - all existing ember tests should continue to pass

Change-Id: I4f56b1267504533be8332520ea5f77d2fa566263
Reviewed-on: https://gerrit.instructure.com/33105
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
canvas kaltura gem

fixes CNVS-10479

test plan:
  - in a course with kaltura enabled
    - go to a discussion and add media
    - upload a video (use right tab, not the webcam)
    - save the video/discussion post
    - the video should be saved properly and viewable
      (this sometimes takes a minute of two)

Change-Id: I40b9174807707dd1fb41125e04705422a8711d5d
Reviewed-on: https://gerrit.instructure.com/32024
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
create a page_view on a participation

fixes: CNVS-12029

This consolidates the use of log_asset_access so when this is set as
a participation and a page_view does not exist it will create one.
This will keep the asset user access in sync for participations so
analytics and the access reports are not off.

Test Plan:

Create a course with some quizes.  Take the quiz and view the quiz
to generate some activity for a student.

Open the Student Activity report along with analytics for the
student/course.

Make sure the numbers of participations match in each report.

Change-Id: If8b6e7d86e350d5b2a3dd15ca9236c14f52d300a
Reviewed-on: https://gerrit.instructure.com/32382
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>