Right now I have it almost working exactly the way I want it to, but it is still saying a graph is correct if the slope is right OR if the y-intercept is right. So, it confuses students who have just one part right and it is telling them the whole thing is right. Not sure how to fix it.
In your graph, you have I(x,y) = {m=3,b=0:1,0}. The comma makes this an “or” statement, so either being correct returns true. If you want to require both, you can use one as a restriction to the other I(x,y) = {m=3{b=0}:1,0}. Alternatively, you can use a number sink that uses your CL correctness to define it, instead of correcting in the graph. Is this what you mean?
line = `y=1/2x-6`
m = xyLine(line).slope
b = xyLine(line).yIntercept
For Feedback (NOTE: CL CODE)
hidden: not(graph.script.correct)
graph(Graph: CL CODE)
xTransform = simpleFunction(`x`,`x`,`y`) # Change all x values to themselves (x)
yTransform = simpleFunction(`0`,`x`,`y`) # Change all y values to 0.
flatten = this.sketch.transform(xTransform,yTransform)
You’re using a bunch of code that works for sketches, but graphs don’t have the same sources. For example, .xValuesAt() is only for something sketched, and doesn’t work with values within a graph. Good thought though!