Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Great Valérie -
Number of replies: 7

Hello,

I just start with Moodle. My question is :

I import a Moodle 1.9 course with quizzes to Moodle 2.1. One of them is ddmatch quiz, another order type quiz.

I first install the two type questions in Moodle 2.1, and then import.

Why don't I see data of these questions ? Do I have to create them manually ? How can I import these datas ?

Thank you for your help

Béatrice Niogret

Average of ratings: -
In reply to Great Valérie

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Jean-Michel Védrine -

Hello,

These questions have beeen upgraded to Moodle 2.1 by Andreev Artem but if I look at the latest versions on github they don't include the code to be able to restore a 1.9 backup (they don't have the required question/type/ddmatch/backup/moodle1/lib.php and question/type/order/backup/moodle1/lib.php files).

So currently it is not possible to restore ddmatch or order questions included in an 1.9 backup.

For ddmatch maybe the solution is not too complicated because if I remember well the database structure is very similar to the core match question so it would be easy to start from question/type/match/backup/moodle1/lib.php file and modify it to have a working question/type/ddmatch/moodle1/lib.php file.

In reply to Jean-Michel Védrine

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Jean-Michel Védrine -

There is another thing missing from these versions of ddmatch and order for Moodle 2.1 : they don't include the functions to import/export xml. So this must also be added.

Fortunately there is not a lot of change to do to Adriane Boyd code from version for Moodle 2.0 see in question/type/ddmatch/questiontype.php the code for :

function export_to_xml( $question, $format, $extra ) {

and

function import_from_xml( $data, $question, $format, $extra=null ) {

And also the similar code for the order question.

So maybe if Andreev is reading this messages he can do a new version in a not too far future.

In reply to Jean-Michel Védrine

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Great Valérie -

Thank you for your answer.

Because I juste start with Moodle, I can't tell you I will do the work (but  I understand. I need xml functions to backup/restore datas questions).

We actually examine Moodle, to see if we will use it.

In reply to Great Valérie

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Jean-Michel Védrine -

Hello,

Here is a version of the ddmatch question for Moodle 2.1 where I have added code for restoration of Moodle 1.9 backups and also the code to do xml export/import.

I will also send this code to Andreev Artem and I hope he will upgrade his github account.

Of course it was rather difficult to test retoration of 1.9 backups so all i did was to download a fresh version of Moodle 1.9, install it create some ddmatch questions, create a backup and test it seems to import correctly in Moodle 2.1. So please report if you find problems so that I can fix the bugs.

The code for XML export/import is somewhat not as smart as I wanted it to be because bugs MDL-30135 and MDL-29060 are not yet fixed so I was forced to duplicate some code to make it working.

To install, unzip, verify that the unzipping process has not created an unwanted level of ddmatch subfolder (there should only be a ddmatch folder with all the files and subfolders in it) and replace the question/type/ddmatch subfolder on your moodle server with this one.

Alternatively you can only replace the question/type/ddmatch/questiontype.php file and add the question/type/ddmatch/backup/moodle1 subfolder because i haven't made any change to other files.

Average of ratings: Useful (3)
In reply to Jean-Michel Védrine

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Great Valérie -

Thank you. I will try it this week.

I will also share this information with our partner, because we try to import their Moodle courses in our Moodle site, which is object of our partnership.

In reply to Jean-Michel Védrine

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Chris Baldwin -

I installed this plugin on a development site that was upgraded from 1.9 with drag & drop questions already there. After installing your plugin the questions seemed to work fine in both FF7 & IE9.

Will this plugin be put onto the plugin directory?

Thanks for the great work smile

Chris

In reply to Jean-Michel Védrine

Re: Upgrade ddmatch or order quiz from Moodle 1.9 to 2.1

by Artem Andreev -

Thanks! I've added your code to repo. If you change your opinion about version control systems I'll be glad to add you as collaborator to repo.