Quiz

Extended question type: drag-and-drop matching question

 
Picture of Adriane Boyd
Extended question type: drag-and-drop matching question
Plugin developers
Hi everyone,

I've attached an extension of the existing matching question that displays a drag-and-drop version in supported browsers. If the YUI javascript libraries aren't supported, it looks like the original matching question. The question editing interface and the grading are identical to the original matching question.

The drag-and-drop version provides all the answers in a list to the right of the question table. The current target is highlighted to show where the answer will be dropped. There are screenshots on the project page.

I have tested it in Firefox 2 and IE 6. There seem to be bugs with the YUI javascript libraries and Opera, so until I figure out what's going on, the non-javascript version is displayed for Opera.

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Extended question type: drag-and-drop matching question
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators
Hi Adriane,
Thanks for your drag and drop matching question type. Just tested it on Moodle 1.9 (dev). It works fine, even works with pictures (see attached).
Congrats!
Joseph

 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
I'm glad to see that it worked! You should be able to put any HTML you like in the questions and answers. The non-YUI fallback is still like the original matching question, so it won't work with images because of the drop-down menus, but I think the YUI libraries are supported by most browsers people are using these days. (If I can just figure out the Opera bug...)
 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
Joseph,

I was just getting carried away the ability to add pictures when it occured to me that if a user has a browser that cannot display ddm I don't know what happens... Unfortunately I can't test this, is the alternate text shown or the html for the image link?
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
You can test it by temporarily turning javascript off in your browser. As it stands, nothing is displayed in the drop-down menu in the place of the image. The HTML is there, but it can't be displayed in the drop-down menu.
 
Average of ratings: -
Picture of Joseph Rézeau
Re: Extended question type: drag-and-drop matching question
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators
Ray,
then you'll have to display the images in the left column, and matching text in the right column,
Joseph
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
The Opera bug was indeed a YUI bug (bug report). It has been fixed in YUI 2.3.0, which was just released on Monday. Hopefully YUI within moodle will be updated and this will no longer be a problem.
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Extended question type: drag-and-drop matching question
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
You should post this in the General Developers Forum, to make sure Martin or Petr see it, and it they can then update the libraries in Moodle.
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
It looks like it's already assigned to Martin as part of another GSoC project (MDL-10336). I can bring it up in the General Developers Forum as not just relevant to that one project. I don't know how many complications it causes for other components, but it's a pretty old version at this point.
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Extended question type: drag-and-drop matching question
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
They have just updated YUI in head.
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
Here is an updated version that works with Opera in the current 1.9 dev. It also takes advantage of newer YUI features to load more quickly/cleanly.
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Extended question type: drag-and-drop matching question
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
What to people think? Should I stick this into Moodle 1.9, along with the drag-and-drop ordering question? (1.9 beta release due any day now, so I would have to be quick.)

Adriane, remind me, do both those types support backup/restore, and import/export?
 
Average of ratings: -
Anthony Borrow
Re: Extended question type: drag-and-drop matching question
Core developersMoodle HQPlugin developersPlugins guardiansTesters
Tim - My response would be "go for it!" I like the idea of drag and drop. I think students would like it as well - somehow it seems less formal but I have a hunch that it might help the student to connect the items better since they are doing something to bring the two concepts together. Peace - Anthony
 
Average of ratings: -
Daughter caught me driving down the street.
Re: Extended question type: drag-and-drop matching question
Testers
I second Anthony's 'Go for it!' - as long as you have backup/restore and import/export. These both look to be great additions!

Thanks,
Matt
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers

The drag-and-drop matching question could in theory replace the existing matching question. Other than minor renaming to replace "match" with "ddmatch" (in the database and in backup/restore), I only changed how it gets displayed to the student. The database tables are identical and all the backup/restore functionality should be identical to the existing matching question. I will test it out soon and make sure it works.

Import/export would depend on whether it replaced the existing matching question. If it did replace it, importing should continue to work as it did before. If it were an additional question type, I'm not sure how importing would work because you wouldn't know whether an imported matching question should be drag-and-drop or not.

The ordering question is based on the existing matching question, so backup/restore should not be difficult to get working. I will also test it out soon.

I haven't thought about importing for ordering questions at all. There would be similar import problems since they look a whole lot like (or exactly like) matching questions in many import formats. I don't know that much about how import/export works, so I'm not sure how this should be dealt with.

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Extended question type: drag-and-drop matching question
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
I am suggesting using the drag-and-drop matching to replace the existing one.

We would need backup/restore and import/export of at least Moodle XML format before we could include ordering in core. Preferably GIFT format too, if GIFT supports matching and there is a natural extension of GIFT to support it.
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
If it replaces the existing matching question, then I think import/export should work with no problems. Whatever importing of matching was supported before should still continue to work because I haven't changed the database tables at all.
 
