h5p / h5p-blanks

9 stars 67 forks source link

HFP-3655 Improve a11y focus on "Check" and "Show Solutions" #129

Open otacke opened 1 year ago

otacke commented 1 year ago

When merged in, will introduce the same focus behavior that was introduced for Multiple Choice in HFP-3554: For both "Check" and "Show Solution" move the focus to the first answer. When calling showSolutions programatically, e.g. by a parent content type, the focus is not set.

note

There's a bug in H5P.Question that will make this pull request read a "dot" in between strings that are read to screen readers - fixed separately in https://github.com/h5p/h5p-question/pull/16, see HFP-3654

background

Currently, the behavior of Fill in the Blanks is inconsistent.

When clicking on "Check", the focus will be given to an invisible and non-tabbable element above the cloze in order to announce "Checking Mode" and to allow tabbing forward through the given answers.

When clicking on "Show solution", the focus will be set to the retry button (by H5P.Question). The input fields are disabled and non-tabbable, so here the user would need to navigate backwards (not tabbing) in order to learn about the correct solutions.