Does anyone understand Moodle's drag and drop JavaScript?

Re: Does anyone understand Moodle's drag and drop JavaScript?

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

When Moodle HQ was contemplating waht to move to when YUI went out of support, they looked at jQuery UI, but they found that the accessibility was not as good as the level of accessibility that Moodle aspires to.

It is not acutally that hard to implement drag drop. Damyon pointed me to this bit of recent code: https://github.com/moodle/moodle/blob/master/admin/tool/lp/amd/src/competencyactions.js#L539 showing that if you can use the new HTML5 drag-drop stuff (https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API). However, at the moment, it does not seem well enough supported for student-facing stuff (http://caniuse.com/#feat=dragndrop).

So, I am coding my own, based on some drag code that Sam wrote. When I am finished (if I get time between finishing this development task, and going on holiday) I will try to write up a summary of what I did. It is pleasingly little code, and I did write quite a good doc comment about how to use it.