Quiz API

batch_show

get
Query parameters
idsstring[]OptionalExample: ["160","161"]
Responses
404
returns nothing when none of the banks belong to authorized user
application/json
get
GET /api/banks/batch_show HTTP/1.1
Host: 
Accept: */*
404

returns nothing when none of the banks belong to authorized user

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

create

post
Responses
404
populates the export_settings field with the given export_settings param
application/json
post
POST /api/content_exports HTTP/1.1
Host: 
Accept: */*
404

populates the export_settings field with the given export_settings param

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

create

post
Responses
404
example at ./spec/requests/api/v1/courses_controller_spec.rb:208
application/json
post
POST /api/courses HTTP/1.1
Host: 
Accept: */*
404

example at ./spec/requests/api/v1/courses_controller_spec.rb:208

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

destroy

delete
Path parameters
canvas_idintegerRequiredExample: 9999
Responses
404
is expected to be not found
application/json
delete
DELETE /api/courses/{canvas_id} HTTP/1.1
Host: 
Accept: */*
404

is expected to be not found

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

update

put
Path parameters
canvas_idintegerRequiredExample: 201
Responses
404
is expected to be not found
application/json
put
PUT /api/courses/{canvas_id} HTTP/1.1
Host: 
Accept: */*
404

is expected to be not found

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

associate_courses

patch
Path parameters
canvas_idintegerRequiredExample: 196
Responses
404
associates courses which have previously been archived
application/json
patch
PATCH /api/courses/{canvas_id}/associate_courses HTTP/1.1
Host: 
Accept: */*
404

associates courses which have previously been archived

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

associate_quizzes

patch
Path parameters
canvas_idintegerRequiredExample: 550000000000154
Responses
404
replaces the local canvas_id with the global canavs_id
application/json
patch
PATCH /api/courses/{canvas_id}/associate_quizzes HTTP/1.1
Host: 
Accept: */*
404

replaces the local canvas_id with the global canavs_id

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

check_shareability

post
Responses
404
is expected to be bad request
application/json
post
POST /api/items/check_shareability HTTP/1.1
Host: 
Accept: */*
404

is expected to be bad request

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

create_batch

post
Responses
404
is expected to be unprocessable
application/json
post
POST /api/quiz_clone_jobs/create_batch HTTP/1.1
Host: 
Accept: */*
404

is expected to be unprocessable

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

index

get
Query parameters
idsstring[]OptionalExample: ["1674","1675","1676","1677","1678","1679","1680","1681","1682","1683","1684","1685","1686","1687","1688","1689","1690","1691","1692","1693","1694","1695","1696","1697","1698","1699","1700","1701","1702","1703","1704","1705","1706","1707","1708","1709","1710","1711","1712","1713","1714","1715","1716","1717","1718","1719","1720","1721","1722","1723","1724"]
quiz_idintegerOptionalExample: 3499
Responses
404
returns all the quiz sessions without paginating
application/json
get
GET /api/quiz_sessions HTTP/1.1
Host: 
Accept: */*
404

returns all the quiz sessions without paginating

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

show

get
Path parameters
idintegerRequiredExample: 1764
Query parameters
disable_ac_invalidationstringOptionalExample: true
idintegerOptionalExample: 1764
quiz_idintegerOptionalExample: 3533
quiz_session_idintegerOptionalExample: 1436
Responses
404
does not invalidate the student access code
application/json
get
GET /api/quiz_sessions/{id} HTTP/1.1
Host: 
Accept: */*
404

does not invalidate the student access code

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

time

get
Path parameters
idintegerRequiredExample: 145
Responses
200
then the elapsed time should be the sum of the previous and current attempt
application/json
get
GET /api/quiz_sessions/{id}/time HTTP/1.1
Host: 
Accept: */*
200

then the elapsed time should be the sum of the previous and current attempt

{
  "timer_running": false,
  "time_left_in_seconds": 170
}

index

get
Path parameters
quiz_session_idintegerRequiredExample: 146
Query parameters
formatstringOptionalExample: json
Responses
200
then the assignment will autosubmit and cannot be resumed
application/json
get
GET /api/quiz_sessions/{quiz_session_id}/quiz_session_response_events HTTP/1.1
Host: 
Accept: */*
200

then the assignment will autosubmit and cannot be resumed

[]

index

get
Path parameters
quiz_session_idintegerRequiredExample: 160
Responses
200
should not modify the session response data
application/json
get
GET /api/quiz_sessions/{quiz_session_id}/session_item_responses HTTP/1.1
Host: 
Accept: */*
200

should not modify the session response data

[
  {
    "attempt": 1,
    "position": 1,
    "item_id": "877",
    "user_response": {
      "value": [
        "dbf5d3e1-e92e-45ba-8151-5f67095d8add",
        "b3227f8d-47ac-48cc-a2df-ce7768dc6d93"
      ]
    }
  },
  {
    "attempt": 1,
    "position": 2,
    "item_id": "878",
    "user_response": {
      "value": "b2d93c86-caaa-4fdc-b32f-7ed692384ffa"
    }
  }
]

create_batch

post
Responses
404
returns created: false
application/json
post
POST /api/quiz_sync_jobs/create_batch HTTP/1.1
Host: 
Accept: */*
404

returns created: false

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

index

get
Query parameters
context_idintegerOptionalExample: 2462
formatstringOptionalExample: json
quiz_idsstring[]OptionalExample: ["2762","2764"]
versionintegerOptionalExample: 1
Responses
401
uses v1 endpoints by default
application/json
get
GET /api/quizzes HTTP/1.1
Host: 
Accept: */*
{
  "error": "Nil JSON web token",
  "errors": [
    {
      "error_type": "JWT::DecodeError",
      "message": "Nil JSON web token"
    }
  ]
}

create

post
Path parameters
quiz_idintegerRequiredExample: 1461
Responses
404
does not create a bank share job
application/json
post
POST /api/quizzes/{quiz_id}/quiz_clone_jobs HTTP/1.1
Host: 
Accept: */*
404

does not create a bank share job

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

check_shareability

post
Responses
404
indicates the content is shareable
application/json
post
POST /api/stimuli/check_shareability HTTP/1.1
Host: 
Accept: */*
404

indicates the content is shareable

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

index

get
Query parameters
filterstringOptionalExample: a
pageintegerOptionalExample: 1
per_pageintegerOptionalExample: 1
Responses
404
paginates properly
application/json
get
GET /api/tags HTTP/1.1
Host: 
Accept: */*
404

paginates properly

{
  "error": "Unknown host",
  "errors": [
    {
      "error_type": "ActiveRecord::RecordNotFound",
      "message": "Unknown host"
    }
  ]
}

Last updated

Was this helpful?