Serialise a QTI item's language as xml:lang and run the item schema's Schematron rules - #6099
Open
rtibblesbot wants to merge 2 commits into
Open
Serialise a QTI item's language as xml:lang and run the item schema's Schematron rules#6099rtibblesbot wants to merge 2 commits into
rtibblesbot wants to merge 2 commits into
Conversation
QTI 3.0 declares xml:lang on qti-assessment-item; `language` is not an attribute of the element. Renaming the pydantic field to `xml__lang` is enough — XMLElement.to_element already maps `__` to `:`. Exercise zip checksums shift because the generated XML changed.
rtibblesbot
force-pushed
the
issue-6098-751e59
branch
from
August 19, 2026 02:28
0593dd7 to
bef8ebb
Compare
The XSD's extensionAnyTypeLax.Attr wildcard admits any unrecognised attribute, so the XSD alone could not catch the xml:lang bug. The schema's own Schematron rules do enumerate the legal attributes, but etree.XMLSchema never executes them. Surfaced a second violation: srcset is not a QTI 3.0 img attribute, so the assessmentitem viewset test's sample item now wraps it in <picture><source>. The pydantic Img model still permits it — separate fix.
rtibblesbot
force-pushed
the
issue-6098-751e59
branch
from
August 19, 2026 02:38
bef8ebb to
e917aec
Compare
rtibblesbot
marked this pull request as ready for review
August 19, 2026 03:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
languageattribute; an item's language now serialises asxml:lang.validate_qti_itemnow runs the item schema's own Schematron rules, whichetree.XMLSchemanever executes.References
Fixes #6098. Read-side tolerance: #6095.
Reviewer guidance
raw_datawritten before this can carry an attribute the XSD's wildcard used to admit.srcseton<img>in a viewset test's sample item. I corrected the sample rather than loosen the validator.tests/utils/qti/fixtures/are golden expected output compared verbatim bytest_convert.py, not assertion-free tests. Mutating one attribute in each fails a distincttest_convert.pycase.AI usage
Used Claude Code to implement both changes test-first from the plan on the issue. Verified with the full Python test suite and pre-commit.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟢 Updating PR
Last updated: 2026-08-19 03:00 UTC