kolibri
kolibri copied to clipboard
Perseus expression answers that need a letter cannot be entered
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: release-v0.20.x
Observed behavior
- The expression keypad (
expressionLayoutinpackages/kolibri-common/components/NumericKeypad/keys.js) has digits, operators,xⁿ,√,⁄,πand%, but no letter keys. TheextraKeysthat the expression widget passes in its keypad configuration (e.g.x,e) are never rendered. - A hardware keyboard enters nothing for letters: math-input's
domKeyToMathQuillKeymaps only digits,+ - * / . % = > < ^ _and Backspace (26.4.37 on develop, 28.0.0 on #15139's branch). - So an expression item whose answer contains a variable or function can only be answered wrong.
- The expression keypad has no Delete key, so on a touch device a typo cannot be erased.
Expected behavior
- Learners can enter every symbol an expression item's answer forms use, on the keypad and from a hardware keyboard.
User-facing consequences
- Learners cannot answer calculus, trigonometry or algebra expression items correctly, and are scored wrong on them in practice and in coach quizzes.
Steps to reproduce
- Import the Kolibri QA Channel; as a learner open Exercises → l10n → "Quiz sur les dérivées de sin x, cos x, tan x, eˣ et ln x" (answers
\cos(x),-\sin(x),\sec^2(x),e^x,1/x). - Tap the answer box: the keypad offers no
x,e,sinor Delete key. - Type
xoreon a physical keyboard: nothing is entered; digits and+are.
Context
- Kolibri
developandrelease-v0.20.x(same keypad, math-input 26.4.37); also on #15139's branch (Perseus 87.2.2, math-input 28.0.0). - Chromium, 400px and 1280px viewports.
- Regression of #2616 (keypad lacked an item's variables).
- Hardware-keyboard letters go through the same key handler as #15636 (punctuation and non-ASCII digits).
Acceptance Criteria
- [ ] Each QA-channel derivatives item above can be answered correctly using only the on-screen keypad, and scores correct.
- [ ] The same answers can be typed from a hardware keyboard and score correct.
- [ ] The expression keypad can delete the character before the cursor.
- [ ] Number-only (input-number / numeric-input) keypads are unchanged.
AI usage
Claude Code found this while running manual QA on #15139's branch, traced it to the keypad layout and math-input's key map, and drafted this issue.
Retargeted to release-v0.20.x: expression items whose answers need a letter are always scored wrong, so 0.20 should not ship with this.
Confirmed on release-v0.20.x: same keypad layout and math-input 26.4.37 as develop; Context updated.