-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.4.1
-
MOODLE_404_STABLE
This is a follow up of MDL-81075 to capture some ideas for improvements to the "sticky" question defaults feature.
Problems identified
- The way
MDL-70895works is not obvious to a user. - There needs to be a way to opt out of
MDL-70895behaviour.
Proposed solutions:
- In the case where
MDL-70895has taken effect (we are creating a new questions, and at least one default value was loaded from a previously saved user preference) - display an appropriately styled message (alert-primary?) at the top of the question form. E.g. "Some settings in this form were automatically set to the values you used the last time you created a question of this type". - In that alert, we can also include some UI to toggle that behaviour. Is there a standard for this in Moodle? I suggest a simple link, but it could be a form no-submit button. Something like "Do not remember the question settings I use".
- Clicking that link togles a new user perference (core_qusestion, rememberquestiondefaults).
- get_default_value is updated, so that it only loads defaults from user preferences i the rememberquestiondefaults is true (default true).
- If rememberquestiondefaults is false, then the message at the top of the form instead says something like "Moodle can save you time remembering the value of key settings, so that when you create a new question of the same type, the same settings are use. However, this option is currently disabled." With a link/button "Remember the question settings I use".
- If thought necessary, there could also be a help icon here, to give a longer explanation of the feature.
Bonus problem
There is no way to clear the preferences that have been set for question defaults (because there is nothing strictly linking the user preference to a question form field). And there is possibly a subtle bug where the question code could overwrite an existing preference that a plugin uses (see this comment). Possibly the feature shouldn't use user preferences at all, and instead maintain its own table for tracking these defaults.