> I am suggesting that it will be very hard to get question tags right.
You might be right. It appears the functionality itself is harder to do elegantly than I first thought. It's turning out to be hard to do with a) minimal changes to existing code b) while maintaining database compatibility with different databases and c) without using code that's just plain gnarly and therefore subject to derision upon review.
> But, don't expect your first attempt to be likely to be good enough to be integrated.
Hopefully those doing peer review will either offer suggestions on how to make it more elegant, or excuse the fact that bits may be less elegant than we'd like, partly because the RDMSs don't all have the functions we'd like them to have.
> Hence my suggestion to make this as much of a plug-in as possible.
I see that Quiz has a question bank class which inherits from (subclasses) question bank itself. I'm currently planning to inherit from that and inject the new object over the Quiz version of the class.
> In the mean time, if you can think of small ways to change Moodle core, so that plugins can have
> more control over how the question bank looks without core code changes, then please suggest them.
There is one major suggestion I've come across so far:
Column types can add joins to the query and can add fields to be selected. However, it's hardcoded that the only parameters that can be passed are category IDs, so you can list questions by category, and only by category:
list($catidtest, $params) = $DB->get_in_or_equal($categoryids, SQL_PARAMS_NAMED, 'cat');
$this->sqlparams = $params;
My suggestion is that just as column types can add to the select list and can add joins, also let them add parameters to be used in those joins.