Quiz

 
 
Picture of Jean-Michel Védrine
Re: Logic for Drag and Drop Quiz Moodle 2.5
Group DevelopersGroup Particularly helpful Moodlers

Hello,

That's unexpected. I am not able to test with the Rocket theme as I don't have it installed, but drag and drop matching has been tested with Clean theme based on Bootstrap and it works (I just verified a moment ago it still works).

Just to be sure it isn't a theme issue, could you try with a standard theme ?

Drag and drop matching should be compatible with all modern browsers (of course javascript needs to be enabled, but that is to be expected for a drag and drop question !) here also just to be sure it isn't a browser issue could you try with a different browser ?

 

 

 
Average of ratings: -
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Hello,

I did try it with a standard theme (afterburner). Also disabled the bootstrap and ran it in chrome, IE, and Firefox. Also Emma ran it with Rocket. So that doesn't seem like it could be the issue.

I will uninstall the program and try to reinstall it. Wonder what is going on? Sounds more and more like it must be something on my system.

Thanks,

Rod

 
Average of ratings: -
Picture of Emma Richardson
Re: Logic for Drag and Drop Quiz Moodle 2.5
Group Particularly helpful Moodlers

I am presuming you have tried deleting and recreating the question first?  Or trying another more simple question maybe?  

 
Average of ratings: -
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Emma,

Did try a new simple question. Same result. I will now uninstall and reinstall the plug-in.

Rod

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: Logic for Drag and Drop Quiz Moodle 2.5
Group DevelopersGroup Particularly helpful Moodlers

Looking at the code rendering the question, I suddently remember that drag an drop is disabled if AJAX is disabled on the Moodle website.

So go to Site Administration -> Apparence -> AJAX and Javascript and verify that Enable AJAX is set to yes (this is the default value).

Tim, do you think this is the right thing to do ? The previous version (Adriane code) was trying to see if the browser supported drag and drop (browser sniffing) which seems no more necessary now, and Andrew changed that to:

   /**
     * Check whether drag and drop is supported
     *
     * @return boolean Whether or not to generate the drag and drop content
     */
    protected function can_use_drag_and_drop() {
        global $USER, $CFG;

        // Note: The screenreader setting no longer exists from Moodle 2.4.
        if (!$CFG->enableajax || !empty($USER->screenreader)) {
            return false;
        }
        return true;
    }

But I don't see the point to tie drag and drop in a question to that admin setting ?

 
Average of ratings: -
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Jean-Michel,

I did check to see if AJAX was enabled. It was and all items in that section are set to the default values.

I have also cleared caches, just in case; have tried a simpler question (Emma's suggestion); and started to uninstall the plugin and do a reinstall -- but got a message that I would have to delete the existing questions, so thought about trying more, other options first.

In your discussion about the code, I couldn't help notice a mention of screenreader. Our materials must be 508 complaint (U.S. Federal Disabilities Act Law) and we have made efforts to achieve this compliance including using OOHOO - TTS - Text To Speech plugin. I can't imagine that could have any impact!?

Last points to make, a reminder that I am using Moodle 2.5.1 with Rocket 2.5 theme and bootstrap enabled. Also, here is partial image of my question plugins. It seems to show all installed properly, with proper dependents in place.

A mystery? n'est pas?

Regards and appreciation for your assistance.

Rod


 
Average of ratings: -
Picture of Emma Richardson
Re: Logic for Drag and Drop Quiz Moodle 2.5
Group Particularly helpful Moodlers

Can you disable the text to speech plugin and see if that resolves it?  Also, maybe try from a different computer just to make sure that it isn't a computer specific issue.

 
Average of ratings: -
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Hello Emma,

I did disable the TTS. It did not have an effect. I also tried access to question from two other machines. No difference.

I have provided the page source to Jean-Michele. Hopefully he will see something that makes a difference,

Regards,

Rod

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: Logic for Drag and Drop Quiz Moodle 2.5
Group DevelopersGroup Particularly helpful Moodlers

Thanks for the screenshot,

It shows that you have the right versions installed.

I tested with Moodle 2.5.1 too, but would be interested to test with Rocket 2.5 theme, is this a freely available theme ?

I don't think text to speach could be an issue.

Is drag and drop working in other areas of your Moodle ? For instance if you turn editing mode on in a course, can you drag and drop files onto sections ?

If you could save the page source code on a page where the question is displayed during an attempt or a preview and mail it to me (vedrine _at_ vedrine _dot_net) it would be interesting to see if the code for drag and drop is present or not.

 
Average of ratings:Useful (1)
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Hello Jean-Michele,

Responses to the issues you raise:

1) Here is the 2.5 release for Rocket theme. https://moodle.org/plugins/pluginversions.php?plugin=theme_rocket

2) I did disable speech, as Emma suggested. It made no difference.

3) Yes, I am able to "drag and drop" a graphic into a lesson.

4) I have attached a zip document that contains the page source on the question in question. If something else is needed I would be happy to provide it. I have not yet reinstalled the plug. I will wait to hear your verdict!

Merci bien de votre assistance,

Rod

 
Average of ratings: -
Picture of Jean-Michel Védrine
Re: Logic for Drag and Drop Quiz Moodle 2.5
Group DevelopersGroup Particularly helpful Moodlers

Hello Rodney,

Thanks a lot for all these informations.

I was able to install the Rocket theme 2.5 version ad the ddmatch question is working as expected even with Bootstrap activated. The drag and drop UI is displayed on screen and works.

Studying your page source code, it's quite evident that the needed code for the ddmatch drag and drop interface is not here. So now, "all" that is needed is to find why it is not here.

  1. Verify that the file question/type/ddmatch/yui/dragdrop/dragdrop.js is present on your moodle server and not corrupted (this file contains 158 lines).
  2. Replace the question/type/ddmatch/renderer.php file on your server with the one included in the zip archive attached to this message (I have edited it so that the can_use_drag_and_drop function always return true) and purge all caches both on the server going to Site Administration -> Development -> Purge all caches, and also in your browser. See if it makes any difference.
  3. Go to Site administration -> Development -> Debugging and set Debugging Messages level to DEVELOPER, don't forget to click on "Save all changes" smile, display a ddmatch question and see if any error message is displayed.

That's all I can suggest for now !

 
Average of ratings:Useful (1)
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Hello Jean-Michel,

Voilà !  Un succès fou! Thanks so very much.

However, the question remains, why? The .js was the right length, 158 lines. And I had always previously cleared cache after making any code adjustment or even when adding a new plugin. I am wondering if I should try putting back the old renderer.php sometime (didn't check to see if you had merely commented out the old code, but did notice the file you sent was about 20 KB shorter.

This method for displaying the question is so much better than a straight match.

Regards,

Rod

 
Average of ratings: -
Picture of Rodney Wolford
Re: Logic for Drag and Drop Quiz Moodle 2.5
 

Actually, one last question.

Where in the .css or other code could I adjust the widths of the drag box, drop box, and text description areas? I can see if these were controlled that I would be able to make the question fit better on the page.

Thanks again,

Rod

 
Average of ratings: -