Serialise a QTI item's language as xml:lang - #6099
Conversation
bef8ebb to
e917aec
Compare
e917aec to
cf6eaf2
Compare
AlexVelezLl
left a comment
There was a problem hiding this comment.
After reviewing the implications of the schematron, I think it'd be better just not introduce it right now, so please drop that addition.
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.
cf6eaf2 to
c51c5e0
Compare
Dropped — the whole commit is off the branch (force-pushed), so Searched for the rest of that commit's class rather than just the validator: One line from that commit survives: Worth flagging: nothing now catches the root element's attribute names regressing — the XSD's |
AlexVelezLl
left a comment
There was a problem hiding this comment.
Code changes look good, tests provide good confidence.
Summary
languageattribute; an item's language now serialises asxml:lang.References
Fixes #6098. Read-side tolerance: #6095.
Reviewer guidance
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.exercise_file.checksumupdates intest_exercise_creation.pyfollow from the attribute rename changing the zipped item bytes.consolidate()converts on read without persisting, so no storedraw_datacarrieslanguage=.AI usage
Used Claude Code to implement the change 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?
Deviations from the issue spec
validate_qti_itemvalidation.pyis untouched, so nothing here makes validation stricter, and thesrcset-on-<img>sample fix it forced went with it. The cost: no regression guard on the root element's attribute names — the XSD'sextensionAnyTypeLax.Attrwildcard admitslanguage=as happily asxml:lang=.🟡 Waiting for feedback
Last updated: 2026-08-19 14:31 UTC