Note: You are currently viewing documentation for Moodle 3.8. Up-to-date documentation for the latest stable version of Moodle may be available here: Drag and drop onto image question type.

Drag and drop onto image question type: Difference between revisions

From MoodleDocs
No edit summary
 
(40 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Questions}}
{{Questions}}
This page is about the [https://moodle.org/plugins/view.php?plugin=qtype_ddimageortext drag and drop into image question type], which is a popular form of 'selection' question consisting of images or words which can be dragged from a list and dropped into pre-defined gaps on the base image.


This is a question type created and maintained by the [[:Category:Open University|Open University]] and is available from the [https://moodle.org/plugins/pluginversions.php?plugin=qtype_ddimageortext Moodle plugins database]
This question type allows students to drag words, images or both from a list and drop them into pre-defined gaps on a base image.


==How to create a question==
==How to create a question==
*Give the question a descriptive name to help you find it in the question bank. (Students won't see the name.)
Give the question a descriptive name to help you find it in the question bank. (Students won't see the name.)
*Add the question to the text editor, using any formatting you wish.
*Click the Background image button to upload an image. Larger images will be displayed at a maxiumum 600 x 400.Your image will then display under the file upload box.
*In the '''Draggable items''' section, you can upload images if you leave the type as 'draggable image' or you can type in words if you change the type to 'draggable text'. You may have a mixture of images and text.


==Procedure==
Add the question to the text editor, using any formatting you wish.
Start by uploading a background image. There is a maximum size of 600 x 400 pixels for this image. Please note that we recommend a maximum image width of 570 pixels so as to fit all parts of an iCMA into a 1024 wide window. When you have done this it will appear in the preview area.  


[[File:DandD onto image draggable items.png|600px]]
In the '''Preview''' section, click the background image button to upload an image. Larger images will be displayed at a maximum 600 x 400. Your image will then display under the file upload box.


Next create the drag items. These may be text items as shown here, or images. There is a maximum import size for images of 150 x 100 and images larger than this will be scaled on import. If you choose to use draggable images please ensure that you add a short text descriptor. For each item having entered the text please press Enter to complete the addition of the draggable item and register it in the drop-down lists of Drop zones.
In the '''Draggable items''' section, you can upload images if you leave the type as 'draggable image' or you can type in words if you change the type to 'draggable text'. You may have a mixture of images and text.


Now place the drag items onto the background image by completing the Drop zones section above. Once you have established the draggable item for a drop zone the item will appear beneath the background image. At this point you may position the item either by dragging it or by completing the Left and Top boxes for the item.
In the '''Drop zones''' sectionyou choose which items to go in which zone. Click the 'Refresh preview' button.


The drag item will be placed at the top and left coordinates as measured in pixels from the top left of the background image.
You can then position the items on the background image and this will add their coordinates.


Within draggable text items limited formatting of text using <nowiki> <sub>, <sup>, <b>, <i>, <em> and <strong> is allowed. <br/> </nowiki> is also allowed.
Note:(1) Draggable images cannot be more than 150 x 100 pixels. If they are larger, they will be scaled on import. Remember to add a short text descriptor too. If you change your mind about an image, simply upload a diferent one to replace it.


Choices that are within the same Group are colour coded and may only be dropped on a drop zone with the corresponding colour. Choices that are marked as 'infinite' may be used in multiple locations.
Note (2) You can format draggable  text using <nowiki> <sub>, <sup>, <b>, <i>, <em>,  <strong> and <br/> </nowiki>


The resulting question when run in 'interactive with multiple tries' style looks as follows:
Note (3)  Choices that are within the same Group are colour coded and may only be dropped on a drop zone with the corresponding colour. Choices that are marked as 'Unlimited' may be used in multiple locations.


[[File:ddimageexample.png|600px]]
===Example one===
''Based on the Moodle documentation '''[[Pedagogy]]''', participants must 'climb the Moodle ladder' by ordering the stages of using Moodle as a teacher.''
 
In the '''Preview''' section, a basic image of steps is uploaded.
 
In the '''Draggable items''' section, the 'type' is chosen as 'draggable text' and the text for each stage is added. (Groups and the Unlimited setting are not used in this example)
[[File:imagedragdropdraggabletextu.png|thumb|center|500px]]
In the '''Drop zones''' section, an item from the previously added options is chosen from the drop down:
[[File:choosingdropzonetext.png|thumb|500px|center]]
These texts will now appear under the background image:
[[File:imagedragdroptextpreview.png|thumb|500px|center]]
The text boxes are dragged to their correct positions on the image (steps on the staircase) This will then add the co-ordinates to the Dropzones section automatically:
[[File:imagedragdropdropzonescoords.png|thumb|500px|center]]
Other settings are completed (see below) and the question is saved.
 
Participants must drag the Moodle stages to the correct step:
[[File:climbthemoodleladder.png|thumb|center|500px]]
 
===Example two===
''Participants must add the correct country flag and capital city onto a map of Europe.''
 
This question has images as well as text and makes use of the Groups feature.
 
In the '''Preview''' section, a basic map of Europe is uploaded.
 
In the '''Draggable items''' section, the capital cities are added as the type 'draggable text' and the flags are added as the type "draggable image"
 
 
[[File:dragtextimageflagsu.png|thumb|center|600px]]
 
All draggable images  (the flags) are in Group 1 and all draggable text items (the capital cities) are in Group 2.
 
In the '''Drop zones''' section, an item from the previously added options is chosen from the drop down. The Group 1 boxes will display in a different colour from the Group 2 boxes.
 
When the boxes are dragged to their appropriate places on the background image, the coordinates in the Drop zones section are updated automatically.
 
Other settings are completed (see below) and the question is saved.


==Accesibility==
Drag and drop questions are keyboard accessible. Use the <tab> key to move between the drop zones and the <space> key to cycle around the possible choices for each drop zone.


==Scoring==
[[File:dragddropimageflagcity.png]]
All gaps are weighted identically and in the above example each drop zone is worth 12.5% of the marks. Only drop zones that are filled correctly gain marks. There is no negative marking of drop zones that are filled incorrectly.


[[File:DandD onto image combined feedbacks.png|400px]]
==Scoring and feedback==
All gaps are weighted identically. Only drop zones that are filled correctly gain marks. There is no negative marking of drop zones that are filled incorrectly.


Whether or not Combined feedback is shown to students is governed by the Specific feedback setting on the iCMA definition form.
Whether or not Combined feedback is shown to students is governed by the Specific feedback setting on the quiz settings form.


[[File:DandD onto image multiple tries.png|400px]]


'''Penalty for each incorrect try''': The available mark is reduced by the penalty for second and subsequent tries. In the example above a correct answer at the second try will score 0.6666667 of the available marks and a correct answer at the third try will score 0.3333334 of the available marks.
'''Penalty for each incorrect try''': The available mark is reduced by the penalty for second and subsequent tries. In the example above a correct answer at the second try will score 0.6666667 of the available marks and a correct answer at the third try will score 0.3333334 of the available marks.
Line 54: Line 82:
'''Show the number of correct responses''': Include in the feedback a statement of how many choices are correct.
'''Show the number of correct responses''': Include in the feedback a statement of how many choices are correct.


==See also==
==Accessibility==
The [http://www.open.edu/openlearnworks/mod/oucontent/view.php?id=52747&section=2.3.2 original documentation page] at the Open University site.
Drag and drop questions are keyboard accessible. Use the <tab> key to move between the drop zones and the <space> key to cycle around the possible choices for each drop zone.
 
Note: This question type is not accessible to users who are visually impaired.
 
==Changing the dimensions of the images==
[https://moodle.org/mod/forum/discuss.php?d=358512 According to the plugin author], You can easily change the max dimensions of an image in this question type by changing [https://github.com/moodle/moodle/blob/MOODLE_33_STABLE/question/type/ddimageortext/questiontype.php#L30 these] and [https://github.com/moodle/moodle/blob/MOODLE_33_STABLE/question/type/ddmarker/questiontype.php#L31 these] constants in the code in your server:
define('QTYPE_DDIMAGEORTEXT_BGIMAGE_MAXWIDTH', 600);
define('QTYPE_DDIMAGEORTEXT_BGIMAGE_MAXHEIGHT', 400);
define('QTYPE_DDIMAGEORTEXT_DRAGIMAGE_MAXWIDTH', 150);
define('QTYPE_DDIMAGEORTEXT_DRAGIMAGE_MAXHEIGHT', 100);
 
define('QTYPE_DDMARKER_BGIMAGE_MAXWIDTH', 600);
define('QTYPE_DDMARKER_BGIMAGE_MAXHEIGHT', 400);
 
 
==Example (muscles in anatomy)==
* [https://moodle.org/mod/forum/discuss.php?d=358512 Anatomy drag and drop into image] example in a forum thread:
** Originally designed questions (1 and 2) look ugly:
[[File:DDinto_image_anatomy_muscles_example1.png|600px]]
 
[[File:DDinto_image_anatomy_muscles_example2.png|600px]]
 
<ul style="list-style-type:none;"><li><ul><li>New questions (3 and 4) which use additional CSS code, look nice and they work perfectly:</li></ul></li></ul>
[[File:DDinto_image_anatomy_muscles_example3.png|600px]]
 
[[File:DDinto_image_anatomy_muscles_example4.png|600px]]
 
<ul style="list-style-type:none;"><li><ul><li>In order to make the text markers more look-alike the conventional legends of scientific diagrams, I (Joseph Rézeau) have added a few [https://docs.moodle.org/dev/CSS CSS] rules to my local site's Administration / Appearance / Additional HTML /When BODY is opened CSS as follows:</li></ul></li></ul>
 
<code css>
<style type="text/css">
.que.ddimageortext .dropzone {
    border: none;
    background-color:transparent;
}
.que.ddimageortext .drag, form.mform fieldset#id_previewareaheader .drag {
    border: none;
    background-color:transparent;
}
.que.ddimageortext div.dragitems div.draghome,
.que.ddimageortext div.dragitems div.drag,
form.mform fieldset#id_previewareaheader div.draghome,
form.mform fieldset#id_previewareaheader div.drag {
    font: 10px/1.231 arial, helvetica, clean, sans-serif;
}
</style>
</code>
 
<ul style="list-style-type:none;"><li><ul><li>In order to have the correct responses remain in place, you have to do the following: When editing the drag & drop question, go to the Multiple Tries section and under Hint 1 options tick Options Clear incorrect responses.</li></ul></li></ul>
 
== See also ==
This question type was originally developed  by the UK Open University and was a contributed plugin for several years before becoming part of standard Moodle. Find more [https://moodle.org/plugins/browse.php?list=set&id=10 Open University plugins here].


[[Category:Contributed code]]
[[Category:Questions]]
[[Category:Questions]]
[[Category:Open University]]
[[Category:Medicine]]
 


[[es:Tipo de pregunta arrastrar y soltar en imagen]]
[[es:Tipo de pregunta arrastrar y soltar en imagen]]
[[de:Fragetyp Drag-and-Drop auf Bild]]
[[fr:Question glisser-déposer sur image]]

Latest revision as of 20:09, 9 May 2020



This question type allows students to drag words, images or both from a list and drop them into pre-defined gaps on a base image.

How to create a question

Give the question a descriptive name to help you find it in the question bank. (Students won't see the name.)

Add the question to the text editor, using any formatting you wish.

In the Preview section, click the background image button to upload an image. Larger images will be displayed at a maximum 600 x 400. Your image will then display under the file upload box.

In the Draggable items section, you can upload images if you leave the type as 'draggable image' or you can type in words if you change the type to 'draggable text'. You may have a mixture of images and text.

In the Drop zones section, you choose which items to go in which zone. Click the 'Refresh preview' button.

You can then position the items on the background image and this will add their coordinates.

Note:(1) Draggable images cannot be more than 150 x 100 pixels. If they are larger, they will be scaled on import. Remember to add a short text descriptor too. If you change your mind about an image, simply upload a diferent one to replace it.

Note (2) You can format draggable text using <sub>, <sup>, <b>, <i>, <em>, <strong> and <br/>

Note (3) Choices that are within the same Group are colour coded and may only be dropped on a drop zone with the corresponding colour. Choices that are marked as 'Unlimited' may be used in multiple locations.

Example one

Based on the Moodle documentation Pedagogy, participants must 'climb the Moodle ladder' by ordering the stages of using Moodle as a teacher.

In the Preview section, a basic image of steps is uploaded.

In the Draggable items section, the 'type' is chosen as 'draggable text' and the text for each stage is added. (Groups and the Unlimited setting are not used in this example)

imagedragdropdraggabletextu.png

In the Drop zones section, an item from the previously added options is chosen from the drop down:

choosingdropzonetext.png

These texts will now appear under the background image:

imagedragdroptextpreview.png

The text boxes are dragged to their correct positions on the image (steps on the staircase) This will then add the co-ordinates to the Dropzones section automatically:

imagedragdropdropzonescoords.png

Other settings are completed (see below) and the question is saved.

Participants must drag the Moodle stages to the correct step:

climbthemoodleladder.png

Example two

Participants must add the correct country flag and capital city onto a map of Europe.

This question has images as well as text and makes use of the Groups feature.

In the Preview section, a basic map of Europe is uploaded.

In the Draggable items section, the capital cities are added as the type 'draggable text' and the flags are added as the type "draggable image"


dragtextimageflagsu.png

All draggable images (the flags) are in Group 1 and all draggable text items (the capital cities) are in Group 2.

In the Drop zones section, an item from the previously added options is chosen from the drop down. The Group 1 boxes will display in a different colour from the Group 2 boxes.

When the boxes are dragged to their appropriate places on the background image, the coordinates in the Drop zones section are updated automatically.

Other settings are completed (see below) and the question is saved.


dragddropimageflagcity.png

Scoring and feedback

All gaps are weighted identically. Only drop zones that are filled correctly gain marks. There is no negative marking of drop zones that are filled incorrectly.

Whether or not Combined feedback is shown to students is governed by the Specific feedback setting on the quiz settings form.


Penalty for each incorrect try: The available mark is reduced by the penalty for second and subsequent tries. In the example above a correct answer at the second try will score 0.6666667 of the available marks and a correct answer at the third try will score 0.3333334 of the available marks.

If the question is used in 'interactive with multiple tries' behaviour the marking is modified as follows:

  1. The mark is reduced for each try by the penalty factor.
  2. Allowance is made for when a correct choice is first chosen providing it remains chosen in subsequent tries.

Hint: You can complete as many of these boxes as you wish. If you wish to give the student three tries at a question you will need to provide two hints. At runtime when the hints are exhausted the question will finish and the student will be given the general feedback and the question score will be calculated.

Clear incorrect responses: When ‘Try again’ is clicked incorrect choices are cleared.

Show the number of correct responses: Include in the feedback a statement of how many choices are correct.

Accessibility

Drag and drop questions are keyboard accessible. Use the <tab> key to move between the drop zones and the <space> key to cycle around the possible choices for each drop zone.

Note: This question type is not accessible to users who are visually impaired.

Changing the dimensions of the images

According to the plugin author, You can easily change the max dimensions of an image in this question type by changing these and these constants in the code in your server:

define('QTYPE_DDIMAGEORTEXT_BGIMAGE_MAXWIDTH', 600);
define('QTYPE_DDIMAGEORTEXT_BGIMAGE_MAXHEIGHT', 400);
define('QTYPE_DDIMAGEORTEXT_DRAGIMAGE_MAXWIDTH', 150);
define('QTYPE_DDIMAGEORTEXT_DRAGIMAGE_MAXHEIGHT', 100);
define('QTYPE_DDMARKER_BGIMAGE_MAXWIDTH', 600);
define('QTYPE_DDMARKER_BGIMAGE_MAXHEIGHT', 400);


Example (muscles in anatomy)

DDinto image anatomy muscles example1.png

DDinto image anatomy muscles example2.png

    • New questions (3 and 4) which use additional CSS code, look nice and they work perfectly:

DDinto image anatomy muscles example3.png

DDinto image anatomy muscles example4.png

    • In order to make the text markers more look-alike the conventional legends of scientific diagrams, I (Joseph Rézeau) have added a few CSS rules to my local site's Administration / Appearance / Additional HTML /When BODY is opened CSS as follows:

<style type="text/css"> .que.ddimageortext .dropzone {

   border: none;
   background-color:transparent;

} .que.ddimageortext .drag, form.mform fieldset#id_previewareaheader .drag {

   border: none;
   background-color:transparent;

} .que.ddimageortext div.dragitems div.draghome, .que.ddimageortext div.dragitems div.drag, form.mform fieldset#id_previewareaheader div.draghome, form.mform fieldset#id_previewareaheader div.drag {

   font: 10px/1.231 arial, helvetica, clean, sans-serif;

} </style>

    • In order to have the correct responses remain in place, you have to do the following: When editing the drag & drop question, go to the Multiple Tries section and under Hint 1 options tick Options Clear incorrect responses.

See also

This question type was originally developed by the UK Open University and was a contributed plugin for several years before becoming part of standard Moodle. Find more Open University plugins here.