-
Bug
-
Resolution: Done
-
Minor
-
4.1.1
-
-
MOODLE_401_STABLE
-
MOODLE_402_STABLE
-
Moodle App 4.2.0
Whilst testing quiz, we realized that in some situations the following error is returned when calling webservices:
Invalid external api parameter: the value is "NaN", the server was expecting "float" type
Looking into this, the problem is related with a string that is parsed into a Number but wasn't one. In particular, the returned grade was the string "-" instead of a number. This is to be expected, but because NaN has type number in TypeScript, this error hasn't been caught with the type system.
This can be solved by simply adding an if before calling the webservice, but this fix leaves the door open for this error happening again in the future. So the correct solution should involve introducing type safety here (maybe using Branded types).
- Discovered while testing
-
MOBILE-4278 Question types visualisation is broken
- Closed