Creating drag and drop exercises in Open edX

Drag and drop exercises are useful when you require a learner to label specific parts of a larger whole, put process steps in the correct order, and many other use cases. They can make assessments interesting and fun, as well as making learning more interactive and engaging for content that isn't assessed.

In this article we'll cover the basic steps for creating a drag and drop exercise. This is obviously impossible to lay out entirely for your use-case (as you'll need to tinker with the steps to fit your own exercise), but this should point you in the right direction. As always, if you have problems with any of these steps, just get in touch with support and we'll be happy to assist. Drag and drop exercises - especially the first time you create one - require some experimentation, patience and a little time, but the payout is worth it. Your course will be more interactive and engaging, and sometimes learners need a break from just absorbing information!

Planning the exercise

Before you get started, it's a good idea to plan your exercise. Drag and drop exercises have the following three elements to them:

  • Items- The things to be dragged and dropped. These can be images, but typically work better as text.
  • Drop zones - The areas in which the items are dropped. These areas are rectangular.
  • Background - The image behind the drop zones, which provides learners with the context for the drop zones

So this may sound obvious and a bit of a waste of time, but before starting to build the thing, we should probably work out what we're dropping where. This can be done in a variety of ways, but my personal favorite is to just draw it out, either on paper or in something like a  Google Drawing. This helps to define exactly what your final exercise needs to look like. In this article as an example, we're going to be building a simple exercise related to a few of the features available on Tahoe. In an ideal world, this would also be useful to eventually help a graphic designer come up with a polished version of our background image that actually looks good, but this is just a help article, and I'm not a graphic designer. So it looks like this:

I've come up with the basic idea for my two drop zones (shown with a dashed line), the items I'm going to add (in blue), as well as a draft for my background image (everything else). These are our three basic elements, and having a clear definition of these before we start is vital.

Now it's time to head to Studio and turn this into something learners can actually use.

Note: Before you insert the exercise, you'll need to upload your background image (remember, no items or drop zones in the image!) in Files & Uploads and grab the Studio URL. This will save you time later.

