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

GIFT and XML question export - do no write any data to the export for unsupported qtypes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.6, 2.4.3
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a question category containing one multianswer question, and one true-false question.
      2. Export that category in GIFT format.
      3. Verify that the export file contains only the T/F question and only a comment line begining with double slash for the multianswer question
        no line with <div class="notifyproblem"> HTML tag should be present at the begining of the file.
      4. Verify that importing back the file in another category only import a T/F question with no warning or error message.

      testing Moodle XML export is a little more difficult as all core question types are supported by XML export, so we will remove XML export for multianswer questions to be able to do the test.

      1. edit the question/format/xml/format.php file and remove or comment lines 1255-1259

                    case 'multianswer':
                        foreach ($question->options->questions as $index => $subq) {
                            $expout = preg_replace('~{#' . $index . '}~', $subq->questiontext, $expout);
                        }
                        break;
        

      2. use the same question category that for testing Gift export with one multianswer question, and one true-false question.
      3. Export that category in Moodle XML format.
      4. Verify that there is no line with <div class="notifyproblem"> HTML tag present at the begining of the file and that the export file contains only the T/F question
      5. Verify that importing back the file in another category only import a T/F question with no warning or error message.
      Show
      Create a question category containing one multianswer question, and one true-false question. Export that category in GIFT format. Verify that the export file contains only the T/F question and only a comment line begining with double slash for the multianswer question no line with <div class="notifyproblem"> HTML tag should be present at the begining of the file. Verify that importing back the file in another category only import a T/F question with no warning or error message. testing Moodle XML export is a little more difficult as all core question types are supported by XML export, so we will remove XML export for multianswer questions to be able to do the test. edit the question/format/xml/format.php file and remove or comment lines 1255-1259 case 'multianswer': foreach ($question->options->questions as $index => $subq) { $expout = preg_replace('~{#' . $index . '}~', $subq->questiontext, $expout); } break; use the same question category that for testing Gift export with one multianswer question, and one true-false question. Export that category in Moodle XML format. Verify that there is no line with <div class="notifyproblem"> HTML tag present at the begining of the file and that the export file contains only the T/F question Verify that importing back the file in another category only import a T/F question with no warning or error message.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:

      Description

      To reproduce:
      1. Create a question category containing one multianswer question, and one true-false question.
      2. Export that category in GIFT format.

      Expected result: an export file containing only the T/F question.

      Actual results: export file containing the T/F question, and a broken representation of the multianswer question.

      See also https://tracker.moodle.org/browse/MDLQA-5340.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/May/13