numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
197 stars 118 forks source link

WCAG 1.4.13: floating warnings for answer inputs must be dismissable #1031

Closed christianp closed 10 months ago

christianp commented 10 months ago

At the moment a floating box showing warning messages appears when you focus an answer input.

I think that pressing Esc should hide the floating warning box. They should reappear when the input is focused again.

itlallou commented 10 months ago

Hello!I'd like to contribute to this issue

christianp commented 10 months ago

@itlallou thanks for offering to help! Please look at our guidelines on contributing to Numbas.

I think that we can implement this by adding a case for the escape key to the PartDisplay's inputEvents keypress handler, which would call the PartDisplay's hideWarnings method.

christianp commented 10 months ago

Actually, I've just tried this and the keypress needs to change to keyup - the Escape key doesn't produce a keypress event.

christianp commented 10 months ago

Fixed by #1035.