Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-6480

Import of multichoice questions in Moodle XML format doesn't use shuffle option. Fix included

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.6.3
    • 1.6.1
    • Questions
    • None
    • MOODLE_16_STABLE
    • MOODLE_16_STABLE

      The Moodle XML import (1.6.1+) for multichoice questions does not take into account if
      <shuffleanswers>1</shuffleanswers>
      exists in XML file. The problem is in function import_multichoice in format/xml/format.php.
      I took the code from import_matching function in that file. The diff is shown below and resolves the problem.

      — format.php 2006-09-07 14:12:24.124627200 +0200
      +++ format.php.2 2006-08-27 14:15:39.515446400 +0200
      @@ -120,15 +120,10 @@

      // 'header' parts particular to multichoice
      $qo->qtype = MULTICHOICE;
      $single = $question'#'['single'][0]'#';
      $qo->single = $this->trans_single( $single );

      • if (!empty($question'#'['shuffleanswers'])) { - $qo->shuffleanswers = $question['#']['shuffleanswers'][0]['#']; - }

        else

        { - $qo->shuffleanswers = false; - }

      // run through the answers
      $answers = $question'#'['answer'];
      $a_count = 0;
      foreach ($answers as $answer) {

            timhunt Tim Hunt
            fikar Miroslav Fikar
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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