|
I was login as a teacher. While i was editing a quiz, I clicked the preview icon. Then a preview window had poped up. On the preview window, I chose an answer from menu of MULTICHOICE type (or submited a digit string of NUMERICAL type). and i clicked the 'submit all and finish' button. After that, i returned to quiz editing and found the quiz of cloze type had broken.
1. a quiz both one and several questions of the cloze type. i checked both cases. Before previewing as a teacher {1:NUMERICAL:=40:0} {2:NUMERCAL :=60:0}After preview {#1} {#2}Impossible to replicate this bug.
Using Moodle 1.6.2+ and Windows 1- Create a new quiz 2- Create a new Cloze type question named Q01. The text of this question is: First numerical answer is 40 {1:NUMERICAL:=40:0} and second numerical answer is 60 {2:NUMERICAL:=60:0}. 3- Move question Q01 into Quiz 4- Still in Quiz edit mode, click on Preview button 5- In Preview mode, enter correct (or incorrect) answer 6- Click the 'submit all and finish' button 7- Return to edit mode 8- Try to edit question Q01 : question text is intact, no problem at all. ------------------------------------------------------------------------------------------- The only thing we can do if for you to export your quiz and attach it to this bug report so we can look at it. Joseph I have this same problem, and it drives me up the wall. It seems to happen if I make a very long cloze question. I have found a sort-of-workaround for it.. when I make the cloze question I must be in HTML source mode, and it will save it correctly.
Steve Dubrick > ...It seems to happen if I make a very long cloze question...
OK, why don't you attach one example of such "very long cloze question" which causes you problems so we can have a look at it? We can' to anything if we can't replicate your problem... Joseph From
------ Cloze questions sometimes become corrupted in the database. For example, what used to be: Buses aren't as {1:MULTICHOICE:fast~fast than~=fast as~faster than} trains. becomes: Buses aren't as {#1} trains. This has happened a few different times in the past, but most recently it's happened to a cloze question which had 50 points in it. This time when I tried to fix it, it kept reverting back to the broken form. It finally worked when I tried saving it as a "new question". Also, in the past i've got around the problem by editing the cloze question when it was in "HTML editing mode".. the WYSIWYG editor often corrupted it. However, i'm not sure what brought on the corruption this time.. it just seemed to happen on its own. ------ The assertion is that previewing is the cause of this problem, but that is hard to believe because nothing it the question previewing code should change the question definitions in the database. It is more likely that they are getting screwed up during the save process. Also, a problem that only happens 'sometimes' is almost impossible to investigate, especially if it never does it on my computer. Before we can make any progress, we really need to try to pin down what is different between the times it works, and the times it fails. Then we able to work out a way of reproducing it, then we can fix it. Unlike the OP, I don't believe it has anything to do with the previewing either, which is one reason I opened a new bug report.
I can give you an example of cloze question, but I'll need to go track down a backup copy of the question from before it got corrupted. At this point the copy i have on hand is in "post-corrupted" format, so I doubt that will help you with the problem (if if does, let me know and i'll post it). It happened at some point within the past few months and I didn't realize it at the time, so i'll need to dig through my collection of backups. However, I still have the original cloze question that i cannot properly save anymore without saving as a "new question" on my server. If you would like, I can give you access to my moodle install and you can see for yourself.. just let me know. This is the result after this happened....
You can see in this XML export all the cloze questions have been changed to {#1} {#2} etc... Question 1245 is the only exception, because I just re-saved it as a new question today when I was trying to fix the problem. Note: Question 420 is the only question I was actively using in a quiz, I made it as a combined question of all the others.. so this was the "long question" i was referring to in the post above. Steve > You can see in this XML export all the cloze questions have been changed to {#1} {#2} etc...
This is not much help, once questions have become corrupted there is nothing we can do. What we need to look at is questions BEFORE corruption happened. There are many questions in your XML file. Please, what is the TEXT of question 1245? Question 1245 is the only exception, because I just re-saved it as a new question today when I was trying to fix the problem. Note: Question 420 is the only question I was actively using in a quiz, I made it as a combined question of all the others.. so this was the "long question" i was referring to in the post above. The XML display showing {#1} is the normal way that the multianswer questions are stored.
each {#1}, {#2} contents are stored in subquestions that contain the subquestion text as entered. When you edit the question, the original text is rebuilt and display. If you change something, the old subquestions are reused or deleted. see I will merge in the next week probably down to 1.6 some of the recent changes I have done to the HEAD code on cloze questions.(as I have to check if when saving as a new question , there is not a potential problem as this process is somewhat only identified by setting the question id = 0.
In the multianswer/questiontype.php there is a function save_question($authorizedquestion, $form, $course) {} that proceeds the subquestions before having a call to the parent save_question() (i.e. the general save_question().). This multianswer/questiontype.php function save_question() has no provision to handle differently the different saving processes. Tim Unfortunately, after searching around I couldn't find any backups that were before the corruption. This is not the first time i've had this problem though, so i'll let you know if it happens again. I've increased the number of backups to keep so that next time i'll be safe.
I've been racking my brain trying to think of what might have caused this to happen. The one thing I can think of is that at some point about 2 months ago I moved these questions from a course in sub-category to the main front page category. Perhaps this broke the questions? Have you access to the database?
If so locate in the mdl_question_multianswer table the item having question == your question id and look at the sequence. You should have a list of subquestion ids like 1223,4556, etc. look at the question table to locate these subquestions. You can also look at the question table for questions having parent == your question_id. When you move the question, the subquestions are not moved ( This should cause no problem because the call to the subquestion does not use the category id but perhaps the subquestions where deleted if the category was deleted. Ah.. well that must be the problem. I believe I did delete that category after moving everything from it
After following your directions I can confirm that the subquestions are no longer there. Here's a sample from my database.. first the mdl_question_multianswer and then mdl_question. You can see that the subquestions (e.g. 111,113,115,117,etc) don't exist anymore in mdl_question INSERT INTO `mdl_question_multianswer` (`id`, `question`, `sequence`) VALUES (1, 4, '5'), INSERT INTO `mdl_question` (`id`, `category`, `parent`, `name`, `questiontext`, `questiontextformat`, `image`, `generalfeedback`, `defaultgrade`, `penalty`, `qtype`, `length`, `stamp`, `version`, `hidden`) VALUES (6, 18, 0, 'leg', '<font size="5">L _ _<br />L{#1}<br /></font>', 0, 'placement_test/vocab2.jpg', '', 1, 1, 'multianswer', 1, 'www.excel-english.com+070703092855+6jQbZy', 'www.excel-english.com+071106043401+dsjuIK', 0), Thanks for your help on this. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1- What do you mean by "cloze type QUIZ" : a quiz consisting of one (or several?) questions of the cloze type?
2- What do you mean by "when editing ... previewing (when answered)"
3- I do NOT understand "his happens only answering while previewing"
Joseph