simpleFunction evaluateAt result not giving me correct feedback

compinp = simpleFunction(parseEquation(this.latex).rhs, x)
compinppi = compinp.evaluateAt(numericValue(\pi))
compinpe = compinp.evaluateAt(numericValue(e))
compans = simpleFunction(5\left(5x-x^{2}\right)-\left(5x-x^{2}\right)^{2}, x)
companspi = compans.evaluateAt(numericValue(\pi))
companse = compans.evaluateAt(numericValue(e))

correct: correct
correct = ((numericValue(abs(${compinppi}-${companspi}))<0.1) and (numericValue(abs(${compinpe}-${companse}))<0.1))
#or parseEquation(this.latex).rhs=5\left(5x-x^{2}\right)-\left(5x-x^{2}\right)^{2}

initialLatex: f\left(f\left(x\right)\right)=

I want this to compare a student’s input with the correct expression and determine it is equivalent based on the absolute value of the difference being close enough to 0 for inputs of pi and e. I don’t know why it is not working.

You have the right idea, but I think all of your backticks and quotes got stripped out of this? It’s hard to tell exactly where the error is because of that. (EDIT: I see - when I copy/pasted it the formatting made the quotes disappear… in the future, it’s easiest to just post a link to the activity where you have the code).

I modified the code that way that I would do this: input test • Activity Builder by Desmos Classroom

Yes, sorry about that.
Here you go.

slide 2, question 1-2, component “a2b”

do you think the main issue with my code is the issues with lhs and rhs of parseEquation?

Also, what does “p=patterns” and the method “p.literal()” do?

No I think the only problem is in your absolute value check, because abs(X) isn’t proper latex. If you replace abs(X) in your expression with \left|X\right| it should work. The best plan is to type your expression into a math box in Desmos, copy it, and then paste it into CL and it will have perfectly formatted latex. That would give you something like \operatorname{abs}\left(X\right) which would work as well.

patterns is a whole other subject. There is basically a patterns library, which you access by typing pattens.patternname so p = patterns lets you use p.patternname as a shortcut.

“literal” is one of the pattern names, which lets you match/parse specific variable names.

If you want to learn how to use pattern matching, you can start with this set of videos.