Numerical Precision of Moodle Quiz answers

Numerical Precision of Moodle Quiz answers

von Richard Mott -
Anzahl Antworten: 7

I have set a quiz in Moodle with numerical answers. Some of these answers are very small eg 2e-16. Unfortunately although I can enter these numbers into the Moodle edit question page, it later on rounds them to 0. This makes it very difficult to automate marking of the quiz. Is there a way round this?


I am not sure which version of Moodle I am using, it's the one at UCL 


Thanks


Richard Mott

Als Antwort auf Richard Mott

Re: Numerical Precision of Moodle Quiz answers

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers
Als Antwort auf Dominique Bauer

Re: Numerical Precision of Moodle Quiz answers

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers

Hello Richard and Tim,

The following simple quiz "Mass of an electron" seems to work perfectly with the Formulas question (but not with the Numerical question).

ForumQuiz_20191108_2029.png

Formulas question type ↗

Als Antwort auf Dominique Bauer

Re: Numerical Precision of Moodle Quiz answers

von Richard Mott -

Dear Dominique and Tim


Thanks

Does this means that, since my students have taken the quiz, I can’t change the behaviour of a numerical question and will have to hand-make all their answers?

Is there any likelihood that the numerical question code will be modified in future so that it can handle very small numbers correctly? This seems to be a common requirement.

If so, how do I put in a formal request?

Best Wishes

Richard

Als Antwort auf Richard Mott

Re: Numerical Precision of Moodle Quiz answers

von Tim Hunt -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers
There is already a 'formal request'. I gave the link to the but report in the database below.

It is obviously a bug, but it will get fixed one day, but hard to guess when. It will get fixed when someone fixes it.
Als Antwort auf Richard Mott

Re: Numerical Precision of Moodle Quiz answers

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers

In the meantime, I suggest you take a look at the Formulas question type ↗. It is quite easy to use and seems to handle small values correctly.

Als Antwort auf Dominique Bauer

Re: Numerical Precision of Moodle Quiz answers

von Richard Mott -

Thanks

I'll bear that in mind for the next quiz. for the current one, it looks like I will have to manually mark the answers, as the students have taken the quiz.

Richard

Als Antwort auf Richard Mott

Re: Numerical Precision of Moodle Quiz answers

von Tim Hunt -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers
I remembered fixing a bug a bit like this, but it turns out that it was in a custom question type (https://github.com/moodleou/moodle-qtype_pmatch/commit/b5b46fa55ce94d457cdb939dedcaf35d098e5250)

Thinking too hard about numerical precision with computer floating point numbers is a good way to make your head explode. I see that MDL-52893 was closed won't fix, but MDL-60483 is still open, and I think it is a valid bug report.