Average of ratings: -
Anthony Borrow
Re: Extended question type: drag-and-drop matching question
Core developersMoodle HQPlugin developersPlugins guardiansTesters
Tim - I would be OK with it replacing it provided that there is an option to use the drag and drop. In other words have the matching question type with the ability to turn on or off the drag and drop functionality with the idea that even with it on depending on YUI working it may or may not be rendered. By default, I would like to see it off so as not to confuse folks who have already been using the matching questions. Peace - Anthony
 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
I'm with Anthony with this. To effectively drop one question type i.e. matching at a stroke would be a bad thing IMO. The addition of an option to switch on d&d, with the default set to off, is the ideal solution. Everybody will be happy and catered for.
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Extended question type: drag-and-drop matching question
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
Well, everyone is happy except all the people that think the quiz is already too complicated. The new drag and drop matching poses exactly the same question, but with a better interface. Why would anyone want to keep using the old interface?

Can anyone come up with a pedagogic reason why you might want to keep the old interface?
 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
Can anyone come up with a pedagogic reason why you might want to keep the old interface?

Frankly, no. My concern is that this is a long established question type and interface, to discard it entirely on a version upgrade is unnecessarily disruptive in my view.

btw, I can attempt a Matching question using my keyboard only. I haven't yet discovered how to do that with the d&d matching question type.

Just for the record, I don't think quiz is too complicated and I think the new question type is great. Yes
 
Average of ratings: -
Picture of Joseph Rézeau
Re: Extended question type: drag-and-drop matching question
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators

I agree with Tim that "The new drag and drop matching poses exactly the same question, but with a better interface."

On the other hand, Hot Potatoes' JMatch offers drop-down list and drag & drop as options when you save your exercice. The big difference is that, in HP, it is almost impossible to use drag & drop when you have lists of pairs to be matched which are too long to be displayed on one screen. When you want to drag the first item in the right list opposite the last item of the left list, the screen gets confused/confusing. There is no such problem with Adriane's drag & drop version of the Moodle matching question.

Ray says:

My concern is that this is a long established question type and interface, to discard it entirely on a version upgrade is unnecessarily disruptive in my view.

I think the interface was unfriendly from the start, it should have been drag & drop, it is now possible, I am finding this a good thing, not something disruptive.

btw, I can attempt a Matching question using my keyboard only. I haven't yet discovered how to do that with the d&d matching question type.

Ray may have a point here for accessibility's sake, but it's hard to imagine using a computer without a mouse these days.

In conclusion: please let's have Adriane's drag & drop matching question as a replacement of the current matching question, not as a new type. I don't think we need to have an option to have the matching question as a drop-down list or drag & drop. If we do, then let's have drag & drop as the default option.

Joseph (a drag & drop addict)wink

 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
Hmmm..

The new drag and drop matching poses exactly the same question, but with a better interface."

Isn't it more that the new drag and drop matching poses exactly the same question, but with a different interface?

I think the interface was unfriendly from the start...

Really? I've never encountered that view before, but I have encountered plenty of people who would have liked drag and drop as well.

Across the many thousands of Matching questions created and in use I would suspect that there will be a sizeable proportion of quiz instructions and stems that reference the current interface. They will be redundant at the moment of upgrade. We should not assume that all Moodle users will regard revisiting their question banks with enthusiasm.

Dumping the current interface also affords no opportunity to retain it to maintain a consistent experience in a course where the Lesson matching question is used.

Mice: Yes, but how do you attempt this question type if you can't use a mouse? Perhaps the answer to this issue is for the question to recognise the "AJAX and Javascript" (or something like it) setting in the user profile and make the "old" interface available.

I think this new question type is great, let's not throw the baby out with the bath water.
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers

The current interface is still there, used as a fallback. If YUI isn't supported or you turn javascript off, you get the original version.

When I started working on it, I thought about using the site-wide AJAX option to control whether the new version is displayed, but the option seems tangled up with the AJAX course format, plus the matching question doesn't use AJAX. It's just javascript, and there's already some javascript in the quiz.

It would not be hard to add an option, but I also think it would better to keep the database tables the same if at all possible. Then, backup/restore and import/export don't need to be modified at all from the original version.

