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>