-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
1.9.9
-
None
-
MOODLE_19_STABLE
In adaptive mode, second and subsequent responses to a matrix question type aren't saved/graded in a number of cases because the compare_responses() comparison is insufficient. Just comparing the array values doesn't do the right thing for either multiple answers or single answer mode. I thought briefly that just multiple answer mode was buggy, but there's also a subtle bug in non-multiple answer mode: if you have a 2x2 matrix and switch from one diagonal to the other, the question also isn't saved/graded because you still have the same set of responses, in this case
{1,2}.
If multiple options aren't allowed, I think you need to compare key-value pairs with array_diff_assoc.
If multiple options are allowed, I think comparing the array keys does the right thing.
I've attached a patch that does this.