How about providing instructions for disabling the drag-and-drop version for people who want to keep using the old version? The drag-and-drop version can be disabled by modifying a single line of code. (The single line of code doesn't prevent the YUI libraries from being loaded, so an efficient disabling would be a little more complicated, but still very much possible.)

 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
Hi,

Ajax/Javascript: OK, thanks for that clarification.

I don't imagine for a moment that anyone would not want ddm question as an option for questions as soon as possible. I don't feel that your proposal takes us on much further than Tim's. This what I understand is being proposed:

Tim: Drop the current matching question entirely in favour of ddm. No legacy support for questions that have been created using the current matching question type.

Adriane: As above, but include guidance on how to modify the code for a site so that all users are required to stay with "old" matching and there is no opportunity to start using ddm.

And me... (and others?)

Ray: Get ddm into core asap. Provide option so that existing (and new if required) "old" matching questions continue as before until consciously converted to ddm type by the question "owner".

You know it makes sense.... big grin

Still on the usability track... How does someone in a supported browser who cannot use a mouse attempt a ddm question?
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers

Someone in a supported browser who cannot use a mouse would have trouble, at least with the browsers I've tested with. They would have to disable javascript to see the original keyboard-accessible version. Do you know if this a common situation? (For instance, I don't think a screen reader would appear to be a supported browser, at least I really hope not, but I don't have any to test with.)

 
Average of ratings: -
Martin Dougiamas
Re: Extended question type: drag-and-drop matching question
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTesters
There is a user profile screenreader setting too ... if someone has that turned on then the YUI interface should definitely be turned off.
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
Ah, I've seen the option mentioned and I should have thought to add that. I'll add it to all the question types that use YUI. (I think someone with a screen reader would need an alternate assignment for the image target question, but I'll add it anyway.)
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers

The ddmatch backup/restore already worked just as well as the existing matching question. The existing matching question doesn't work quite right, because shuffleanswers in question_match isn't backed up or restored. I fixed this for ddmatch and I've attached the updated version.

I am still working on the order question backup/restore. The question backup/restore is fine, but the answer recoding is not. I'll post an update in the order question thread when it's working.

 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
Adriane,

When an item is dragged to a location and then subsequently dragged away, the "Drag answer here" instruction is not re-instated.

Is this deliberate? I would have thought it more useful to have the instruction present in each "empty" box.
 
Average of ratings: -
Picture of Joseph Rézeau
Re: Extended question type: drag-and-drop matching question
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators
I agree with Ray that it would be more consistent to have the "Drag answer here" instruction re-initialised when an answer is dragged away.
Joseph
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
It was just the teensiest bit simpler not to. Here is an updated version that reinitializes the "Drag answer here" instructions.
 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
That's great, Adriane. Many thanks.

Another quick point, is it possible to move the dragged item to the left rather than copy it?
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers

In order to allow the same functionality as with the drop-down menus, it needs to be a copy. With the drop-down menus, you could choose the same answer for all subquestions if you wanted. I wanted to be sure that that was still possible in the drag-and-drop version because multiple subquestions can have the same answer. If the teacher provides the same answer for two subquestions, it only shows up once the drop-down menus or once in the drag-drop list.

It is, of course, possible, but I'd rather not do it because it would change the relationship between the original and drag-and-drop versions. If there are strong arguments in favor, it could be changed, but I was trying to keep it as close to the original version as I could.

 
Average of ratings: -
Ray Lawrence
Re: Extended question type: drag-and-drop matching question
 
Ok, thanks for that.
 
Average of ratings: -
Picture of Joseph Rézeau
Re: Extended question type: drag-and-drop matching question
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators
Yes, please implement Adriane's drag-and-drop and re-ordering questions in 1.9.
Joseph
 
Average of ratings: -
Picture of Joseph Rézeau
Re: Extended question type: drag-and-drop matching question
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators
Adriane,
There is a CSS declaration in your plugin which interferes with MULTIPLE CHOICE display. See MDL-10842

Joseph
 
Average of ratings: -
Picture of Adriane Boyd
Re: Extended question type: drag-and-drop matching question
Plugin developers
Sorry about that. Here's an updated version.
 
Average of ratings: -
Picture of Deni Nagy
Tárgy: Extended question type: drag-and-drop matching question
 
Hello,

Could you please help me how to install this drag-and-drop-matching type question? I would really like to use it but it has a missing subquestion error message. I'm sure that I have done somethng ncrrectly just don't know what.


Thank you in advance!

Deni
 
Average of ratings: -
Picture of Angela Sivia
Re: Tárgy: Extended question type: drag-and-drop matching question
 

FYI for those who can't get the image to appear in the question and/or answer, you need to use HTML coding:

<img src="image.gif" />

So, as an example, here would be the full path to the image:

<img src="http://moodle.net/file.php/6997/LoisLane.jpg" />

Now you should be able to view the images in your question.

 

(We are version 1.9.11)

 
Average of ratings: -