We have just upgraded from 1.6.6 to 1.9.1, everything seems fine apart from the drag and drop functionality as a question type. The Drag and Drop files have also been updated.
When I preview the quiz (mod/quiz/attempt.php?q=xx) I cannot drag any images to their hotspots apart from the first question in the quiz. When hovering over the other images to be dropped the cursor goes to a crosshair but that is it.
If I go to edit the quiz (mod/quiz/edit.php?cmid=xxxx) and then preview a single question in the popup, then the drag and drop works fine for all questions.
I can create a new drag and drop question that works OK. I also tried resetting the image and hotspots for a question and starting over but this does not work either.
Any thoughts anyone?
Regards
Re: Drag and Drop question type only works for first question
Have you read the README.txt and have you followed the instructions for installations with previous versions of dragdrop questiontypes?
Harry
Re: Drag and Drop question type only works for first question
Yes I did read the README.txt.
The files
lib/questionlib.php
mod/quiz/attempt.php,
mod/quiz/review.php,
question/preview.php,
mod/quiz/reviewquestion.php
where never changed so there is nothing to revert to.
Regards
Dave
Re: Drag and Drop question type only works for first question
Hello,
so the question preview works when calling something like
/question/preview.php?continue=1&quizid=1&id=3
but the quiz preview isn't working when calling something like
/mod/quiz/attempt.php?q=1
and hotspot arrange template is also not working when calling something like
/question/type/dragdrop/arrange.php?returnurl=...
Bad news.
What kind of browser are you working with?
Did you try other browsers?
Can you send me the output of the error console when using firefox? Perhaps it helps.
And at least please send mit the sourcecode of the working and not working pages.
Harry
Re: Drag and Drop question type only works for first question
It appears that Harald has moved onto pastures new.
Is there anybody who might be able to continue in trying to solve the drag and drop problem?
Regards
Re: Drag and Drop question type only works for first question
Whilst trying to figure out what is going on I have also come across another (related?) error. In a new quiz created on the 1.9 version, where there should be an image for a drag and drop format question there is an error message of:
Notice: Undefined variable: courseid in OURSERVERPATH\htdocs\moodle\lib\questionlib.php on line 1508
Has anybody come across anything similar and found a resolution?
Regards
Re: Drag and Drop question type only works for first question
Of course that fixed the problem!
Is there anybody in the community who can offer support for the drag and drop question type? I still have the above issues and September is looming fast when we will need these questions.
Any help of course would be greatly appreciated.
Regards
Re: Drag and Drop question type only works for first question
Hi Dave,
Did you find the way to fix this problem? I have the same problem. I have not upgraded drag and drop functionality, I have installed it from the Moodle plugins download section. I am running latest Moodle version 1.9.2.
regards,
Gotsa Jarcevic
Let a quiz with three dragdrop questions. The first, with three dragable images. The second, with four and the third, with five. Images are named:
for the first: 1 2 3
for de second: 1 2 3 4
for the third: 1 2 3 4 5
The quiz will work for the three images in the first question, the fourth image in the second question and the fifth image in the third question. Those written in red.
If we move the third question to the first position, this will be the only working question.
I'm using firefox on mac osx.
I've solved this bug. It was imposing array with images on another array with images. I've add unique ID in every array and every images and all has earned.
If you find any bugs in my files, please, write me about it
Can you give some instructions?
I've modified this plugin and I think you don't need do this again. Download archive that I've attached in my previous message and extract it with 7zip (www.7zip.org) or winrar (www.rarlab.com) archiver (unfortunately, zip-archive was too large to attach here). Then replace files in your moodle
I am using Drag and Drop for the first time and having problems. One issue is that the documentation is three years old and the screen shot and directions do not correspond well with the present set up.
When I go through the documentation directions I get no images and and no labels (see attached screen shot). This sample has one drag-n-drop question. I tried with several questions and got the corresponding number of small gray boxes but no images. I am not sure where to start looking. Any suggestions?
May you put screeshot of your question in editing mode?
This seems like a bug that should be fixed!
Good afternoon.
I have put the folder in the question/type/ subdirectory.
I am confused. How do I "Visit Administration to create the dragdrop tables" as it states in the Read me?
Cheers

