Skip to content

Published QTI item with a namespace-prefixed root gets no xml:lang #6236

Closed

Description

@rtibblesbot

❌ 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

  1. Store a type == qti item whose root is <q:qti-assessment-item xmlns:q="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" ...>.
  2. Publish a node with a language set.
  3. Read items/<id>.xml from the QTI zip: the root has no xml:lang.

Context

AI usage

I used Claude Code to review the #6230 branch. It found this gap and reproduced it on upstream/unstable with set_qti_item_language directly.

Activity

  1. added theissue type on Sep 30, 2026
  2. rtibbles commented on Oct 16, 2026

    @rtibbles
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions