In your case here’s what’s happening:
You can see that the second check fails, and you’re right, it’s down to some small error Desmos introduces in its calculations. Here I’ve check the input evaluated at x=3 and the graph version of that same calculation. Not quite the same.
I don’t recommend evaluateAt for this sort of thing. Use a statistical total and allow for some error bound.
Also, the way this question is set up introduces a lot of brittle code. Try to use something more abstracted that works in many situations. It’ll make doing these sorts of things much more template-y and keep it DRY.
Here’s something I use quite often. It does the following:
- abstracts the function latex to the note itself
- imports that function into the graph, so that you never need touch the graph ever again - just change the note and everything still works
- calculates the total number correct for the student
- persistently shows a check mark on the dashboard if the student gets one - or more - correct.
