You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Published QTI item with a namespace-prefixed root gets no xml:lang #6236
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: unstable
Observed behavior
set_qti_item_language (utils/assessment/qti/media.py) finds the item root with ITEM_ROOT_START_TAG_REGEX, which only matches an unprefixed <qti-assessment-item.
An item whose root is written with a namespace prefix (<q:qti-assessment-item) passes schema validation, then is written to the package without the node's language.
Expected behavior
The item root carries xml:lang set to the node's language, whichever namespace prefix the item used.
User-facing consequences
A channel mixing prefixed and unprefixed items publishes a QTI package where only some items declare a language.
Steps to reproduce
Store a type == qti item whose root is <q:qti-assessment-item xmlns:q="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" ...>.
Publish a node with a language set.
Read items/<id>.xml from the QTI zip: the root has no xml:lang.
Fixed by #6241: set_qti_item_language now sets xml:lang on the parsed root. Covered by test_set_language_sets_it_on_a_namespace_prefixed_root (tests/utils/qti/test_media.py); reproduced fixed on unstable at 98b560e.
Activity
fix: parse QTI items to rewrite them at publish instead of matching r…
rtibbles commentedon Oct 16, 2026
Fixed by #6241:
set_qti_item_languagenow setsxml:langon the parsed root. Covered bytest_set_language_sets_it_on_a_namespace_prefixed_root(tests/utils/qti/test_media.py); reproduced fixed onunstableat 98b560e.