Cloze-test isn't working, what can I do?

Cloze-test isn't working, what can I do?

by Csaba Gloner -
Number of replies: 15

The Cloze-test question-type isn't working on my moodle 2.1.

If I try it with the example from docs.moodle.org

Match the following cities with the correct state: * San Francisco: {1:MULTICHOICE:=California#OK~Arizona#Wrong} * Tucson: {1:MULTICHOICE:California#Wrong~%100%Arizona#OK} * Los Angeles: {1:MULTICHOICE:=California#OK~Arizona#Wrong} * Phoenix: {1:MULTICHOICE:%0%California#Wrong~=Arizona#OK} The capital of France is {1:SHORTANSWER:%100%Paris#Congratulations! ~%50%Marseille#No, that is the second largest city in France (after Paris).~*#Wrong answer. The capital of France is Paris, of course.}.

I get the following Error after save (with Decode and verify everithing seems to be OK):

Error writing to database

When I try to open the test, I get the following:

Coding error detected, it must be fixed by a programmer: This question is of a type that is not installed on your system. No processing is possible.

Then, if I open the test for editing, the code has been changed to:

Match the following cities with the correct state: * San Francisco: {#1} * Tucson: {#2} * Los Angeles: {#3} * Phoenix: {#4} The capital of France is {#5}.

What can I do?

La media da valetaziuns: -
In reply to Csaba Gloner

Re: Cloze-test isn't working, what can I do?

by Joseph Rézeau -
Maletg da 	Core developers Maletg da 	Particularly helpful Moodlers Maletg da 	Plugin developers Maletg da 	Testers Maletg da 	Translators

Cannot reproduce this problem on latest Moodle 2.1.2+ (Build: 20111012).

Is that a brand-new 2.1 Moodle installation or an upgrade from a previous version and if so which one?

Have you recently installed 3rd-party plugins, especially 3rd-party questions on your moodle site? Or is it "standard"?

Have you actually managed to create CLOSE questions on your moodle 2.1 before? Or is this the very first time you have tried?

We need more information...

Joseph

La media da valetaziuns: -
In reply to Joseph Rézeau

Re: Cloze-test isn't working, what can I do?

by Csaba Gloner -

Dear Joseph,

thank you for triyng to help me.

(1) I'm using a relativly new installation. (Moodle 2.1.1 (Build: 20110801)

(2) I didn't installed any plugins, no 3rd-party questions (Maybe it is the solution, though, if the problem persits, with a 3rd-party plugin I could build cloze-tests with multiple choice)

(3) This was my first attempt to create close-test

Something important I forgot: I can create close texts with short answers, only the multiple choice answer isn't working

Csaba

La media da valetaziuns: -
In reply to Csaba Gloner

Re: Cloze-test isn't working, what can I do?

by Hugo Callens -

FYI: I have exactly the same problem with the same version: Moodle 2.1.1 (Build: 20110801)

La media da valetaziuns: -
In reply to Hugo Callens

Re: Cloze-test isn't working, what can I do?

by Pierre Pichet -

There is effectiveley a bug as seen on moodle demo site

Moodle 2.1.1+ (Build: 20110817)

Debug info: Incorrect integer value: 'C' for column 'answerformat' at row 1
UPDATE question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 1100,
1 => 'C',
2 => 'OK',
3 => 'C',
4 => '1',
5 => '1',
6 => 2191,
)]
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 984 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1016 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
  • line 92 of /question/type/multichoice/questiontype.php: call to mysqli_native_moodle_database->update_record()
  • line 424 of /question/type/questiontypebase.php: call to qtype_multichoice->save_question_options()
  • line 139 of /question/type/multianswer/questiontype.php: call to question_type->save_question()
  • line 424 of /question/type/questiontypebase.php: call to qtype_multianswer->save_question_options()
  • line 181 of /question/type/multianswer/questiontype.php: call to question_type->save_question()
  • line 264 of /question/question.php: call to qtype_multianswer->save_question()
This is MDL-28241 bug that was solved and integrated  26/Aug/11

 As Joseph suggest, migrate to a newer version.
Pierre
P.S. Should we suggest that the moodle demo site could be updated more often ?
La media da valetaziuns: -
In reply to Pierre Pichet

Re: Cloze-test isn't working, what can I do?

by Joseph Rézeau -
Maletg da 	Core developers Maletg da 	Particularly helpful Moodlers Maletg da 	Plugin developers Maletg da 	Testers Maletg da 	Translators

Pierre: "Should we suggest that the moodle demo site could be updated more often ?"

Yes!

La media da valetaziuns: -
In reply to Pierre Pichet

Re: Cloze-test isn't working, what can I do?

by Hugo Callens -

Thx, I'll do the upgrade asap.

La media da valetaziuns: -
In reply to Hugo Callens

Re: Cloze-test isn't working, what can I do?

by Csaba Gloner -

Thanks fo all your answers, the update solve the problem.

La media da valetaziuns: -
In reply to Csaba Gloner

Re: Cloze-test isn't working, what can I do?

by Jennifer Chandler -

I am using 2.1.2+ and am still having this problem. No plugins have been added. Using standard platform.

La media da valetaziuns: -
In reply to Jennifer Chandler

Re: Cloze-test isn't working, what can I do?

by Joseph Rézeau -
Maletg da 	Core developers Maletg da 	Particularly helpful Moodlers Maletg da 	Plugin developers Maletg da 	Testers Maletg da 	Translators

Hi Jennifer,

What do you mean exactly by "I am still having this problem"? Can you please post here the complete text of your Cloze question which is problematic and state what hapens.

Joseph

La media da valetaziuns: -
In reply to Joseph Rézeau

Re: Cloze-test isn't working, what can I do?

by Jennifer Chandler -

I have tried several different questions, but here is one example.

<p>For each word, select the word from the list that is <strong>NOT</strong> a synonym.</p>
<p>purify {3:MC:clarify~fumigate~=castigate~chasten}</p>
<p>dreary {3:MC:cheerless~=abiding~doleful~melancholy}</p>

and the attached is the message I get when I try to save.

Attachment 404 error from cloze.jpg
La media da valetaziuns: -
In reply to Jennifer Chandler

Re: Cloze-test isn't working, what can I do?

by Joseph Rézeau -
Maletg da 	Core developers Maletg da 	Particularly helpful Moodlers Maletg da 	Plugin developers Maletg da 	Testers Maletg da 	Translators

@ Jennifer,

I tried your Cloze question on my local 2.1 moodle site test and it works fine. I see no reason why you should be getting that error message, which I do not recall having ever seen in moodle.

Joseph

La media da valetaziuns: -
In reply to Jennifer Chandler

Re: Cloze-test isn't working, what can I do?

by Pierre Pichet -

Test the following :

1.Look at the question text HTML code using the corresponding button on the editor in case you use a copy and paste from Word to create the question.

2. Use the decode question button to see if your questions are decoded correctly.

Pierre

La media da valetaziuns: -
In reply to Pierre Pichet

Re: Cloze-test isn't working, what can I do?

by Jennifer Chandler -
1. I created the code in Moodle 2. it decodes correctly
La media da valetaziuns: -