Skip to main content
GET
/
api
/
assessments
/
{assessment_id}
Get Assessment
curl --request GET \
  --url https://api.example.com/api/assessments/{assessment_id}
{
  "id": 123,
  "chapter_name": "<string>",
  "content": {
    "mcqs": [
      {
        "question": "<string>",
        "options": [
          {}
        ],
        "correct_answer": "<string>",
        "bloom_level": "<string>",
        "explanation": "<string>"
      }
    ]
  }
}
Retrieves the complete details and content of a specific saved assessment.

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header:
Authorization: Bearer <your_access_token>

Request

Path Parameters

assessment_id
integer
required
The unique identifier of the assessment to retrieve. This ID is returned when saving an assessment or can be obtained from the Assessment History endpoint.

Response

id
integer
The unique identifier of the assessment.
chapter_name
string
The chapter or topic name for this assessment.
content
object
The complete assessment content including all questions, answers, and metadata.

Example Request

curl -X GET "http://localhost:8000/api/assessments/42" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "id": 42,
  "chapter_name": "Chapter 3: Photosynthesis",
  "content": {
    "mcqs": [
      {
        "question": "What is the primary function of chlorophyll in photosynthesis?",
        "options": [
          "Absorb light energy",
          "Store glucose",
          "Release oxygen",
          "Transport water"
        ],
        "correct_answer": "Absorb light energy",
        "bloom_level": "remember",
        "explanation": "Chlorophyll is the pigment that captures light energy from the sun, which is the first step in photosynthesis."
      },
      {
        "question": "Compare and contrast the light-dependent and light-independent reactions.",
        "options": [
          "Both occur in the stroma",
          "Light-dependent produces ATP and NADPH; light-independent uses them to fix carbon",
          "Both require direct sunlight",
          "Light-independent produces oxygen"
        ],
        "correct_answer": "Light-dependent produces ATP and NADPH; light-independent uses them to fix carbon",
        "bloom_level": "analyze",
        "explanation": "The light-dependent reactions capture energy and produce ATP and NADPH, while the light-independent reactions (Calvin cycle) use these products to convert CO2 into glucose."
      },
      {
        "question": "Design an experiment to test how light intensity affects photosynthesis rate.",
        "options": [
          "Measure oxygen production at different light distances",
          "Count the number of leaves",
          "Measure plant height over time",
          "Test soil pH levels"
        ],
        "correct_answer": "Measure oxygen production at different light distances",
        "bloom_level": "create",
        "explanation": "Measuring oxygen production (a byproduct of photosynthesis) at varying light intensities directly tests the relationship between light and photosynthesis rate."
      }
    ]
  }
}

Error Responses

401 Unauthorized

Returned when the Authorization header is missing or contains an invalid token.
{
  "detail": "Not authenticated"
}

404 Not Found

Returned when the assessment ID doesn’t exist or doesn’t belong to the authenticated user.
{
  "detail": "Assessment not found"
}

Security

  • Users can only access their own assessments
  • Attempting to access another user’s assessment returns a 404 error (not 403) to prevent information disclosure
  • The assessment ID and user ID are both verified in the database query

Use Cases

  • Display full assessment content for review
  • Allow users to retake assessments
  • Export assessment data for external use
  • Share assessment content (with appropriate permission handling)
  • Print or generate PDF versions of assessments

Notes

  • The content field structure matches the content_json saved via Save Assessment
  • All questions include explanations to support learning outcomes
  • Questions are tagged with Bloom’s taxonomy levels for educational tracking

Build docs developers (and LLMs) love