Validate input from an expression input

I’m trying to check for errors if a student enters a label in with their numerical value. I already have a “cm” suffix added but knowing some students that doesn’t mean some might not still type in a ‘200 cm’ anyway… Shouldn’t this CL below accomplish this?

errorMessage: when reach.numericValue<0 or reach.numericValue>305 or isUndefined(reach.numericValue) "Enter only the reach as a numerical value, no label or units necessary." otherwise "" 

Here is the AB board it’s for–it’d be on slide 6 and 7

according to this a student could still type a number less than 0 or greater than 305 and receive that message. AB is also pretty good at recognizing labels and separating them from numeric values now, check it out: labels Check Out • Activity Builder by Desmos

I’ll update the errorMessage to make more sense. I’m adding firstDefinedValue to my desmos toolbox, thanks for the help Jay.
Making a note for myself for later on syntax to ignore a label entered by a student:
firstDefinedValue(inputArea.numericValue)=25

1 Like