scientific notation

scientific notation

by Björn Gerß -
Number of replies: 4

Hi everyone,

is there a way to check in stack if a student answer is written in scientific notation?

Like 3.4*10^4 instead of 31400 or like 34*10^3 instead of 31400.

Thanks for your comments.

Björn


Average of ratings: -
In reply to Björn Gerß

Re: scientific notation

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Try the OU's suite of three 'variable-numeric' question types. https://moodle.org/plugins/qtype_varnumeric
In reply to Tim Hunt

Re: scientific notation

by Björn Gerß -
Thanks for the suggestion. I will try it out. But I was actually looking for a way inside stack.
In reply to Björn Gerß

Re: scientific notation

by Malthe Sporring -
scientific_notationp(ex) returns true if ex is written in the form a10^n. So you can check CASEqual SAns=scientific_notationp(ans1) TAns=true. Note you probably want to turn Question-level simplify off in the options so the model answer is displayed correctly.

Note also this does not work if the student answers in the form aEn. See https://github.com/maths/moodle-qtype_stack/issues/608