Cloze export

Cloze export

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

At the moment (in Moodle 1.6beta) it is still not possible to export/import Cloze (embedded) questions. Are there any plans to make this possible (e.g. in MOODLE XML format)?

Joseph

PS I do realize that, due to the very special nature of the Cloze question type, making an export/import engine might be quite a challenge.thoughtful

Average of ratings: -
In reply to Joseph Rézeau

Re: Cloze export

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I wasn't planning to include it.... to be honest nobody has ever asked for it before, not even a feature suggestion in the bug tracker. I guess xml format would be the place to do it.

I may need some help from Gustav (hint smile ) on just how they are stored internally!
In reply to Howard Miller

Re: Cloze export

by Eric Carlson -
I would also like to have this import/export capability. Being able to do this for other question types (in the native moodle xml format) has helped me enormously this semester in developing large numbers of randomized variations of questions.
In reply to Howard Miller

Re: Cloze export

by Gustav W Delius -
Hi Howard, I only just saw your post. I agree that being able to export cloze questions is quite important. But there is already one XML format for questions, namely that used by the backup and restore. Why don't we use the same format for import and export?

And by the way, if you are assuming that I am the expert on how the various question types work then you are wrong. They are as mysterious to me as to you and I always have to look at the code to see how they work. I sometimes think that they were deliberately written in as complicated a fashion as possible.
In reply to Joseph Rézeau

Re: Cloze export

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

For the (rare?) users of Cloze/Embedded type of Quiz questions, I am pleased to announce that it is now possible to export/import question categories containing such Cloze questions.approve

MOODLE - New XML export/import functionality for Quiz Cloze-type questions
by Philippe Vignoles (and Joseph Rezeau) 28 MAY 2006.
There are 2 different versions: for all 1.5+ (including 1.5.4) versions and for 1.6 version.

NOTE.- The version for 1.6 includes support for Joseph Rézeau's regexp question type. More info here.

Rationale

Standard distributions of Moodle 1.5+ and 1.6 (beta) do NOT include support for exporting/importing Cloze/Embedded type questions. We are providing support for these questions (for the Moodle XML format only). All you have to do is to copy the relevant format.php file to overwrite the format.php file in your current Moodle installation. Please
note that this new functionality does not restrict export/import to Cloze-type questions; it will allow you to export/import question categories containing all types of questions, including Cloze-type questions.

Installation

FOR MOODLE 1.5+
Copy file \15\format.php to overwrite file \moodle\mod\quiz\format\xml\format.php.

FOR MOODLE 1.6
Copy file \16\format.php to overwrite file \moodle\question\format\xml\format.php.

IMPORTANT.- When exporting/importing question categories including Cloze type questions, always select "Moodle XML format" from the export/import File format dropdown list!

It would be helpful if as many Moodlers as possible would test this new functionality so that we could propose to make it part of a future Moodle distribution (maybe 1.7). Please report bugs, etc. in this thread or directly to Joseph Rézeau.

Joseph

In reply to Joseph Rézeau

Re: Cloze export

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

In previous post, I forgot to mention that the new proposed XML export/import facility also supports the Description type of question. In enclosed zip file: added French readme file and new format.php file for Moodle 1.6 with Description question support.

Joseph

In reply to Joseph Rézeau

Re: Cloze export

by netm@n by -

I have tried to install that usefull feature for me. Thank you for your efforts in developping something like it.

I use 1.5.3+

It does work when  I tried to export CLOZE questions.

It does not work when I tried to import the same .xml file back.

After importing process I can see questions in a category - but those questions are empty they consist only from "Array "

Another problem exists: I use cyrillic(Russian) letters in questions - some of them transcoded incorrectly during export process (import could not be tested)

In reply to netm@n by

Re: Cloze export

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hello,
Yes, I have sometimes had the problem of empty questions consisting only of Array after the import process. But I have not been able to reproduce the problem again. Let's wait until more people test this and report.
As for the cyrillic alphabet, I think the forthcoming version 1.6 of Moodle, which is utf-8, should solve this kind of problem, but I can't say more about it.
Joseph
In reply to Joseph Rézeau

Re: Cloze export

by Moodle Coder -

Hello Joseph,

I downloaded and installed format.php and I do have the same problem of "Array" being the only thing imported.

Do you have a sample or example of the XML file that I can use as a reference ?

Thanks,

In reply to Moodle Coder

Re: Cloze export

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Which Moodle version are you using?
Joseph
In reply to Joseph Rézeau

Re: Cloze export

by Moodle Coder -

Joseph

I am using 1.5.4 .. I managed to import multiple questions using the sample XML you had available. I think my error was due to html tags within the xml

eg <p> instead of &lt;p&gt;

I am having some other trying to get some special characters in like a div sign for instance - I have tried &#247; , &divide;  etc but they do not seem to work. I am continuing to try some things.

But this embedded Cloze type is just wonderful. Thank you!

In reply to Joseph Rézeau

Re: Cloze export

by netm@n by -

Is there any chance to add a Penalty factor: field export and import. It would be very usefull for me and for others.

Also cyrillic support is critical for me. Now all cyrillic letters are converted into some chineese or japaneese...

In reply to Joseph Rézeau

Re: Cloze export

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
...I'm not sure if you have CVS access. Has any of this been added to CVS? I am keen to add the feature to 1.6 - not too worried about 1.5 now though.