I’m working on a slope lesson and am wondering if it’s possible for my correctness check to look for “undefined” as an answer. Students can type in 3/0, for example, and it displays as undefined in the math input, but can I use a correct sink when the correct answer is undefined?
I know how to do this with MC, but hoping I can do it with math input while they’re still learning about slope ratios.
wondering if it’s possible for my correctness check to look for “undefined” as an answer
It almost sounds like you want to accept undefined as correct, but assuming it’s that you want to reject it but handle it differently than your typical error, something like this will work:
check = isDefined(this.numericValue) and this.submitted
undef = isUndefined(this.numericValue) and this.submitted
errorMessage: ""
disableEvaluation: true
suffix:
when this.script.check "nice one!"
when this.script.undef "that's undefined"
otherwise ""
correct: check
The advantages being you don’t need to mess with parsing fractions and it will also correct kids who try to enter something else you’re not expecting that would be undefined(such as square root of a negative or something).
You can’t divide by 0 because n/0 is undefined. You might think that it’s ±♾️, but it’s not. You can’t have both infinity sides at the same time. Thus, 3÷0 is undefined.