importing multiple cloze questions possible?

importing multiple cloze questions possible?

by koen roggemans -
Number of replies: 21
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
By request of one of our teachers, I'm trying to create a quiz for vocabulary training purposes. The idea is to study vocabulary for two foreign languages at once (yes, language learning is important in Belgium wink ), using random short answer questions taken from various question categories with specific translation directions (French -> Dutch, Dutch -> English etc).

I have a vocabulary list of a few hundred words in Dutch, English and French and I'm making a question bank out of that using the gift import filter for short answer questions. That works fine, as long as I only want one answer (say Dutch -> French, English -> Dutch, ...). But I can't find a solution for two short answers (Dutch -> English and French) in one question, because the cloze import filter apparently has nothing to devide an uploaded file into separate questions (all goes in one question).

Am I missing the obvious here on how to split an import file into multiple cloze questions? Is there a better way to reach my goal?
Average of ratings: -
In reply to koen roggemans

Re: importing multiple cloze questions possible?

by Pierre Pichet -
Sorry but the following comments lines in multianswer/format .php explain why this is not possible.
// Parses an array of lines into an array of questions.
// For this class the method has been simplified as
// there can never be more than one question for a
// multianswer import

Given that the Cloze syntax is not compatible with the GIFT syntax the available solution is to create individual cloze files.
However in this case a cut and paste through the Cloze question regular edit form could be perhaps easier than the import processing of numerous files.

Pierre
In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Thank you for looking at this Pierre, but I don't think it is a solution - just did a count: 1484 questions need to be made ...
The regular edit form also generates only one question at the time, I think.
In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That seems a bit rubbish. It can't be too hard to fix surely? Somebody raise a bug smile
In reply to Howard Miller

Re: importing multiple cloze questions possible?

by Pierre Pichet -
I raise one (MDL-12347) and can work on it but I think that we need a convention to separate each cloze question.
Have you a suggestion ?

Pierre

In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
A blank line? Or am I missing something?
In reply to Howard Miller

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Then you can't enter a blank line in a long cloze question anymore. I suggest more then one blank lines, e.g. two.
In reply to koen roggemans

Re: importing multiple cloze questions possible?

by Pierre Pichet -
You will find a fitrst proposal that use an effective separator i.e a line containing (but not necessarily at the beginning) //NEWCLOZEQUESTION

There is almost zero chance that this will be in the question text and I prefer this to blank lines or other simple separators. Everybody is using a text editor in which you can set this expression for a specific keyboard key combination or use cut and paste. Also when you are using an HTML editor it is very difficult to obtain a real newline mostly you will obtain <br /> or <div></div>.
These very consive Cloze, GIFT convention were often developped when "teletype" your text without any simple cut and paste.

The name has been shorten to 15 characters following the type/questiontype->save_question() code.

You can test it on Moodle Head at
http://132.208.141.198/moodle_head/
user : moodle pw:moodle
Pierre


In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I've tried this one and it works like a charm smile.

I used this file:
aandachtspunt {1:SHORTANSWER:=point of interest}, {1:SHORTANSWER:=singularité}
//NEWCLOZEQUESTION
aandragen {1:SHORTANSWER:=put forward}, {1:SHORTANSWER:=avancer}
//NEWCLOZEQUESTION
aaneengesloten {1:SHORTANSWER:=uninterrupted}, {1:SHORTANSWER:=ininterrompu}
//NEWCLOZEQUESTION
aangeven {1:SHORTANSWER:=indicate}, {1:SHORTANSWER:=indiquer}
//NEWCLOZEQUESTION
aanleren {1:SHORTANSWER:=teach}, {1:SHORTANSWER:=apprendre}
In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by Jean-Michel Védrine -

Hello,

sorry to bring back this very old thread.

I have updated Pierre's version (the one using the //NEWCLOZEQUESTION separator) to work with actual Moodle versions) and as I have done it, as well share it with you smile

It install as a new question import format plugin (qformat_multianswers) rather than replace the existing one (qformat_multianswer) because I don't like to patch Moodle but of course the choice of the name with only one character added was a very bad idea !

In fact I think all this work was a bad idea: as Miroslav suggested it would have been a lot better to modify the program creating these questions to export a Moodle XML file in the first place, rather than creating this qformat_multianswers plugin, but it was done very quickly and it was working, so I was lazy to redo it the right way wink

Just in case it can be useful to somebody else I attach it to this message but I will certainly not bother to submit it to the Plugins directory.

In reply to Jean-Michel Védrine

Re: importing multiple cloze questions possible?

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 "In fact I think all this work was a bad idea..."

Well, maybe it was not such a good idea but we all know it originated from your goodwill to service the Moodle community. And for that we are grateful.

I wish you a Happy New Year 2014, which of course will be full of goodwill and good ideas!approve

Joseph

In reply to koen roggemans

Re: importing multiple cloze questions possible?

by Pierre Pichet -
Finally I have done a version where the separator are two empty lines.
It is available at
http://132.208.141.198/moodle_head_exp/
user: moodle pw: moodle

In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Thanks a lot for your effort Pierre cool
Going to give it a try!
In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I think the //NEWCLOZEQUESTION is a very good idea. Some day someone will come up who wants 2 lines in a cloze question and yes, a character exists usually for another purpose then only separating Cloze questions. I vote for the //NEWCLOZEQUESTION separator.
In reply to koen roggemans

Re: importing multiple cloze questions possible?

by Pierre Pichet -
Which Moodle version are you using?
Do you have access to the code so you can change yourself the format.php file?

Pierre
In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I'm using latest 1.8. I altered the code and couldn't find any problems up to now.
In reply to koen roggemans

Re: importing multiple cloze questions possible?

by Pierre Pichet -
Thanks for the testing
I will put it (CVS) after Howard comments.

Pierre
In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Thank you for the very quick fix. The teacher was extremely enthousiastic smile
In reply to Howard Miller

Re: importing multiple cloze questions possible?

by Pierre Pichet -
I have a solution that works correctly using
//NEWCLOZEQUESTION put in an independent line
I will CVS probably tonight. (and also put the corrected format file on the tracker).
I will also trim the question name to shorter one (30-40 car max)
12345678901234567890123456789012345678901234567890

Pierre

In reply to Pierre Pichet

Re: importing multiple cloze questions possible?

by Rob Jackson -

Dear Pierre, Koen and other Moodlers

I'm trying to upload multiple questions with dropdown options and for the past 48 hours have been drawing blanks!

It keeps putting all the questions under the same question.

I've tried placing //NEWCLOZEQUESTION between each question to try to separate the questions, alas no joy.

I'm a bit of a novice; have been moodling for a month so sorry if the question is daft.

I guess you might recommend XML but that's going to be tricky for me too.

Anyone's help is greatly appreciated, especially in plain Englishsmile

Bobby

In reply to koen roggemans

Re: importing multiple cloze questions possible?

by Miroslav Fikar -
We use Moodle XML format to import several (40-100) cloze questions together in one XML file. If you can transform your input to XML, it works flawlessly. The cloze text remains unaffected in <text> ..</text> tags.
In reply to Miroslav Fikar

Re: importing multiple cloze questions possible?

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Thank you for the suggestion. I didn't think about the XML format yet - never tried it.