Severe problem parsing cloze questions in Moodle 2.1

Severe problem parsing cloze questions in Moodle 2.1

by Orestes Mas -
Number of replies: 13
Picture of Translators

Hello, forum,

I want warn all users planning to upgrade to Moodle 2.1, specially those making intensive use of quizzes, against a bug I'm facing triyng to manage cloze questions.

In short, moodle code doesn't parse correctly the information regarding sub-questions, so the cloze question cannot be written into the database.

To test it, create a cloze question in Moodle 2.1 with the following HTML content:

<p>Sub-question 1: {2:NUMERICAL:=5E-3:1E-4}</p>
<p>Sub-question 2: {1:MULTICHOICE:%100%Yes~%0%No}</p>

Then try to save it: you'll get an "Error writing to the database" message. If you have debugging turned on you will notice that moodle is trying to write erroneous information into the database (basically data to be written apperars to be shifted from their correct positions, so textual data ends up into a numerical field raising an exception).

I've reported this bug (see MDL-28241) but at this time nobody has commented on it yet, so I report the bug here to see if anybody is experiencing the same problem, and to attract attention over it.

Until resolved you'll be unable to manipulate cloze questions: you cannot create, edit, or export/import them, so is a big issue in my opinion.

Average of ratings: -
In reply to Orestes Mas

Re: Severe problem parsing cloze questions in Moodle 2.1

by Carl Hodkinson -

Hi Orestes,

Just to let you know that you are not alone. I too am getting the same message as the one you posted in MDL-28241.

Strangely, the short answer question worked fine (I only did the simplest of questions). Saying that, it did not return the feedback just in case this is something to do with the problem. Will add this to report in tracker.

Carl

In reply to Carl Hodkinson

Re: Severe problem parsing cloze questions in Moodle 2.1

by Orestes Mas -
Picture of Translators

Hi Carl, thanks for the comments. I assume different kind of questions are treated and parsed by different parts of the code, so some questions may work and others may not.

In reply to Orestes Mas

Re: Severe problem parsing cloze questions in Moodle 2.1

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

Bug confirmed,

Joseph

In reply to Joseph Rézeau

Re: Severe problem parsing cloze questions in Moodle 2.1

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

OK. I'll try to fix it when I get back from holiday - assuming Pierre does not beat me to it.

In reply to Tim Hunt

Re: Severe problem parsing cloze questions in Moodle 2.1

by Pierre Pichet -
Cannot beat you at least because I have only access to my wife Ipad smile
Pierre
In reply to Tim Hunt

Re: Severe problem parsing cloze questions in Moodle 2.1

by Orestes Mas -
Picture of Translators

Ok. So have nice holidays, Mr. Tim "Bug" Hunt, and recharge batteries. Here we can really 
live without a bug fix until september. smile

In reply to Orestes Mas

Re: Severe problem parsing cloze questions in Moodle 2.1

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

What, do you mean "Mr. Tim Hunt" won't be back from his holidays until September.thoughtful We'll all miss him in the interim period.

I hope you do recharge those batteries and come back full of energy as always, Tim. Enjoy your hols.cool smile

Joseph

In reply to Joseph Rézeau

Re: Severe problem parsing cloze questions in Moodle 2.1

by Simon Clegg -

Sorry, I posted a bug in the tracker before I saw this dicussion. I couldn't find a similar bug in there so I hope I haven't created a duplicate.

The problem is that when you try to save a multichoice question, it's pushing the wrong value into the answerformat column:

 

Debug info: Incorrect integer value: 'C' for column 'answerformat' at row 1
UPDATE mdl_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 73,
1 => 'C',
2 => 'OK',
3 => 'C',
4 => '1',
5 => '1',
6 => 113,
)]

I've not had a chance to check the code to find a fix for this yet but if anyone else could it woudl be great!

In reply to Orestes Mas

Re: Severe problem parsing cloze questions in Moodle 2.1

by Stefan Eberhard -

Orestes: Does the issue affect the use of already existing cloze questions (without editing them)?

In reply to Stefan Eberhard

Re: Severe problem parsing cloze questions in Moodle 2.1

by Orestes Mas -
Picture of Translators
No AFAIK. Once into the database, this questions are correctly handled and graded. I've test them in several quizzes without problems.
In reply to Orestes Mas

Re: Severe problem parsing cloze questions in Moodle 2.1

by Rick Houghton -

Hopefully this issue gets resolved by September. I use Cloze quizzes frequently!