Need help with correct answer

Here is a screen shot of my activity page. Students will type in the correct equation and if it is correct the dotted line turns solid. But sometimes students do not use the correct values. Instead they use a decimal instead of an exact value like pi/6 and it still looks correct unless they zoom in on the graph. So I would like it to say “correct” when they type in the equation as well. Any idea how to do this coding?

Hi Stephanie! This is only a partial solution, but here’s a graph that uses an integral to check if two functions, f(x) and g(x), are equivalent. If a student typed enough decimal points, the graph would still mark it correct. You can adjust the second argument of the round function to fine tune how sensitive the match is. I hope this helps!

Thanks for your reply…I was able to get the checkmark but it isn’t showing up when correct…instead it is showing up all the time and not when the correct function is typed in.

I’m not seeing a checkmark at all. Maybe you haven’t re-published yet?

So sorry…I published it!

I looks like for c_{heckmark} you changed {f_unctionsMatch = 1} to {...= 0}.

You’ll also want the dotted graph to be h(x) or something so it doesn’t conflict when students enter g(x).

I fixed it and it worked!!! THANK YOU SOOO MUCH!

1 Like

So for some reason it worked and now I don’t know what happened…

The variable, g, already defined conflicts with a student putting in a function, g(x), because the c_heckmark function doesn’t know which one to use.
If you want to pre-define g(x), so you can see the c_heckmark function is working, make it visible to the student and have them edit it.