I see a couple of issues revolving around the rounded vs raw answers. s10input2
is checking against the raw answer instead of the rounded, so unless it’s already rounded to the nearest tenth, it’s not going to work.
Second, you’re checking unrounded values of the lhs
and rhs
. I’d suggest maybe using .differenceFunction()
instead and seeing if the absolute value evaluates within a tolerance:
checkProportion = numericValue(`\abs(${parseEquation(this.latex).differenceFunction(`x`).evaluateAt(answer)})`) <= 0.1
You may need to play with the tolerance (0.01 was immediately too small).