Checking a linear equation

I wrote the CL to check a linear equation the students would input into a math input box and it keeps giving me an error. I am not sure what I am doing incorrectly.

correct: graph4.number(“I”)=1

content:
when isUndefined(input4.latex) “Enter an equation for the graph on the left.”
when input4.latex=“y=6x+30” “You did it! Make sure you click Submit below.”
otherwise “Keep thinking! What’s the equation?”

Notes don’t have correct: sinks. Graphs and math inputs have correct sinks. So you need each of those to have a correct sink. If you don’t want to “correct” one, put readOnly: true. This will ignore that component as far as the dashboard checkmark goes.

I did a template that you can easily adapt to your needs

I found a way for the program to check the equation, but couldn’t figure out how to let the student know he/she got it correct.

correct=y=2x-2
correct: this.latex= correct

Thank you for this template. It is very helpful.