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

Ordering question export to XML ignores some options

XMLWordPrintable

      When exporting a question of type qtype_ordering in XML format, several question options are either ignored or incorrectly set to empty. As a result, when the question is re-imported, the options are incorrect.

      The exported XML should contain values for layouttype, selectedtype, gradingtype, and showgrading, but these values are not set during export. This causes issues upon import. For example, if a question is created with four draggable items and default options, then exported and re-imported, only two of the original four items will be displayed.

      During export, the default option is "Select all items" (selectedtype=0), meaning all items should be displayed. However, since the selectedtype value is missing in the exported XML, it is automatically set to "Select a random subset of items" (selectedtype=1) during import, with a default selectcount value of 2, causing only two items to be displayed instead of all four.

      Steps to Reproduce

      1. Create a course.
      2. Create a quiz.
      3. Add an ordering question to the quiz with a question name, question text, and more than two draggable items (e.g., A, B, C, D).
      4. Leave all other options as default, including "Item selection type" set to "Select all items."
      5. Save the question.
      6. Open the question and confirm that all four draggable items are available for ordering.
      7. Export the question in XML format from the question bank.
      8. (Optional) Open the exported XML file and confirm that layouttype, selectedtype, gradingtype, and showgrading fields are empty.
      9. Import the question back into Moodle.
      10. Open the question in preview mode.
      11. Confirm that only two of the original four items are displayed, which is incorrect.
      12. Open the question for editing.
      13. Confirm that the "Item selection type" option is now incorrectly set to "Select a random subset of items."

      Expected Behavior

      • The exported XML should correctly store the values for layouttype, selectedtype, gradingtype, and showgrading.
      • Upon re-import, the question should retain its original settings, including displaying all draggable items.

            olivabigyo olivabigyo
            olivabigyo olivabigyo
            Jayce Birrell Jayce Birrell
            Tim Hunt Tim Hunt
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 3 minutes
                2h 3m

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