There is a feature I want to develop. For this question, it does not matter what the feature is (but if you are curious, it is MDL-74610).
This feature fits into some bits of Moodle that were written a long time ago: mod/quiz/edit.php, associated JS, which I think is still in YUI, Ajax stuff there hitting mod/quiz/edit_rest.php, rather than wervices, not using templates, classes defined in files like mod/quiz/attemptlib.php, not the classes folder ...
I think that my new feature presents a good opportunity to clean up some or all of this mess, and I would like to do so, but I am also a bit apprehensive about what it would take to get this through Moodle's integration process, so I wondered if anyone had any advice?
My thinking is: it needs to be done a a series of small steps. And, probably those steps are:
- Move all the classes to the classes folder (I made MDL-74923 for that).
- Replace all HTML genearation in mod/quiz/classes/output/edit_renderer.php with templates (without, at this stage, doing many changes to the HTML produced).
- Rewrite associated YUI modules -> AMD (without, at this stage, changing the ajax)
- All the library code that currently powers edit_rest.php (and other places that are not currently ajax-y like quiz_add_questoin), consolidate that back-end code into mod_quiz\structure class (and deprecate old stuff)
- Replace edit_rest.php with services, built using the structure class, and update the JS to use them.
- ... then, and only then, might I start on the new feature.
(Not sure that list is in quite the right order, or the right items, but it is the best I have come up with so far.)