"Other LMSs are worse" is not a good defense of Moodle's UI
Tim Hunt
Posts made by Tim Hunt
Rather than making Quiz 2, can't you just let students have two attempts and Quiz 1?
You have indeed found a bug. Would you like to report it in the Moodle Tracker?
(Note to self, the bug is in question_variant_pseudorandom_no_repeats_strategy. The pseudo-random bit needs to include the quiz id or something like that.)
Some docs here: http://docs.moodle.org/23/en/Quiz_statistics_report, but acutally it does not explain.
I had to read the code, it seems to be testing whether Discriminative efficiency < 15%.
http://docs.moodle.org/dev/Quiz_statistics_calculations gives more details.
Try
global $PAGE;
print_object($PAGE->category);
print_object($PAGE->categories);
If you get an error, then "everything" must not have been initialised yet in your script, so try moving that code later. (I think the necessary initialisation happens in require_login).
In the Moodle UI, go to Admin -> Development -> XMLDB, and click the [Doc] link. That shows you the complete DB structure.