-
Bug
-
Resolution: Fixed
-
Major
-
2.7.2
-
MOODLE_27_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
The way that question types with internal randomisation (e.g. calculated, variable numeric, STACK, ...) normally work is this:
- They implement get_num_variants() to say how many variants they have.
- Then when Moodle starts the question, it tells the qestion which variant to be.
- And based on that, the question sets itself up.
- Later, when we do quiz statistics, the statistics can be broken down by variant number.
However, sometimes, what happens and steps 2 & 3 is quite complex, and once the question is set up, it is possible to determine that it is actually equivalent to another variant. (The example I have is qtype_opaque.)
In this case, it would be helpful to be able to update the variant number, to give better statistics. (Once the question has used the variant number to initialise itself, the variant number is purely informative. Everything that affects the internal state of the question is stored in the first step, and those stored values are what is re-used, not the varant number, when the question needs to be restored to the same state.)