Should this be of interest to anyone, I have found answers to my questions, though they do not seem very satisfactory.
The
database table responsible for the order of question types is mdl_config_plugins . In the newer Moodles (3 and above) the first six positions in the table are the six "privileged", most common question types:
1 question multichoice_sortorder 1
2 question truefalse_sortorder 2
3 question match_sortorder 3
4 question shortanswer_sortorder 4
5 question numerical_sortorder 5
6 question essay_sortorder 6
By default only these six are explicitly listed in the table, and produce the "sticky" effect that resists alphabetisation.
Unfortunately, once the admin makes ANY changes to the default order of the question types on the /admin/qtypes.php page, all the other (core or external plugin) question types are appended to the table at the end . This effectively imposes the admin order across the board and removes any secondary **localised** alphabetic auto-arrangement. Only the one fixed manual order set by the admin is now effective :/ .
The \question\engine\bank.php file says the following when commenting on the sort_qtype_array function:
" * Sort an array of question types according to the order the admin set up,
* and then alphabetically for the rest. "
However, it appears that "alphabetically for the rest" will not work once the admin starts making changes. Everything is manual only.
There is no reset button on the UI qtypes.php interface page to revert the changes
. The only solution is to:
- restore 1-6 ordering to the first six "popular plugins" using the /admin/qtypes.php page
- (possibly choose any other "sticky" types for positions 7 and later)
- then delete from the database table any other question type sortorder entries, so that (localised) alphabetic ordering can apply to them again (I think that if someone does NOT want ANY sticky items on the question types list, removing the first six entries will do the trick)
- IMPORTANT: purging the caches on the /admin/purgecaches.php page
The above characterises sites first installed as Moodle 3.0 or later versions.
On UPGRADED sites that began, for example, with Moodle 2.6, there are NO sticky question types listed in the mdl_config_plugins table. The listing is originally alphabetic throughout, and respects localisattion.
I have NOT tested this, but I would assume that the sticky question types favourites effect could be set manually by:
- manipulating the order of the questions types on the /admin/qtypes.php page
- then going to the database and the mdl_config_plugins tabel and deleting all those xyz_sortorder entries we do NOT want to be stickies but always arranged alphabetically by the local name, underneath the sticky items.
- purging the caches on /admin/purgecaches.php
In short, it is possible to resolve my issues if we have both admin UI AND
phpMyAdmin etc. access to the Moodle database. Not ideal..
ERGO, those of us working on multi-language Moodle sites should think twice before customizing the question types list, and perhaps avoid touching it whatsoever if we don't have direct database access (needed to restore / control localised sorting of quiz question types).