Question types: Drag-and-Drop Matching

Maintained by Picture of DualCube Team DualCube Team
Question type similar to the matching question type but with a drag and drop interface for the students during attempt.
2907 sites
54 fans

Created by Adriane Boyd during 2007 Google Summer Of Code, the drag and drop matching question type is quite similar to the matching question type found in standard Moodle, differences are:

  • during question creation/edition of drag and drop matching questions, an editor is available for each answer (in standard matching question this is not possible because these elements are displayed inside a select menu during question attempts)
  • during question attempts a drag and drop interface is displayed and the student must drag each right element on the correct spot on the left.


This plugin is part of set Seeking new maintainer.


Screenshot #0


Picture of DualCube Team
DualCube Team (Lead maintainer)
Picture of Jean-Michel Védrine
Jean-Michel Védrine: Previous maintainer
Picture of Adriane Boyd
Adriane Boyd: Original author
Picture of Andrew Nicols
Andrew Nicols: Javascript upgrade to YUI3
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of DualCube Team
    Tue, 30 May 2017, 2:15 PM
    Hi Konrad,

    Unfortunately, this plugin supports Moodle V2.4.1 to moodle V3.2. There is no support for V2.2.
    You can update your moodle from your version to latest version i.e., 3.2. After the Moodle up-gradation you can install the this version of Drag-and-drop Matching.

    Let me know for any further clarification.

    Thanks and Regards,
  • Picture of Jean-Michel Védrine
    Tue, 30 May 2017, 3:17 PM
    Hello Konrad and DualCube Team,
    I am not sure that Dualcube Team solution will work, here is why : In Moodle 2.2 there was a big change : Tim Hunt completely changed the question engine and to take this into account all question type have an upgrade script to upgrade their data to the new question engine. Fortunately I have added this kind of script to the ddmatch question type (it is in question/type/db/upgradelib.php) But I don't know if it will be executed after upgrading to Moodle 3.2 when Konrad will install the new version of ddmatch.
    So my best advice is NOT to do this on your production server because there is a risk to loose all existing ddmatch data ! You need to Install a copy of your server and test if the upgrade is successful on this copy first. If it works then you can do the upgrade on your production server.
    I tried to look if I can find any old version of ddmatch for Moodle 2.2 but my search was unsuccessful and I can't remember what I did when I upgraded to Moodle 2.2 (this is several years old and my memory is not good sad ).
    If this method doesn't work the only way to solve Konrad's problem would be to start from the oldest version of ddmatch in my github ( and edit it so that it can work with Moodle 2.2. This would surely be doable but would require some knowledge of the changes between Moodle 2.2 and 2.4 (only minor changes if I remember correctly), of course you will also need to edit version.php so that Moodle 2.2 accept this version of the plugin.
    Unfortunately I am not able to do this work.
  • Germán and temudgin
    Fri, 11 Aug 2017, 8:25 AM
    There is a Moodle Docs page for this question type at . Please feel free to add/remove/change it as needed.
  • Picture of DualCube Team
    Thu, 17 Aug 2017, 8:36 PM
    Thanks for letting us know German, we will definitely do the needful in the near future as and when needed smile

  • Picture of Dipali Thakkar
    Fri, 18 Aug 2017, 9:09 PM
    Where can I find the Spanish version for this plugin?
  • Picture of DualCube Team
    Tue, 29 Aug 2017, 7:37 PM
    Hi Dipali,

    Thanks for reaching us. We have no such type of extension for the plugin, you can do either point 1 or 2.

    1.Please go to Dashboard / ► Site administration / ► Language / ► Language customisation / ► choose your language / ►click the button "Open language pack for editing" / ► click the button "Continue" / ►select "qtype_ddmatch.php" / ► add "your text" into the box of "Local customisation" / ►then click the button "Save changes to the language pack".

    2.Please go to "Your moodle directory"/question/type/ddmatch/lang/en folder copy the qtype_ddmatch.php file then back to "lang" folder and create an folder named as "es" then paste the file into "es" folder. After that replace all the string with Spanish language.

    Thanks and Regards,
  • Picture of Mathieu Domingo
    Thu, 1 Mar 2018, 4:50 PM
    I had an error when trying to duplicate a quiz : error/error_qtype_ddmatch_subquestion_missing_in_db
    This was thrown by question/type/ddmatch/backup/moodle2/restore_qtype_ddmatch_plugin.class.php function process_match($data)

    After investigation, $data->questiontext value was something like $@PAGEVIEWBYID*12345@$ instead of http://mywebsite/mod/page/view.php?id=12345 in the database which explain why the test if(!isset($this->questionsubcache[$data->questiontext][$data->answertext])) failed

    I patched it like that :
    if (!isset($this->questionsubcache[$data->questiontext][$data->answertext])) {
    $data->questiontext=preg_replace($pattern, $replacement, $data->questiontext);
    $data->answertext=preg_replace($pattern, $replacement, $data->answertext);

    if (!isset($this->questionsubcache[$data->questiontext][$data->answertext])) {
    throw new restore_step_exception('error_qtype_ddmatch_subquestion_missing_in_db', $data);

    This patch seems to work, but i don't know why my $data contains bad data :s. Have you any idea of the origin of this "value" $@PAGEVIEWBYID*12345@$ ?
    If i have time i will try to investigate more, but it was also looking like it goes through all questions of all quiz in the course to duplicate only one quiz with two question (which was not looking efficient when there is a lot of small quiz in the course :s)
  • Picture of Jean-Michel Védrine
    Thu, 1 Mar 2018, 8:21 PM
    Hello Mathieu,
    These bad data were created by a backup/restore or duplicate problem.
    @PAGEVIEWBYID and a lot of other expressions surrounded with @ are used during backup/restore
    Most probably the faulty questions come from another Moodle course or from a restored course, and of course these expressions should have been decoded during restore.
    So i don't understand why these data were left undecoded in the question text.
  • Picture of Ravi Kumar
    Tue, 12 Jun 2018, 9:37 PM
    Hi Guys,
    I have problem with drag and drop matching plugin.
    If my answer already placed in front of question and I submit the quiz in this case it showing message "Your answer is incorrect".
    Ex. My question have 2 options
    If by default question populate like this

    Question1 = Answer1
    Question2 = Answer2

    After submission it is always showing "Your answer is incorrect." while my answer is correct.

  • Picture of DualCube Team
    Thu, 14 Jun 2018, 7:59 PM
    Hi! Ravi,
    Thanks for getting in touch with us. Unless you drag and drop an answer, it won't take an answer by itself.
    So, you have to drag the right or wrong answer and drop it at the dropping field so that it recognizes what you have selected.
    Thank you.
  • Picture of Marcus Green
    Mon, 21 Jan 2019, 6:22 PM
    Is that screenshot from this question type? It looks like one from a core/ou question type. There are some that look more like it on this page
  • Picture of Jean-Michel Védrine
    Mon, 21 Jan 2019, 8:42 PM
    Yes I think that Marcus is right, this image has nothing to do with that plugin. I don't know who contributed to it but I will remove it and replace it with one from the documentation page.
  • Picture of Jean-Michel Védrine
    Mon, 21 Jan 2019, 8:45 PM
    Oops, I don't have the right to edit that page anymore (quite logical as I stopped maintaining this plugin) so I am unable to change that image!
  • Picture of DualCube Team
    Tue, 22 Jan 2019, 9:00 PM
    Dear Marcus,
    We are sorry for the delayed response. The screenshots are from this plugin: Thank you.
  • Picture of harshak jf
    Thu, 7 Feb 2019, 4:45 PM
    Thanks for the blog......... Xender
1 2 3 4 5 6
Please login to post comments