Inserting the exercise

  1. Insert the drag and drop component into your course. To do this head into the unit of content in which you wish to insert the exercise and select Problem, Advanced, and then within the Advanced tab select Drag and Drop.


    You should now see a component that looks similar to the following image, with instructions to drag the items to various areas of the triangle. 

    If you instead see instructions to drag the items into buckets, you're currently on an older version of the platform. In this case, simply contact support and we'll walk you through a different process for inserting the improved drag and drop XBlock into your course instead, before coming back to these steps. The older, deprecated version to avoid looks like this (minus the large angry cross):

  2. Once you have the newest, shiniest version of drag and drop available to you and inserted, press Edit.

  3. Unlike many other components, Drag and Drop is assembled in stages. The first screen you'll see is a list of options to do with the activity as a whole. This gives you a place to change your title as well as any introductory text or feedback you want to provide to learners. Changing the Mode between standard and assignment acts as described on the page: 
    In  Standard mode the problem provides immediate feedback each time a learner drops an item on a target zone.
    In Assessment mode the problem provides feedback only after a learner drops all available items on target zones.
    Once you've configured these basic settings the way you'd like them to be, hit continue to move onto the next screen.

  4. The next screen is where we define our background image, as well as configuring where our drop zones are on the image. First, grab the URL to the background image you (hopefully) uploaded earlier, and paste it into the Background URL box, then hit Change Background.

  5. You'll want to enter in a description of what your background image looks like. This can be tricky, but if you get it right this will allow sightless learners to complete your drag and drop activity as easily as sighted learners. When writing descriptions like this, the general rule is to be succinct and precise, and be sure to include any text contained within the image.

  6. Next up, you can decide whether you want to display the Zone labels or Zone borders on your image to the learner. Much of the time you probably don't, but it can be useful. You may want to just skip these and come back later to add them if you feel they would be useful.

  7. The last part of this screen is perhaps the most difficult part of this process at first, but will swiftly become familiar. Don't be afraid of a little trial and error here. By default, the zones from the triangle exercises are already set up. You'll want to delete all but one of these to use as an example by clicking the X in the blue circle. That should leave you with something like this (note that you always have to have at least one zone!)

  8. We're obviously not done, so let's continue. The Zone Title is what is referred to as the Zone label previously. In mine, I'm going to call it "Starter features". Make sure you use a clearly identifiable, descriptive name for this! You'll need it later, so don't be vague and start calling things "Zone 1".

  9. The Description is how the zone is described to sightless learners. The wording on the original is pretty good, so I typically just amend it from "Use this zone to associate an item with the top layer of the triangle." to whatever fits my drop zone. In this case, I'll say "Use this zone to associate an item with the starter features box."

  10. Now comes the bit where you'll need to use a little trial and error. Contrary to the order they appear on the screen, we'll start with the X and Y coordinates. These work from the top left corner of your drop zone. The image on the right will update as you type different numbers, so enter numbers until the top left corner of your box is in the position you want it to be in. The larger the number, the further your zone's top left corner is from the top left corner of your image. You'll probably find it looks a little something like this while you work it out:
    Repeatedly attempting different numbers in the box leads to eventually finding the position you need.

  11. Once your top left corner is in the right place, you can do the same with your width and height.Experimentation is the key. Keep on trying smaller and larger numbers until you think it's right.

  12. Alignment is where your dropped items will end up once a learner puts them in the box. Center tends to look the best, but you can change it to left, center or right if you want to achieve a specific look or feel.

  13. Now it's just a case of repeating the process by clicking the Add a zone button and filling in the info for your other zones. Once you're done, you might end up with something a bit like this:

  14. When you're done setting up drop zones, hit Continue to move onto the third (and final!) part of this process.

  15. The final screen is all about the items you're going to drop in the zones you just set up. The first part of this screen is how these items display. You don't actually need to set these! If they are not set, the items will display as they looked in the original triangle example - white text on a dark blue background. If you want to be really fancy, however, you could change this to your brand color to match your site's headings, which I'm going to do for my example.

  16. The Maximum items per zone setting allows you to control how the exercise looks a bit more finely. Sometimes you'll only want a single item per zone in order to prevent items from overlapping the background or similar, and sometimes it makes a tough question easier to know that only 3 items can go in each zone. If it's not set to anything, there's no limit, and learners can pile in as many items as they want into any of your drop zones. For my example, as there are only 4 for each, I'll make the exercise slightly easier by limiting each side to 4 items.

  17. Last, but no means least, are our Item definitions. The first thing you're going to want to do is delete all the items that are there already. We don't need them. Hit the X in the top right of each. It won't let you delete the last one, because there must always been one.

  18. You've probably guessed what happens new. Now you simply need to fill in the various parts of the items! 

    • Text - This is the text that appears to the learner for each item
    • Zones - This is which zone the item should be dropped into. If you pick a single zone, the activity is considered correct if it's in that zone. If you pick multiple zones, the activity is considered correct if it's in any of those zones. Lastly, if you pick no zones, the activity is considered correct provided the learner hasn't put the item anywhere. A curve ball!
    • Image URL - If you put a URL in here (such as /static/image.png for an image loaded up in Files & Uploads) the image will appear in the place of a text label. This is good for exercises such as reconstructing an image.
    • Image Description - This is only required if you've entered an Image URL, and allows sightless users to complete the activity. For example if you were to insert an image with any text on it, you'd want to replicate that text here so that a screen reader can interpret it correctly. Keep it short, though.
    • Success Feedback - This message will appear when the learner puts the item in the right place. You might want to consider making this valuable in some way to the learner, such as including additional facts and information about what they just got right. Correct! is fine, but Correct! Did you know... makes this more than just an empty acknowledgement that they've got it right.
    • Error Feedback - This message will appear when the learner puts the item in the wrong place. Again, consider whether you want to give them a hint as to why this is the wrong place for the item they just tried to drop.
    • Advanced settings - For the brave who want more precise control over how their items display, the only advanced setting currently is Preferred width. This sets the width of the item as a percentage of the background image. This is primarily used for if you want your items to be a standard size, for example if you want to fit them into a very precise narrow box, despite having large items, or have image items where the size of images varies, and you want them to look a bit more consistent.

    When you need a new items, hit the Add an item button, found at the bottom of the list.

  19. Once you're done adding items, hit Save, and you're done!

  20. Make sure you test your activity before you Publish it to your learners! You've just been through a lot of setup, so it'd be a shame to let something slip the net. Try each item in every drop zone you've set up, and see what happens!

General tips for success

  • Make sure you know what you're building before you build it.
  • If you're able, talk to a graphic or user experience designer about the best way to present the design, and get their help in preparing a really good looking background image (AKA something that looks better than my Google Drawing!)
  • Failing this, at least talk someone else through your design before building it into an activity - you'd be surprised how much collaborating on the best way to present this sort of activity helps.
  • Consider your descriptions well so that sightless learners can still complete the activity.
  • Don't get overwhelmed - you can always just click through the various screens and save your progress to do it in stages. You don't have to do this all in one sitting.
  • Test everything.