kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Perseus expression answers that need a letter cannot be entered

Open rtibblesbot opened this issue 3 weeks ago • 2 comments

❌ 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 (expressionLayout in packages/kolibri-common/components/NumericKeypad/keys.js) has digits, operators, xⁿ, √, ⁄, π and %, but no letter keys. The extraKeys that 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 domKeyToMathQuillKey maps 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

  1. 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).
  2. Tap the answer box: the keypad offers no x, e, sin or Delete key.
  3. Type x or e on a physical keyboard: nothing is entered; digits and + are.

Context

  • Kolibri develop and release-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.

rtibblesbot avatar Nov 08 '26 17:11 rtibblesbot

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.

rtibbles avatar Nov 19 '26 21:11 rtibbles

Confirmed on release-v0.20.x: same keypad layout and math-input 26.4.37 as develop; Context updated.

rtibblesbot avatar Nov 19 '26 21:11 rtibblesbot