Numerical Precision of Moodle Quiz answers

Numerical Precision of Moodle Quiz answers

ved Richard Mott -
Antal besvarelser: 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

Gennemsnitsbedømmelse: -
I svar til Richard Mott

Re: Numerical Precision of Moodle Quiz answers

ved Dominique Bauer -
Billede af Documentation writers Billede af Particularly helpful Moodlers Billede af Plugin developers
Take a look at this example (Very small range values): https://moodleformulas.org/course/view.php?id=22&section=27#id201910201202
I svar til Dominique Bauer

Re: Numerical Precision of Moodle Quiz answers

ved Dominique Bauer -
Billede af Documentation writers Billede af Particularly helpful Moodlers Billede af 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 ↗

I svar til Dominique Bauer

Re: Numerical Precision of Moodle Quiz answers

ved 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

I svar til Richard Mott

Re: Numerical Precision of Moodle Quiz answers

ved Tim Hunt -
Billede af Core developers Billede af Documentation writers Billede af Particularly helpful Moodlers Billede af Peer reviewers Billede af 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.
I svar til Richard Mott

Re: Numerical Precision of Moodle Quiz answers

ved Dominique Bauer -
Billede af Documentation writers Billede af Particularly helpful Moodlers Billede af 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.

Gennemsnitsbedømmelse:Useful (2)
I svar til Dominique Bauer

Re: Numerical Precision of Moodle Quiz answers

ved 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

I svar til Richard Mott

Re: Numerical Precision of Moodle Quiz answers

ved Tim Hunt -
Billede af Core developers Billede af Documentation writers Billede af Particularly helpful Moodlers Billede af Peer reviewers Billede af 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.