Skip to content

[QTI] Publish reads numeric answers inconsistently and routes exercises to the wrong archives #6294

Open

Description

@rtibblesbot

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

Overview

Publish reads an input or text entry answer as a number in several places, and decides which archives an exercise gets in another. They disagree, so an exercise can ship a numeric-input no answer satisfies, ship no Perseus archive older Kolibri can render, or list questions its package leaves out.

Complexity: Medium
Target branch: unstable

Context

Reproduced by publishing on unstable at 98b560e:

  • An exercise with a perseus_question and a legacy input question answered Sphere, +3, 1E3 or 1e400 publishes a Perseus archive only, with numeric-input answers [].
  • A native text entry answered 1_000, 1_0E3, ٥ or 5 derives a Perseus numeric-input with answers [], and ships in the QTI package too.
  • An exercise of only legacy multiple_selection and input_question items publishes a qti file and no exercise file; v2026.09.24 published a Perseus archive. test_legacy_items_without_perseus_question_route_to_qti_packaging asserts the current behaviour.
  • A unit whose pre/post test holds an input question answered "": the QTI package skips it, and the published pre_post_test still lists its id.

Number readers:

Routing and metadata:

The Change

  • One reader, Publish mixed exercises QTI only when Perseus can't read a legacy input answer #6273's format_number, should decide whether an answer is a number for Perseus export, QTI conversion, Perseus derivation and is_answerless_numeric_entry: finite xsd:double, ASCII digits only.
  • An exercise should get a Perseus archive when every item has a Perseus equivalent under that reader, and a QTI package when it holds a native QTI item or an item without one.

Acceptance Criteria

  • An exercise with a perseus_question and a legacy input question answered Sphere or 1e400 publishes a QTI package holding both, and no Perseus archive.
  • A text entry answered only 1_000 or ٥ is answerless and publishes in neither archive.
  • An exercise of only single_selection, multiple_selection, true_false or input_question items publishes qti and exercise files; one with a free_response item publishes qti only.
  • No published file holds a numeric-input with answers: [].
  • Every id in a published node's assessment_item_ids, and a unit's version_a_item_ids and version_b_item_ids, resolves to an item in its files.
  • test_exportchannel.py covers each case.

AI usage

rtibbles chose which issues to merge; Claude Code reproduced each case by publishing on unstable at 98b560e and drafted this issue, which merges #6263, #6276 and #6281.

Activity

  1. added theissue type on Oct 6, 2026
  2. changed the title [-][QTI] Older Kolibri can't render exercises of only legacy items published from unstable[/-] [+][QTI] Publish reads numeric answers inconsistently and routes exercises to the wrong archives[/+] on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions