canvas-lms/app/controllers/filters
Ahmad Amireh 84a87f8513 QLA - use the submission's question set
Closes CNVS-17235

API/Backend Changes:

  - New helper in Filters::QuizSubmissions for retrieving a specific
    attempt model of a quiz submission, given the attempt number

  - QuizSubmission now provides an interface for looking up its model
    reflection in a certain attempt: QuizSubmission#model_for_attempt()

  - QuizQuestion API index endpoint now allows us to specify a
    submission and an attempt number for retrieving questions presented
    during that unique session

  - QuizSubmission API show endpoint now allows us to specify an attempt
    for retrieving the submission info at that attempt

  - QuizQuestion JSON renderer can now utilize quiz_data (if specified)
    to infer the position of the question in the output. This is
    necessary for submission questions since their position varies from
    a sub to another.

  - QuizSubmissionEvents #create endpoint has been moved to:
    [POST] /courses/:id/quizzes/:id/submissions/:id/events

  - New endpoint for retrieving a sub's attempt events at:
    [GET]  /courses/:id/quizzes/:id/submissions/:id/events

Client changes:

  - Client can now parse pagination using either the Link header when
    receiving regular JSON responses, or the JSON-API "pagination" set,
    whichever is available.

TEST PLAN
---- ----

  - create a quiz with 2 questions, make sure u allow multiple attempts
  - take the quiz as a student, no need to submit it
  - go to the submission log for that student:
    + verify the page loads and renders just fine
  - now edit the quiz, delete one of those questions, save the quiz
    + reload the submission log page:
      - it should still work
  - submit the quiz, take it again
    + go back the submission log page, and switch between attempts:
      - verify the switching works and data gets (re)loaded

Test with banks:

  - create a new quiz with questions pulled out of a bank, and let it
    allow multiple attempts
  - take the quiz a number of times so you get different questions from
    the bank across the attempts
  - in the QLA app, verify that you see the correct questions when you
    switch between attempts

Extra:

Generate the API docs (`bundle exec rake doc:api`) and visit the Quiz
Questions page; the "List questions in a quiz or submission" endpoint
docs should now list the 2 new parameters, "quiz_submission_attempt" and
"quiz_submission_id".

Change-Id: I4b1761b924fb6011b1df696b89fbf6a91bab43a6
Reviewed-on: https://gerrit.instructure.com/45262
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-12-18 23:39:54 +00:00
..
allow_app_profiling.rb integrate rack-mini-profiler for in-app perf measurements 2014-04-25 15:40:44 +00:00
grading_periods.rb MGP - no permissions for grading period without feature flag on 2014-12-04 22:06:03 +00:00
live_assessments.rb live assessments api 2014-06-10 14:53:40 +00:00
polling.rb add polling session and submission apis 2014-05-22 20:49:40 +00:00
quiz_submissions.rb QLA - use the submission's question set 2014-12-18 23:39:54 +00:00
quizzes.rb quiz index optimizations 2014-09-05 14:20:38 +00:00