Skip to content

Older-Kolibri Perseus export of a QTI Text entry item answered 1_000 or ٥ has no answers #6281

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.

Target branch: unstable

Observed behavior

perseus_derive._accepted_values keeps any answer Python float() reads as finite. float() also reads forms that are not xsd:double:

  • digit separators: 1_000, 1_0E3
  • non-ASCII digits: ٥, 5

extract_value rejects these, so PerseusExerciseGenerator._process_input_answers drops them. The derived Perseus item ships "answers": [].

Errors and logs

None. No warning is logged.

Expected behavior

_accepted_values accepts only xsd:double values (ASCII digits, no _), so an item whose only answers are these forms is answerless and publishes in neither archive.

User-facing consequences

Learners on older Kolibri get an input question that marks every answer wrong.

Steps to reproduce

  1. derive_perseus_item(_Item(_text_item("single", ["1_000"]))) — answers ["1_000"].
  2. Pass them through _process_input_answers, then render perseus/input_question.json.
  3. The numeric-input 1 widget has no answers.

Same for ["٥"].

Context

AI usage

Drafted by Claude Code during review of #6224. Reproduced on unstable with a script calling derive_perseus_item, _process_input_answers and the template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions