Skip to content

Submit quiz attempt

Submits answers to an attempt and grades it.

Needs the quiz:write scope.

Call

  • Tool: submit_attempt
  • Scope: quiz:write
  • Writes, and may change or remove what is there.
  • Acts on a store.

Arguments

Name Type Required Description
product object Yes
attempt object Yes
answers object Yes Each text answer at most 4000 characters.
preview string No A token a seller made for the quiz’s product’s page, which opens the quiz of a published entry of the product unpublished, or for the quiz’s entry, which opens it unpublished too, gated as ever; with it, a sitting on any quiz it does not open is not_found preview.
{
  "type": "object",
  "properties": {
    "product": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "slug"
          ],
          "additionalProperties": false
        }
      ]
    },
    "attempt": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    },
    "answers": {
      "description": "Each text answer at most 4000 characters.",
      "type": "object",
      "properties": {},
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "string",
            "maxLength": 4000
          },
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "maxProperties": 500
    },
    "preview": {
      "description": "A token a seller made for the quiz's product's page, which opens the quiz of a published entry of the product unpublished, or for the quiz's entry, which opens it unpublished too, gated as ever; with it, a sitting on any quiz it does not open is `not_found` `preview`.",
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    }
  },
  "required": [
    "product",
    "attempt",
    "answers"
  ],
  "additionalProperties": false
}

Answer

Name Type Required Description
attempt object Yes
score number Yes
correct number Yes
total number Yes
results array of object Yes
certificate object or null Yes
certificates array of object Yes

The answer’s full shape is on its API reference page.

Type to search…

↑↓ navigate↵ selectEsc close