I would like the choices: ”strict national” ”generous” with option “accept expressions”
Strict: 3,000.50 (US) or 3.000,50 (Sweden); etc
Generous: all strict variants plus “3 000.50” or “3 000,50” (I’d like to add 3,0005E+3 3,0005*10^3 even 3000½)
Expressions: 3E3+12/2
I’ve used a numerical tutorial quiz written in PERL to which I added a reg expression filter to process the input string before evaluating it numerically. I’m not sure what numerical formats PHP uses natively but for perl I used:
, becomes . (this would make problems with thousands separators unless it checked first for both) ^ becomes ** E becomes 10* and even ½ becomes .5 (though it would be good to warn students that it’s not a good idea to use ½.)
Another possibility would be to have a filtering choice in the individual question before processing the answer string which could have simple: make [,] become [.] or maybe even som reg exp possibility.
It would be good to have a JavaScript warning when users try to use characters that will make problems (not be understood).
- has a non-specific relationship to
-
MDL-51212 Better handling of float input in quiz questions
-
- Open
-