Cross XML format

Question formats ::: qformat_crossxml
Maintained by Daniel Thies
This input format plugin is a handy utility that converts questions from one question type to another.
Latest release:
124 sites
49 downloads
19 fans
Moodle 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 5.0

This plugin enables users to change types of some questions in the Moodle question bank by exporting the questions as Moodle XML format and importing with this format.

  • Short answer questions will be changed to single response multiple choice questions. The short answer questions should include alternate answers to serve as the distractors in the multiple choice questions.
  • Multiple choice questions  will be imported as short answer questions. The distractors of each multichoice question will serve as alternate (wrong) answers for the short answer question.
  •  Drag-and-drop into text questions will be conveted to Select missing words, and vice versa.
  • If the Drag-and-Drop Matching question type is installed, those questions will be converted to  the standard matching type, and standard matching will be converted to Drag and Drop. If it is not installed, thr regular matching questions will not be changed.
  • If All-or-Nothing Multiple Choice  is installed those questions will be converted to regular multichoice with more that one response. If it is not installed, they will be skipped. Each will be marked with percentage of possible correct responses checked or zero if an incorrect response is selected. You can create All-or-Nothing Multichoice questions from the standard ones using Import all or nothing format.
  • If OU multiple response is installed those questions will be converted to regular multichoice with more that one response. If it is not installed, they will be skipped. The new standard multichoice questions will be marked the same as the original OU Multiresponse questions would be.
  • Other types that support Moodle XML format should default to being imported without any changes.
Image files and feedback should be preserved by the transformations except where HTML question stems must  be converted to plain text stems.

Testing status

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Daniel Thies (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    Wed, Mar 14, 2018, 2:10 AM
    Approval issue created: CONTRIB-7215
  • Tim
    Fri, Apr 10, 2020, 5:27 AM
    "If OU multiple response is installed those questions will be converted to regular multichoice with more that one response. If it is not installed, they will be skipped. The new standard multichoice questions will be marked the same as the original OU Multiresponse questions would be." - this is only partially true. One of the main points of OUMR is how it awards partial credit when using 'interactive with multiple tries' behaviour. No other qtype can replicate that.
  • Przemek Kaszubski
    Sun, Mar 26, 2023, 3:28 AM
    I'd love to be able to convert between "Drag-and-drop into text" and "Select missing words", which are almost identical in editing (except for the "Unlimited" feature that can be activated in the former type). If the "Cross XML format" plugin continues to be developed, maybe this proposed new conversion option could be added..
  • Daniel Thies
    Sun, Apr 30, 2023, 1:41 AM
    Thank you Przemek for the suggestion I will try that when I get the chance.
  • Daniel Thies
    Sun, Apr 30, 2023, 3:09 AM
    Actually that was easy. Those two were actually develop together by OU so the conversion is trivial.
  • Przemek Kaszubski
    Sun, Apr 30, 2023, 7:26 PM
    Thank you, Daniel. What a great update ! Just tested the new version smile .
  • Przemek Kaszubski
    Sun, Sep 7, 2025, 6:34 PM
    Hello Daniel. I'd like to be able to block auto-conversion of Matching to Drag-and-Drop Matching, since we are gently phasing out the latter, though still keeping it installed (but unavailable) for some time. Is this possible? It seems to work like this with the All-or-Nothing MC format, where you only mention the import option via another plugin? Let me quote from your description:

    "If All-or-Nothing Multiple Choice is installed those questions will be converted to regular multichoice with more that one response. If it is not installed, they will be skipped. Each will be marked with percentage of possible correct responses checked or zero if an incorrect response is selected. You can create All-or-Nothing Multichoice questions from the standard ones using Import all or nothing format."

    In other words, there's apparently only one-way traffic that your plugin provides: All-or-Nothing MC => MC , but not the other way round.

    I'd like to achieve the same with Matching & Drag-and-Drop Matching - only from Drag-and-Drop to regular Matching, never the opposite.

    I will try to see if I can adjust the code for myself, but maybe you will have some suggestions?

    As a feature, in general, being able to control the conversions (which ones really apply and in which directions only) could be a valuable admin setting.

    Many thanks for any help. Best regards, Przemek
  • Przemek Kaszubski
    Sun, Sep 7, 2025, 6:58 PM
    PS. I'd think my custom solution would be to comment the entire function
    public function import_match($question)
    in /question/format/crossxml/format.php
    ?
    I will give this a try.
  • Przemek Kaszubski
    Sun, Sep 7, 2025, 8:41 PM
    PS2. My "fix" appears to do the trick in the sense that it forces Cross XML not to convert the Matching question into ddmatch, but it imports such questions as ordinary Matching, which may lead to needless duplicates of questions. Of course, I can take measures to be sure to only first export to the Moodle XML format those questions and types I really want to be converted, but this could be prone to human error and it would be nice to be able to restrict the use of Cross XML only to the cases that actually do convert, and avoid duplicating the regular Moodle XML import usage.

    HTH & kind regards,

    Przemek
  • Daniel Thies
    Mon, Sep 8, 2025, 1:37 AM
    Hi Przemek,
    If you want to prevent converting the matching questions you can change import_match to return null or modify the switch statement in import_question to return null.
    Daniel
  • Przemek Kaszubski
    Mon, Sep 8, 2025, 3:46 PM
    Thanks, Daniel. I'll look into these options soon smile
Please login to post comments