Skip to content

[QTI] QTI 3.0 schema XML validation utilities #6005

Description

@rtibbles

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

One authoritative backend validator that checks any QTI item against the QTI 3.0 schema, independent of source. The frontend surfaces only user-correctable errors; full compliance is guaranteed here.

Complexity: Medium
Target branch: unstable

Context

  • QTI arrives from the editor and from ricecooker, and may use interaction types or constructs the editor never produces.
  • The sync API accepts writes outside the editor, so the frontend's by-construction validity can't be assumed; QTI must be validated on save, not only at upload and publish.
  • Publish validates every item in a channel and ricecooker uploads in bulk, so the schema can't be re-parsed per item.
  • The pydantic models ([QTI] Build the QTI declaration model with XML parsing and serialization #5965) cover a restricted generation subset, not the full spec.

The Change

Acceptance Criteria

  • A reusable function validates a QTI item against the QTI 3.0 schema, returning structured pass/fail + errors
  • Valid QTI passes, including interaction types the editor does not author
  • Malformed or non-compliant QTI fails with errors that identify the problem
  • The compiled schema is reused across items, not re-parsed per item
  • Tests cover valid items across multiple interaction types and representative invalid items

References

AI usage

Architecture decided with the maintainer across an iterative session: blanket QTI type with the item XML in raw_data; XSD-authoritative validation across all sources; a legacy→QTI global migration with an API-layer dual-read; ricecooker upload delegating to the AssessmentItem serializer; and a Perseus custom-interaction contract confirmed against the QTI 3.0 specification. Claude mapped the existing publish/validation/ricecooker code, proposed the breakdown, and drafted each issue; the maintainer steered every decision and reviewed throughout.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions