There were two errors in your marking algorithm.
The first is just that you got a closing bracket in the wrong place in the "correctPrecision" note, so the 'if' function only had one argument. Anyway, you don't need the 'if', because `if(condition, true, false)` is equivalent to `condition` on its own.
The second error was that I think you assumed that the 'and' operation is lazy, which it is in most languages, but not in Numbas. In the switch statement in "numberInRange", you had `settings["precisionType"]="sigfig" and studentNumber=siground(minvalue, settings["precision"]), correct(),`
When the precision is set to 0 decimal places, both parts of that condition are evaluated, so it tries to calculate `siground(minvalue, 0)`, which throws an error because you can't have 0 sig figs.
A way round this is to notice that whatever rounding method you use, you want to compare the student's number with the expected correct number. So compute the correct number in a separate note, then use that in the numberInRange note to compare with the student's number.