Skip to main content
The Assessment Items API allows you to create and manage individual questions and answers for exercise content.

Endpoints

List Assessment Items

curl -H "Authorization: Token YOUR_TOKEN" \
  "https://studio.learningequality.org/api/assessmentitem?contentnode={node_id}"
Retrieve assessment items for exercises.
contentnode
string
Filter by content node ID
contentnode__in
string
Filter by multiple content node IDs (comma-separated)
[
  {
    "assessment_id": "assessment-id-123",
    "contentnode": "exercise-node-id",
    "type": "single_selection",
    "question": "What is 2 + 2?",
    "answers": [
      {
        "answer": "3",
        "correct": false,
        "order": 1
      },
      {
        "answer": "4",
        "correct": true,
        "order": 2
      },
      {
        "answer": "5",
        "correct": false,
        "order": 3
      }
    ],
    "hints": [
      {
        "hint": "Think about basic addition",
        "order": 1
      }
    ],
    "order": 1,
    "randomize": false,
    "deleted": false
  }
]

Create Assessment Item

curl -X POST \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contentnode": "exercise-node-id",
    "assessment_id": "new-assessment-id",
    "type": "single_selection",
    "question": "What is the capital of France?",
    "answers": "[{\"answer\": \"Paris\", \"correct\": true, \"order\": 1}, {\"answer\": \"London\", \"correct\": false, \"order\": 2}]",
    "hints": "[{\"hint\": \"It is known as the City of Light\", \"order\": 1}]",
    "order": 1
  }' \
  https://studio.learningequality.org/api/assessmentitem
Create a new assessment item (question) for an exercise.
contentnode
string
required
Exercise content node ID
assessment_id
string
required
Unique assessment identifier (UUID format)
type
string
required
Question type
question
string
Question text (supports markdown)
answers
string
required
JSON string containing answer objects
hints
string
JSON string containing hint objects (default: ”[]”)
order
integer
Display order within the exercise (default: 1)
randomize
boolean
Whether to randomize answer order (default: false)
source_url
string
Source URL for the question
raw_data
string
Raw question data
{
  "assessment_id": "new-assessment-id",
  "contentnode": "exercise-node-id",
  "type": "single_selection",
  "question": "What is the capital of France?",
  "answers": "[{\"answer\": \"Paris\", \"correct\": true, \"order\": 1}]",
  "hints": "[{\"hint\": \"It is known as the City of Light\", \"order\": 1}]",
  "order": 1,
  "randomize": false,
  "deleted": false
}

Update Assessment Item

curl -X PATCH \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contentnode": "exercise-node-id",
    "assessment_id": "existing-assessment-id",
    "question": "Updated question text?"
  }' \
  https://studio.learningequality.org/api/assessmentitem
Update an existing assessment item. Assessment items are identified by the combination of contentnode and assessment_id.
Assessment items use a composite lookup key of contentnode and assessment_id rather than a single ID field.

Delete Assessment Item

curl -X PATCH \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contentnode": "exercise-node-id",
    "assessment_id": "assessment-to-delete",
    "deleted": true
  }' \
  https://studio.learningequality.org/api/assessmentitem
Soft delete an assessment item by setting deleted to true.

Question Types

Supported question types:
single_selection
string
Multiple choice with one correct answer
multiple_selection
string
Multiple choice with multiple correct answers
true_false
string
True/false question
input_question
string
Free text input question
perseus_question
string
Khan Academy Perseus format question

Answer Format

Answers must be provided as a JSON string containing an array of answer objects:
[
  {
    "answer": "Answer text",
    "correct": true,
    "order": 1
  },
  {
    "answer": "Another answer",
    "correct": false,
    "order": 2
  }
]

Hint Format

Hints must be provided as a JSON string containing an array of hint objects:
[
  {
    "hint": "Hint text to help learner",
    "order": 1
  },
  {
    "hint": "Another hint",
    "order": 2
  }
]

Images in Questions

You can embed images in questions, answers, and hints using markdown syntax:
![Alt text]($/path/to/image.jpg)
The image files are automatically managed:
  1. Upload images using the Files API with preset: "exercise_image"
  2. Reference them in markdown using the checksum: ![](${placeholder}/checksum.ext)
  3. The API automatically associates image files with the assessment item
Images referenced in question text, answers, or hints are automatically tracked and associated with the assessment item.

Assessment Item Fields

assessment_id
string
Unique assessment identifier (UUID)
contentnode
string
Associated exercise content node ID
type
string
Question type (single_selection, multiple_selection, true_false, input_question, perseus_question)
question
string
Question text (supports markdown)
answers
string
JSON string of answer objects
hints
string
JSON string of hint objects
order
integer
Display order within the exercise
randomize
boolean
Whether to randomize answer order for the learner
source_url
string
Source URL where the question originated
raw_data
string
Raw question data in original format
deleted
boolean
Whether the assessment item has been deleted

Example: Creating a Complete Exercise

1

Create Exercise Node

Create a content node with kind: "exercise" and set extra_fields.randomize
2

Add Assessment Items

Create multiple assessment items for the exercise
3

Upload Images

If questions contain images, upload them with preset: "exercise_image"
4

Reference Images

Use markdown image syntax in questions/answers/hints
{
  "contentnode": {
    "title": "Basic Arithmetic",
    "kind": "exercise",
    "extra_fields": {
      "randomize": true
    }
  },
  "assessment_items": [
    {
      "assessment_id": "uuid-1",
      "type": "single_selection",
      "question": "What is 5 + 3?",
      "answers": "[{\"answer\": \"8\", \"correct\": true, \"order\": 1}, {\"answer\": \"7\", \"correct\": false, \"order\": 2}]",
      "hints": "[{\"hint\": \"Add the numbers together\", \"order\": 1}]",
      "order": 1
    },
    {
      "assessment_id": "uuid-2",
      "type": "multiple_selection",
      "question": "Which are even numbers?",
      "answers": "[{\"answer\": \"2\", \"correct\": true, \"order\": 1}, {\"answer\": \"3\", \"correct\": false, \"order\": 2}, {\"answer\": \"4\", \"correct\": true, \"order\": 3}]",
      "order": 2
    }
  ]
}

Build docs developers (and LLMs) love