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

Chiusa
#6,281 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
211
Fork
317
Merge medio
4g 10h
PR unite (30g)
25

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di learningequality/studio

Tutte le issue di learningequality/studio

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.