Trying to show correctness of a linear equation for a given graphed line. The code below works if I take the initialLatex: “y=” line out. Does not work if it is in. Any advice on how to get this to work? Thanks in advance.
Thanks. Not sure I totally understand why it works. I am guessing it is actually using the graph to check. Is there a way to have it show as a Checkmark in the Dashboard as well?
The number b that is calculated in the graph component is a sum of differences between the values of correct function and the student input function at 21 different values of x. If the two functions are identical, there would be no difference, so b will be zero.
I’ve edited it so there will be a dashboard checkmark if the student is correct.
Instead of “this.latex” you’ll need to use “parseEquation(this.latex).rhs”. The issue with your pattern (with y=) is that it’s attempting to check the pattern of an expression rather against an equation. If you parse the right hand side and check that against your pattern, it should work.