Skip to content

Read and show Numeric answers in the exercise language - #6282

Open
rtibblesbot wants to merge 3 commits into
learningequality:unstablefrom
rtibblesbot:issue-6198-22d404
Open

rtibblesbot wants to merge 3 commits into
learningequality:unstablefrom
rtibblesbot:issue-6198-22d404

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Numeric answers are read in the exercise language's separators, grouping and digits (fallback: channel language, then UI language)
  • Stored as xsd:double; shown in that language without grouping
  • The invalid-number message gives its examples in that language

References

Fixes #6198. Headless mismatch: #6150. Vendored from: kolibri numeralNormalization.js

Reviewer guidance

QTI editor mounted with language set:

State Before After
fr, stored 1234.5 and 30 Before fr view After fr view
ar-EG, same item Before ar-EG view After ar-EG view
fr, typing 1,5 (stores 1.5) Before fr edit After fr edit
State Screenshot
fr, invalid 1,2,3 After fr error

axe: one color-contrast violation on "Add acceptable answer", same on unstable.

Open questions:

  • In a comma-decimal language, . falls back to xsd:double (French 1.5 stores 1.5) unless the language groups with .; German 1.5 is rejected inline but stored raw, so headless validation passes it.
  • Grouping ignores Intl's minimum grouping digits, so Spanish 1.234 reads as 1234.

On a language change, unedited answers save as stored, even if the new language reads them differently (German 1,2).

QA steps

Setup: in a channel, add an exercise with Language (under Audience on Details) set to Français (fr) and two Numeric questions: Q1 with 1,5, 1234,5, -3,25; Q2 with 12000,5, 0,75.

  1. On the exercise's Questions tab, tick Show answers and open Q1, then set Language on Details to English (en) and open Questions: open Q1 reads 1.5, 1234.5, -3.25 and closed Q2 12000.5, 0.75 where French showed 1,5 … 0,75, with no validation message. Open Q2, Add acceptable answer 1,2, set Language to Deutsch (de) on Details and open Questions: Q2 shows 1,2 as typed with "Must be a valid number (e.g. 12; 0,5; -3,14)", the other answers in comma form.

Evidence

Change the exercise language with stored Numeric answers

Step Screenshot
French: open Q1 reads 1,5, 1234,5, -3,25 French: open Q1 reads 1,5, 1234,5, -3,25
English: Q1 still open, reads 1.5, 1234.5, -3.25; Q2 12000.5, 0.75; no errors English: Q1 still open, reads 1.5, 1234.5, -3.25; Q2 12000.5, 0.75; no errors
German, both closed: 1,5, 1234,5, -3,25; 12000,5, 0,75 German, both closed: 1,5, 1234,5, -3,25; 12000,5, 0,75
English: 1,2 typed in Q2, flagged with English examples, Q2 Incomplete English: 1,2 typed in Q2, flagged with English examples, Q2 Incomplete
After the fix, German: 1,2 kept as typed, flagged with German examples After the fix, German: 1,2 kept as typed, flagged with German examples
s5-language-switch-flow.webm
More captures (3)
Step Screenshot
French, both closed, Show answers ticked: Q1 1,5, 1234,5, -3,25 French, both closed, Show answers ticked: Q1 1,5, 1234,5, -3,25
German: Q2 open, 0,75 changed to 1.234,8 German: Q2 open, 0,75 changed to 1.234,8
English: Q2 open, reads 12000.5, 1234.8 English: Q2 open, reads 12000.5, 1234.8

AI usage

Claude Code planned and implemented the change from the issue's rules. Verified with the QTIEditor and channelEdit Jest suites, pre-commit, and screenshots of the editor in a headless browser.

🤖 Generated with Claude Code


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks
@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-10-03 04:34 UTC

numerals.js vendors Kolibri's numeral normalization helpers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rtibblesbot
rtibblesbot marked this pull request as ready for review October 3, 2026 03:57
@rtibblesbot
rtibblesbot requested review from a team and leq-bot October 3, 2026 03:57
rtibblesbot and others added 2 commits October 2, 2026 20:58
Display uses the language's separators and digits; the XML keeps canonical xsd:double.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Falls back to the channel language, then the UI language.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[QTI] Read and display Numeric answers using the exercise language's number conventions

1 participant