numerical answer in cloze type question

numerical answer in cloze type question

by Cristina Berisso -
Number of replies: 1

Hello everyone,

Could somebody help me with an issue I am facing with cloze questions behaving different in my courses after migrating from Moodle 1.6 to Moodle 1.9?

I have used cloze type questions in my Math courses in Moodle 1.6 where a "numerical" answer typed in fraction form was properly understood. With this I mean that the expression 3/2 for example was understood by Moodle as three halves. Now that I have migrated to Moodle 1.9, it seems that something has changed, or I am missing some setting that I am not aware of, since by using the same questions that worked before, now the students that enter a fraction as answer are not marked correct.

I am appending below an example of such type of questions in cloze format:

<p>Solve for $$x$$ in the following non-linear inequality:</p>
<p>$$2\,x^2\,+\,9\,x\,-\,5\,\le~\,0$$</p>
<p>Give your answer as an inequality statement for $$x$$. Complete your answer statement on the line below by selecting the appropriate inequality symbols from the drop down menus and by typing the appropriate numerical values in the boxes. Use the "slash" key on the keypad to type a fraction line in case fractions are needed:</p>
<p>{1:NUMERICAL:=-5}{2:MULTICHOICE:&lt;~=&\#8804;} $$x$$ {1:MULTICHOICE:&lt;~=&\#8804;}{2:NUMERICAL:=1/2}</p>

In this case, when the student enters 1/2 in the last answer box, Moodle gives him/her no credit, but shows as correct answer "1/2."

My students starting complaining about some of the questions in my last quiz, so what I have done is to change the fractional answer in the affected questions from "NUMERICAL" to "SHORTANSWER", but I wonder what could have happened that numerical answers do not accept fraction form any more. I am fearing that I would have to dig all questions that contain this type of answers from my huge question bank to have them working again sad. I would love to hear that there is some setting that I have forgotten in the migration, and that I could go back to the properly working questions adjusting it.

Thank you very much for your help!

Cristina

Average of ratings: -
In reply to Cristina Berisso

Re: numerical answer in cloze type question

by Pierre Pichet -
Hi Cristina,
Changes have be done by Tim at least one year ago.
The answer should be numeric i.e.
if (!(is_numeric($trimmedanswer) || $trimmedanswer == '*')) {
$errors["answer[$key]"] = get_string('answermustbenumberorstar', 'qtype_numerical');
}

I will let him complete the response.

Pierre