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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.6, 2.4.3
    • 2.3.7, 2.4.4
    • Questions
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • 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.

    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.

      Attachments

        Issue Links

          Activity

            People

              jmvedrine Jean-Michel Vedrine
              timhunt Tim Hunt
              Tim Hunt Tim Hunt
              Dan Poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/May/13