# Trying to create self-checking graphs/equations. Latex is not matching

I have just started to learn to use computation layer. I am creating a series of slides that asks students to write an equation to match the graph shown. I have the CL on the note like this

content:
when T1input.submitted and T1input.latex = “y=3\left(x-1\right)^{2}-5” “\n\Nice Job! Continue on!”
when T1input.submitted “\n\Try again!”
Some hints:
Did you remember that h is always backwards?
Did you remember that a larger a value makes the graph skinnier?"
otherwise "Write an equation below to match the quadratic on the screen.
Remember that you can write these in the form y=a(x-h)^{2}+k
a - controls width and whether it opens up or down
h - controls horizontal location of vertex
k - controls vertical location of vertex"

The equation I would like them to match is what is in the code [y=3(x-1)^2-5], but every time I submit the math input with that equation, it goes to the try again screen. I have tried it with y=2x and it works well, shows the “Nice Job” screen. What’s wrong with the way I have typed my code?

It’s very difficult to match latex. Instead, you’ll want to evaluate at a few solutions and/or countNumberUsage. There are a number of threads addressing this.

I was able to find an example of what you meant (i followed this thread from you Check Algebraic Expression Answer). I have defined a check1 variable that evaluates the equation they type in. However, now I am trying to make it say correct when check1 is true. How would I type this in to code so that it says

content
when submitted and \${check1}=true

content of a note? and which component is check1 in?

content: when T1input.submitted and componentName.script.check1 “Nice Job!”
when T1input.submitted
otherwise

(You don’t ever have to say =true when checking for anything.)

Thank you! I have this now in the note CL:

Content:
when T1input.submitted and Note1.script.check1 “\n\Nice Job! Continue on!”

It seems to be working now!

1 Like

Sorry to bother again. I am trying to do the same thing with a circle now. I am using a similar check variable but it is not working properly. I am assuming because the circle function is not in y= form. How can I check that the student submitted the right circle? I figured out I had to use rawExpression instead of function to graph the input, but that same idea doesn’t work with evaluate.

You don’t have to use rawExpression. I don’t have time to give an example at the moment, but you’ll want to use parseEquation and differenceFunction.

Thank you. I will try those out. I appreciate your help.

I am also working on circles. Did you figure something out?