Question type numeric

Question type numeric

by Eva Koperdakova -
Number of replies: 11

One of teachers objected numeric type of question not working properly.

The thing she is objecting to is that, when correct answer set to for example 20 or 20.0 not only those answers are accepted, but 20abc as well. Units are not used, nor graded.

How to disable characters to get the one and only correct answer - only numbers?

Eva


Average of ratings: -
In reply to Eva Koperdakova

Re: Question type numeric

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Eva,

The "numeric" question type does not exist in Moodle. Could you tell exactly what type of question it is. Is it "numerical", "calculated", "formulas with numeric answer type"? These question types do not behave as you describe. Is it some other type of question? An example (XML file) accompanied by a screenshot could allow us to better understand the problem. Please also mention which version of Moodle you are using.
In reply to Dominique Bauer

Re: Question type numeric

by Eva Koperdakova -
Hello,
I apologize for not being exact. As I did not check in English and I am not a teacher, I am not using it.
It is type Numerical. Moodle is 3.9.
I tested it with 20.0, with units, without units, with wrong answer as *. I can't find the setting, that only plain 20 or 20.0 is correct. I always get that 20abc is accepted as correct. Teacher wants 20 as correct, and 20whatever as incorrect. She is a math teacher. Perhaps different type?
(See enclosed shots.)
Eva




In reply to Eva Koperdakova

Re: Question type numeric

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Eva,

In the question settings and under 'Unit handling', set 'Unit handling' to 'Units are not used at all. Only the numerical value is graded'.
In reply to Dominique Bauer

Re: Question type numeric

by Eva Koperdakova -
As I have already mentioned, I did set: Units are not used at all. Only numerical value is graded. And the result is on the screenshot provided.
e.
In reply to Eva Koperdakova

Re: Question type numeric

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
All I can say is you should double-check. The Numerical question type does not behave as you describe.
Other people may be able to help you.
In reply to Dominique Bauer

Re: Question type numeric

by Eva Koperdakova -
Actually it does. I have moodle 3.5 as well, tested such a question, it does the same.

In reply to Eva Koperdakova

Re: Question type numeric

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Sorry, cannot reproduce your problem. Please export that numerical question and attach the xml file to your reply so we can have a look.
In reply to Joseph Rézeau

Re: Question type numeric

by Eva Koperdakova -
Well, I have only one testing question and after attempt is says "incomplete question". When I submit, the answer is taken as correct. When I take the option "Return to attempt" and should change my answer, this is the point it says "You must enter a valid number. Do not include a unit in your response." When I ignore it and submit anyway, the answer is evaluated as correct.
In reply to Eva Koperdakova

Re: Question type numeric

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

Hi Eva and thanks for attaching your sample question.

I confirm your findings. There is definitely something wrong in the way numerical questions are assessed. The documentation states:

Units can also be specified. For example, if you enter a unit of 'cm' here, and the accepted answer is 15, then the answers '15cm' and '15' are both accepted as correct.

OK, let's have a numerical question with '15' as the correct answer and 'Unit handling' set to 'Units are not used at all. Only the numerical value is graded'.

The illogical feedback behaviour depends upon the question behaviour.

  • behaviour = Deferred feedback: '15cm' is accepted as correct upon submitting answer with this message "The correct answer is: 15"
  • behaviour = Immediate feedback with CBM: '15cm' is accepted as correct upon checking answer
  • all other behaviours: '15cm' triggers the error message: "You must enter a valid number. Do not include a unit in your response."

@Tim, this definitely looks like a bug. What do you think?

In reply to Joseph Rézeau

Re: Question type numeric

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Eva, Joseph and Tim,

I fully confirm Joseph's findings.

In science and engineering, it is generally agreed that it is important for students to learn how to correctly indicate units. In some cases, it is equally important for students to know that some quantities do not have a unit. So, for example, if a student gives 15 cm as an answer and the correct answer is actually 15, Moodle should point out to the student that their answer is incorrect.

As Joseph said, the Numerical question intercepts the student's error, of putting a unit, in Adaptive mode, Interactive with multiple tries, etc. but not in Deferred feedback and Immediate feedback with CBM, and in the latter two modes no penalty is applied, which is a mistake or a bug.

With the Formulas question, the student does not receive a message if he/she puts a unit when there is no unit, but he/she loses a try. In Deferred feedback and Immediate feedback with CBM, where there is only one try, the student loses the whole point. This is a bit harsh, but it is correct.
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Question type numeric

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Interesting. it looks like CBM behaviour is not hadling the invalid state correctly.

Looks like this line is the problem: https://github.com/timhunt/moodle/blob/master/question/behaviour/immediatecbm/behaviour.php#L101. Should be is_complete_response, not is_gradable_response, like https://github.com/timhunt/moodle/blob/master/question/behaviour/immediatefeedback/behaviour.php#L108. It should also check that certainly is set, and if not report it as invalid rather than trying to grade.

Someone should make a tracker issue for this, if we don't already have one.