Commit Graph

2 Commits

Author SHA1 Message Date
Joel Hough 68ea9ce600 all outcome result api sideloads are optional
fixes CNVS-10527

the include[] parameter on the outcome result endpoint can now
include 'outcomes', 'users', and 'courses'

test plan
- fetch outcome results using the api
- verify that the 'linked' section is not present
- ensure that outcomes are included when requested
- with the aggregate parameter not set...
 - ensure that users are included when requested
 - ensure that requesting course inclusion results in an error
- with the aggregate parameter is set to 'course'...
 - ensure that courses are included when requested
 - ensure that requesting user inclusion results in an error

Change-Id: I80714c0c8c9534d5853bc1c0e9258919913afa60
Reviewed-on: https://gerrit.instructure.com/28826
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-01-28 21:53:54 +00:00
Ahmad Amireh e3778b529c Quiz Submissions API - Create & Complete
Allows users to start a "quiz-taking session" via the API by creating
a QuizSubmission and later on completing it.

Note that this patch isn't concerned with actually using the QS to
answer questions. That task will be the concern of a new API controller,
QuizSubmissionQuestions.

closes CNVS-8980

TEST PLAN
---- ----

- Create a quiz
- Keep a tab open on the Moderate Quiz (MQ from now) page

Create the quiz submission (ie, start a quiz-taking session):

- Via the API, as a student:
  - POST to /courses/:course_id/quizzes/:quiz_id/submissions
    - Verify that you receive a 200 response with the newly created
      QuizSubmission in the JSON response.
    - Copy the "validation_token" field down, you will need this later
    - Go to the MQ tab and verify that it says the student has started a
      quiz attempt

Complete the quiz submission (ie, finish a quiz-taking session):

- Via the API, as a student, prepare a request with:
  - Method: POST
  - URI: /courses/:course_id/quizzes/:quiz_id/submissions/:id/complete
  - Parameter "validation_token" to what you copied earlier
  - Parameter "attempt" to the current attempt number (starts at 1)
  - Now perform the request, and:
    - Verify that you receive a 200 response
    - Go to the MQ tab and verify that it says the submission has been
      completed (ie, Time column reads "finished in X seconds/minutes")

Other stuff to test (failure scenarios):

The first endpoint (one for starting a quiz attempt) should reject your
request in any of the following cases:

  - The quiz has been locked
  - You are not enrolled in the quiz course
  - The Quiz has an Access Code that you either didn't pass, or passed
    incorrectly
  - The Quiz has an IP filter and you're not in the address range
  - You are already taking the quiz (you've created the submission and
    did not call /complete yet)
  - You are not currently taking the quiz, but you already took it
    earlier and the Quiz does not allow for multiple attempts

The second endpoint (one for completing the quiz attempt) should reject
your request in any of the following cases:

  - You pass in an invalid "validation_token"
  - You already completed that quiz submission (e.g, you called that
    endpoint earlier)

Change-Id: Iff8a47859d7477c210de46ea034544d5e2527fb2
Reviewed-on: https://gerrit.instructure.com/27015
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2013-12-19 06:44:28 +00:00