I have got to say, your response time is always top notch Mary. (I thank you for that)
I assumed that as well but after completing that, when I try and add a drag and drop question I get the error message shown in the picture below.
The only other thing is the Read me also says "it needs some images to work so if you haven't already done it, add some image files to your course that you want to use for drag and drop questions. After that you should be able to add a drag and drop question to the new quiz".
The problem with that is... How and where do I upload these images to?
Thank you for all your help
(p.s. the error message says "This question type is missing important code: question editing form definition for "dragdrop".)

You have two ways:
1) rename folder question/type/drUgdrop into question/type/drAgdrop
2)delete folder question/type/drUgdrop, download my new modification of this question type and unpack into folder question/type/
Cheers Eugene.
I installed this in the same way and I get:
question/type/dragdrop plugin needs upgrading
(mysql): CREATE TABLE mdl_question_dragdrop ( id BIGINT(10) unsigned NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, backgroundmedia BIGINT(10) NOT NULL DEFAULT 0, dragdropmedia VARCHAR(255) NOT NULL DEFAULT '', freestyle SMALLINT(4) unsigned NOT NULL DEFAULT 0, feedbackfraction VARCHAR(10) NOT NULL DEFAULT '0.0', feedbackok LONGTEXT NOT NULL, feedbackmissed LONGTEXT NOT NULL, arrangemedia SMALLINT(4) NOT NULL DEFAULT 0, placemedia SMALLINT(4) NOT NULL DEFAULT 0, slide SMALLINT(4) NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
1050: Table 'mdl_question_dragdrop' already exists
(mysql): ALTER TABLE mdl_question_dragdrop COMMENT='Options for dragdrop questions'
(mysql): CREATE TABLE mdl_question_dragdrop_hotspot ( id BIGINT(10) unsigned NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, x BIGINT(10) NOT NULL DEFAULT 0, y BIGINT(10) NOT NULL DEFAULT 0, width BIGINT(10) unsigned NOT NULL DEFAULT 0, height BIGINT(10) unsigned NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
1050: Table 'mdl_question_dragdrop_hotspot' already exists
(mysql): ALTER TABLE mdl_question_dragdrop_hotspot COMMENT='Defines the hotspot areas for drag-and-drop questions'
(mysql): CREATE TABLE mdl_question_dragdrop_media ( id BIGINT(10) unsigned NOT NULL auto_increment, questionid BIGINT(10) unsigned NOT NULL DEFAULT 0, questiontext LONGTEXT NOT NULL, media VARCHAR(255) NOT NULL DEFAULT '', alt LONGTEXT NOT NULL, width BIGINT(10) unsigned NOT NULL DEFAULT 0, height BIGINT(10) unsigned NOT NULL DEFAULT 0, mimetype VARCHAR(100) NOT NULL DEFAULT '', targetx BIGINT(10) NOT NULL DEFAULT 0, targety BIGINT(10) NOT NULL DEFAULT 0, displaywidth BIGINT(10) unsigned NOT NULL DEFAULT 0, displayheight BIGINT(10) unsigned NOT NULL DEFAULT 0, positioned SMALLINT(4) unsigned NOT NULL DEFAULT 0, hotspots VARCHAR(200) NOT NULL DEFAULT '', primary_hotspot BIGINT(12) NOT NULL DEFAULT 0, CONSTRAINT PRIMARY KEY (id) )
1050: Table 'mdl_question_dragdrop_media' already exists
(mysql): ALTER TABLE mdl_question_dragdrop_media COMMENT='Media objects for drag-and-drop questions'
Where have I gone wrong? I can go and build a Dragdrop question type but it doesn't seem to display the images?
Cheers
Indeed.
Apologies to you and Eugene for shoddy posting
You need upload some images into your course in moodle. You might upload files: your course -> block "administration" -> files.
Then build new DragDrop question into this course.
All happened? Can you see images in new dradrop question?
Yep did the first bit.
Then built a test quiz. Then built a Dragdrop question.
When I use the dropdown box I can select the images I have uploaded.
However when I display the quiz to align the hotspots the pictures don't appear. It also doesn't appear in the quiz preview (see the picture).
Sorry if it is something I am doing wrong
Good suggestion.
Unfortunately I can display the image on its own within Moodle. I just don't seem to be able to apply it to the quiz
Keep the good ideas coming though. The help is very much appreciated
I tried a "Matching" question type in the same quiz as the "DragDrop"which (as you can see from the picture) has worked and displayed the image.
Maybe I am setting the "DragDrop quiz up wrong somehow?
Or maybe the install didn't quite work properly?
These are just guesses though, I am at a loss as to why it won't work?
Cheers for helping me work thorugh it
so, is there an official website with installation instruction and faq for this question type plugin ?
maybe someone can provide a link or something where a detailed description can be found.
Just to say that I am following this thread
There is a lot of work to do on the dragdrop questiontype and I hope that I will have some time available now.
- I need to commit the changes for several dragdrop questions on the same page closing CONTRIB-1170 (thank a lot to Eugene for fixing that bug) and also the progress I have made on backup/restore code.
- looking at the messages in this thread, it seems obvious that the documentation need some improvments, the problem is that for Brian (original author), Harald or me english is not our native language ! So maybe some parts of the documentation aren't very clear. If you have any suggestions, I would be happy to commit an upgraded version to CVS.
- Don't hesitate to post reports to CONTRIB Moodle Tracker, component : Questiontype {none of the above} and to assign these reports to me.
have you finished the fixes you mentioned the post above ?
so is it the newest version i can download from the source ?
greetings
My latest version available here slightly higher.
James, try to delete this tables into your database:
mdl_question_dragdrop
mdl_question_dragdrop_hotspot
mdl_question_dragdrop_media
delete your folder dragdrop and then install its again
Eugene - I have removed all these tables, deleted the DragDrop folder, reinstalled the folder from your link.
It still seems to have the same problem though? Maybe it is something I am doing wrong?
Jean-Michel - When I get it working I would be happy to improve the documentation and create a list of FAQ's to go with the documentation
(P.S. I am not in tomorrow so I will have another attempted at re-installing it on monday)
May does you put screenshots your drag'n'drop in edit mode?
When you reinstall question type, does you have any errors same the first time you install?
Good Monday afternoon.
I don't know what size the pictures are supposed to be? I have tried a range of pictures though and non seem to display.
When I re-installed it on thursday no error messages appeared in the notifications (It claimed that everything was a success on this install).
Here is a screenshot of me creating one in editing mode:
Well I managed to get time to have a proper play around with it yesterday and managed to get it working:
In the end I decided to try a range of different picture formats to see if any of them would display.
I tried .JPG (and .jpg as suggested by early posts), I tried .png, and I tried .bmp.
I found that the .bmp displayed the image within the question (Don't know if this is a me specific issue, as no-one else seems to have it?).
Therefore the question is now fully functional as long as I always use .bmp images.
Thank you very much for your time