Skip to content

Commit 392a0fa

Browse files
committed
Add keyboard controls for drag and drop problems.
This is for problmes that use the `dragndrop.js` JavaScript and the `DragNDrop.pm` module via the `draggableProof.pl` and `draggableSubsets.pl` macros. The elements in a drag and drop list can now be focused using tab and shift-tab. Once focused the arrow keys move the elements around. If an element is moved with the keyboard controls the changes are announced in a visually hidden span. Note that drag and drop actions via the mouse cursor are not aria announced for now. I am assuming that a screen reader user would not be using the mouse for drag and drop. There is now also a "Drag and Drop Help" button that is shown below the drag and drop lists. If pressed, help is shown describing the keyboard controls. This help can be customized by the problem. There are new options for the macros that allow for customizing the help and associated texts. See the updated POD in the module and macros for details. Also, I don't like that there are some options that are for the `DragNDrop.pm` package that are passed in from the macros, but are different in the macros than in the module. Basically the first letter is upper case in the macros, but lower case in the module. So the upper case first letter variants is deprecated (but will still work with a compatibility layer). I don't like that the macros use Pascal case to begin with for options. Options should be camel case. Note that I also made all of the texts for the drag and drop object translatable via `maketext`. The texts can be customized per problem as mentioned above, but if only a translation is needed there is no need for such customization.
1 parent 9c53e04 commit 392a0fa

5 files changed

Lines changed: 609 additions & 140 deletions

File tree

0 commit comments

Comments
 (0)