You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch makes it possible to list the "question records" for a QS
which clients can use to tell what questions are answered, flagged,
etc.
closes CNVS-10025
TEST PLAN
---- ----
Fire up some computer, launch a Canvas instance, create a quiz with a
question or two, take it as a student, answer it, then get ready for
API business:
> Index action - Listing all question records
[GET] api/v1/quiz_submissions/:quiz_submission_id/questions
- Perform the request
- Verify you get N entries, one for each question you answered or
marked
- Set an "include" parameter with "quiz_question" (ie,
"?include=user")
- Verify that the returned set now contains 3 entries:
1. "quiz_submission_questions" what you saw earlier
2. "quiz_questions" with Quiz Questions that you answered
3. "meta" that you can safely ignore
> Show action - Fetching a single question record
[GET] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id
- Perform the request
- Verify you get 1 entry
- Try the "include" parameter as you did in the Index case
As a sidenote, the output of these endpoints should be the same as the
stuff you get when you answer a question (see CNVS-9844), they
basically should tell you what answer you provided if you did, and if
you marked the question or not.
Change-Id: If39b84d8fda77870c3990822ade06bd28b276c3d
Reviewed-on: https://gerrit.instructure.com/27598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Copy file name to clipboardExpand all lines: app/controllers/quiz_submission_questions_controller.rb
+84-7Lines changed: 84 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -19,18 +19,91 @@
19
19
# @API Quiz Submission Questions
20
20
# @beta
21
21
#
22
-
22
+
# API for answering and flagging questions in a quiz-taking session.
23
+
#
24
+
# @model QuizSubmissionQuestion
25
+
# {
26
+
# "id": "QuizSubmissionQuestion",
27
+
# "required": ["id"],
28
+
# "properties": {
29
+
# "id": {
30
+
# "description": "The ID of the QuizQuestion this answer is for.",
31
+
# "example": 1,
32
+
# "type": "integer",
33
+
# "format": "int64"
34
+
# },
35
+
# "flagged": {
36
+
# "description": "Whether this question is flagged.",
37
+
# "example": true,
38
+
# "type": "boolean"
39
+
# },
40
+
# "answer": {
41
+
# "description": "The provided answer (if any) for this question. The format of this parameter depends on the type of the question, see the Appendix for more information."
0 commit comments