-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
4.0
-
MOODLE_400_STABLE
In the qusestion bank 4.0 project, a lot of very old code was moved into new plugins, and improved a lot. And, the new API for those plugins interacting with te core question system is pretty nice.
However, the API for other bits of code wanting to inteact with the question bank was not sorted out. We need a proper API there.
For example, when certain core functionality moved into a plugin (e.g. qbank_preview) we ended up with core code having to call a helper in that plugin, to get the preview URL for a question. This violates Moodle's principles on https://docs.moodle.org/dev/Communication_Between_Components. qbank_customfields is another problem (see MDL-72752).
Some additional development information:
I remember we talked about doing it action based, eg question_bank::get_question_action($questionid, 'edit'); or question_bank::get_question_action(int $questionid, string $shortname): question_action, if an action can be used as an standard action, its an standard one, or else it can be a new one. I can think of creating a specialized class to handle this, kinda like question_edit_contexts.php
keep the main public API on the question_bank class, but as you say, putting the implementation details in a particular class seems like a good idea, so it becomes something like
class question_bank {
public function get_question_action(int $questionid, string $shortname): question_action
{ \core_question\local\question_action_manager::instance()->get_question_action(int $questionid, string $shortname); }}
- has a non-specific relationship to
-
MDL-84371 \core_question\local\bank\filter_condition_manager breaks component communication rules
-
- Open
-
-
MDL-82657 Question bank filteroptions 'show questions from subcategories': value not updated on page reload
-
- Closed
-
- is blocked by
-
MDL-75125 Add actions as a feature in qbank plugin base class
-
- Closed
-
- will be (partly) resolved by
-
MDL-78710 Simplify question form and import handling code
-
- Open
-
-
MDL-78829 Provide a method for qbank plugins to define arbitrarily-named columns
-
- Open
-
-
MDL-78815 Move question deletion code for plugins to event handlers
-
- Closed
-
-
MDL-78823 Implement qbank plugin enabled/disabled events
-
- Closed
-
- will help resolve
-
MDL-76155 Fix performance issue in question usage and last used columns
-
- Development in progress
-
-
MDL-84405 Add question bank filter - Last used
-
- Open
-