-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.0.1
Some bits of the core_question code was written before automatic class loading was a thing. Becuase of db/renamedclasses.php, we should be able to fix this in a backwards-compatible way.
I audited full search results for ^(abstract )?class in question. I ignored code within sub-plugins, and the backup folder.
Some priciples I am following here:
- classes which are designed to be used by calling code (e.g. question_bank, question_engine, question_display_options) are not renamed when being moved to a namespace. This allows any deprecation errors to be fixed just by adding a use statement.
- This restriction does not apply to classes which are designed to be use by overriding them. For example base classes for types of plugins, since the class name should only really be referenced in the extends statement, so easy to update.
I suggest the following class moves and renames:
Old class | New name | old file | comment |
---|---|---|---|
qformat_default | - | format.php | Hard to move because of mod_lesson horror. Leave for now. |
qformat_based_on_xml | \core_question\local\format\xml_format_base | format.php | |
core_question_bank_renderer | \core_question\output\renderer | renderer.php | |
question_behaviour | \core_question\local\behaviour\behaviour_base | behaviour/behaviourbase.php | |
question_behaviour_with_save | \core_question\local\behaviour\behaviour_with_save | behaviour/behaviourbase.php |
Work in progress ...
- has a non-specific relationship to
-
MDL-74923 Quiz: move all PHP classes into the classes folder - part 1
-
- Closed
-