Drag and Drop Matching 2.3

Drag and Drop Matching 2.3

by Lynn Harvey -
Number of replies: 19

On my Moodle 2.3 test site the quiz using drag and drop matching has the following error, Unknown question type ddmatch.

Are there plans for a 2.3 version of this question type?

Average of ratings: -
In reply to Lynn Harvey

Re: Drag and Drop Matching 2.3

by Hartmut Scherer -

Hi Lynn,

I am also waiting for the release of the entire question set and hope that drag and drop matching will be included. From this post on June 22 in "New question types," I am glad to see that Jamie Pratt is working on this project.

With kind regards,

Hartmut

In reply to Hartmut Scherer

Re: Drag and Drop Matching 2.3

by Jamie Pratt -

Hi,


I am not working on a ddmatch upgrade I am afraid. This here seems to be the latest version of the plug in? It sounds like it has not been thoroughly tested and may not upgrade your existing questions correctly.

I worked on lots of other types of drag and drop question type (as linked to by Hartmut above). And you may find another question type out of the ones we have developed does what you want. These question types will hopefully be well maintained.


I am a freelance developer so if someone wanted to hire me to review the ddmatch question type and get it working with Moodle 2.2, 2.3 etc I would be happy to help!

In reply to Jamie Pratt

Re: Drag and Drop Matching 2.3

by Jean-Michel Védrine -

Hello Lynn, Jamie and Hartmut,

Unfortunately Andreev's version need small adjustments to work with Moodle 2.3 (there are some slight API changes)

Fortunately I have a working version somewhere because I have it running on a Moodle 2.3 site so surely I already made these changes. All I need to do is to retreive the good version in my mess ...

I am rather confident that upgrade from 1.9 to 2.1/2.2 (as you know it is not possible to go from 1.9 to 2.3 in one step) is working because of the tiny differences between ddmatch and match (only 1 database field added for answertextformat and that's all for the tables, no differences in attempts data structures) so if the match code is working, no question the ddmatch code is working because it is 99% similar for attempts upgrade big grin.

The code for xml import/export is another story because as ddmatch is a third party plugin, it has to be different. But since I send it to Andreev nobody has reported a bug to my best knowledge.

In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Lynn Harvey -

Glad to hear you have a working version, I will hold off scrapping my DDMatch quizzes and you might find something you can share in the near future.    Many thanks

In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I did an update to make the ddmatch work with 2.3 during its beta and it did not take much time at all (i.e. a few hours).  I have had my students take three or four tests that include that question type  without report of error. If Jean's version does not turn up I will post mine. 

In reply to Marcus Green

Re: Drag and Drop Matching 2.3

by Jean-Michel Védrine -

Hello,

Here is my version. It has been tested, but that doesn't mean it is bug free wink. XML import export has been tested too, but not sure everything is perfect (I just spotted that I exported hints twice a few days ago).

Marcus, it would be good to compare our versions to see if we can find some bugs.

After that it would be good if Andreev can make a branch for moodle 2.3 on github and to publish this plugin on Moodle plugins Directory.

Note that I also wrote some PHPunit tests, adapted from those of match question type, but I didn't had a chance to run them because I am still fighting to install PHPUnit in my Wampserver environment (nearly all the tutorials I found on the web seems only applicable to very old versions of wampserver, and the few I was able to start fail miserably).

It seems Moodle developpment is going too fast for me : just when I was begining to understand simpletests Moodle move to PHPUnit big grin !

In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Jean-Michel "It seems Moodle developpment is going too fast for me."

You're not the only one to have that feeling.smile

In reply to Joseph Rézeau

Re: Drag and Drop Matching 2.3

by Jean-Michel Védrine -

I am happy to report that after trying one more time to install PHPUnit it seems to work because running a small test script I see on my console :

PHPUnit 3.6.11 by Sebastian Bergmann.

Time 1 second, Memory 4,75 Mb

OK (1 test, 1 assertion)

I will try to run the ddmatch tests as soon as I find some time but unfortunately not this afternoon.

In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I got PHPUnit working on my XAMPP server (Win7) last night but it took me about 3 hours. Even at the end of that I could only get it to run simple sample tests and not the ones in the Moodle code sad

I may put some instructions together when I get further with it....

In reply to Marcus Green

Re: Drag and Drop Matching 2.3

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Getting PHPunit installed and working is extremely painful. The docs at http://docs.moodle.org/dev/PHPUnit help. Please feel free to imporove them, if you find any new pitfalls.

However, once you have got it working, it is very nice.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Drag and Drop Matching 2.3

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Simpletest was very nice for its... simplicity, but I appreciate PHPUnit can be much more powerful. If I teach any server side web dev I will attempt to get them to cut their teeth on simpletest....

Although I got PHPUnit to install, I need now to work on the config so it can find the moodle files and not fall over where it says

defined('MOODLE_INTERNAL')||die();

 

 

In reply to Marcus Green

Re: Drag and Drop Matching 2.3

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I am delighted to say that I now have phpunit working on my xampp win7 install and I have converted my old simpletests to the new format and they run.

In reply to Tim Hunt

Re: Drag and Drop Matching 2.3

by Jean-Michel Védrine -

Hello Tim,

That link was very usefull. As was usefull the fact that I had installed console2 following your advice when I began learning git.

Here is a new version of the ddmatch question type and guess what : the only diffrence is that all PHPUnit tests are passing. Yeah !!!

I only had to correct silly mistakes in test files ( I had used self:: instead of test_question_maker:: in my helper and I forgot to change a match occurence to ddmatch)

Installing PHPUnit was not easy :

  • I was lost between all the php.ini on my computer and edited the wrong one blush
  • I missed the line about installing DbUnit blush and lost some time understanding why database access was failing.
  • Docs says "Our PHPUnit integration requires a dedicated database and dataroot" but I was puzzled by the fact I was only adding a prefix ($CFG->phpunit_prefix = 'phpu_';) in config.php. I decided to follow the docs and ended with all phpu_ tables in the same database as the mdl_ ones. Not a problem, as this is a test but if this is the intended behaviour it would be better to write "require dedicated tables" rather than database.  Looking in the code it seems you can also use a dedicated database using $CFG->phpunit_dbname, $CFG->phpunit_dbuser, ... but this doesn't seems to be in the docs. I don't really know if using 2 differents database has some advantages over a single one.
  • So now I have PHPUnit working, I need to learn how to write some tests, because these ones were just slight adaptations of yours.
Average of ratings: Useful (2)
In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Lynn Harvey -

Installed the zip file and DDMatch quizzes are working again.  Thank you very much.

Wish the GradeMe block could have been fixed as easily.

In reply to Lynn Harvey

Re: Drag and Drop Matching 2.3

by eufredo manuel -

Hello, I have Moodle 2.2.2 (Build: 20120312) i tried to install this version but it does not compatible, it does not let me install does anybody have a a version who can work with my version?

In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It is fine to just use a different prefix.

I think the thing about using completely different DBs is mainly to help people who want to switch easily between testing on different databases (like MySQL and Postgres).

In reply to Jean-Michel Védrine

Re: Drag and Drop Matching 2.3

by Artem Andreev -

Jean-Michel, thank you.

I've merged your changes.

If anyone wants to maintain Drag and Drop Matching question I can add him as collaborator.