Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-2314

Matrix question: problems in compare_responses()

XMLWordPrintable

    • 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.

            mjollnir Penny Leach (Inactive)
            adrianeboyd Adriane Boyd (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.