I have numeric questions for which the correct answers are numbers such as 00000 and 001011. The problem is that Moodle drops the leading zeroes.
When setting up the quiz, is there a character I can add to tell Moodle to not drop the leading zeroes?
Thank you for your help!
Unless you require a tolerance in your answers, you can just go with a short answer type question and it will have the same result.
In case anyone else is following this, I thought I would report back.
I changed my question type from numeric to short answer, but Moodle still shows the correct answer as 0 (when I ask it to display the correct answer), even though the correct answer is 000000. It grades it correctly, which is more important, but it is still truncating the six zeroes to one zero when it displays the correct answer. I think for this quiz, I will suppress showing the right answers during feedback, just to avoid confusion. Not optimal but it will work.
I changed my question type from numeric to short answer, but Moodle still shows the correct answer as 0 (when I ask it to display the correct answer), even though the correct answer is 000000. It grades it correctly, which is more important, but it is still truncating the six zeroes to one zero when it displays the correct answer. I think for this quiz, I will suppress showing the right answers during feedback, just to avoid confusion. Not optimal but it will work.
Janet "Moodle still shows the correct answer as 0 (when I ask it to display the correct answer)..."
I don't understand what you mean, on attached screenshot all 6 zeroes are displayed.
Joseph
Well, Janet, what do you say?
Joseph
Joseph
Joseph,
It is really puzzling to me that you were able to make it work. I could not get either the numeric question type OR the short-answer question type to return a string of zeroes back to me in the form of the correct answer or the student-supplied answer.
I am using Moodle. 1.9.7.
Janet
It is really puzzling to me that you were able to make it work. I could not get either the numeric question type OR the short-answer question type to return a string of zeroes back to me in the form of the correct answer or the student-supplied answer.
I am using Moodle. 1.9.7.
Janet
Joseph, I think Janet is referring to the cloze shortanswer whereas your screenshot above is of the short-answer question type. I've just reproduced the problem in 1.9.4+. The question cloze code is: {:SHORTANSWER:=00000#00000}
Itamar, I'm surprised that Janet would have been referring to the Cloze question originally, because in a later post she wrote "I changed my question type from numeric to short answer...". The numeric question type does not exist in Cloze!
Janet, what do you say?
Joseph
PS.- I am of opinion that it often makes things much easier to understand and saves a lot of guess-work when people can post screenshots to complement their posts (like we both do ).
It was precisely the Unbearable Lightness of Changing that the clause you quoted seemed to convey that made me think of the cloze type despite the possible terminological imprecision in 'numeric' as opposed to 'numerical'.
{:NUMERICAL:=00000:0.0#00000}
=>
{:SHORTANSWER:=00000#00000}
But that may just be the roundabout way I sometimes see things.
{:NUMERICAL:=00000:0.0#00000}
=>
{:SHORTANSWER:=00000#00000}
But that may just be the roundabout way I sometimes see things.
Seems to be fixed on Moodle demo so it might have been reported and fixed between 1.9.7 and latest 1.9.x.
As others have said, those answers are not numerical quantities, because you are interested in the specific form of the answer, not just the numerical quantity.
Therefore, you should be using the short answer question type.
In the past, there have been bugs where the shortanswer question type got confused by string like '0'. This is to do with with some of the weird things that PHP (the computer language that Moodle is written in) does by default. I thought we had successfully found an fixed all of those, but if you do find a situation where an answer like 00000 is not processed correctly, please report it, but be very specific about exactly where the problem is. (For example, if you can make a screen-grab that demonstrates the problem, that would be good.)
Therefore, you should be using the short answer question type.
In the past, there have been bugs where the shortanswer question type got confused by string like '0'. This is to do with with some of the weird things that PHP (the computer language that Moodle is written in) does by default. I thought we had successfully found an fixed all of those, but if you do find a situation where an answer like 00000 is not processed correctly, please report it, but be very specific about exactly where the problem is. (For example, if you can make a screen-grab that demonstrates the problem, that would be good.)
While we're talking about zero's, GIFT format chokes when importing numeric answers of 0, I guess for some obvious reasons. (moodle 1.9.8 I think) Is that Howard's purview?
Would be great if you could make a really simple import file that demonstrates this problem with one question. Then file an issue at http://tracker.moodle.org/ and assign it to Howard.