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

Geschlossen
#6,281 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Start with perseus_derive._accepted_values, extract_value, and PerseusExerciseGenerator._process_input_answers, then reproduce the issue using derive_perseus_item as described. Check the rendered perseus/input_question.json output and add coverage showing that non-xsd:double forms such as 1_000 and ٥ are handled as expected without producing an incorrect answer set.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

❌ 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

  • The editor rejects these forms; ricecooker-imported QTI items do not.
  • Related: #6222, #6224

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.

Vorherrschende Sprache
Python
Sterne
211
Forks
317
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
23

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus learningequality/studio

Alle Issues in learningequality/studio

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.