Hi all,
I’m trying to edit screen 5 of Michele Anderson’s awesome step-checking activity, found here: Solve Linear Equations • Activity Builder by Desmos
Students input equations into the table and receive positive feedback as long as the equation they write has the same solution as the original equation.
Here is the original code, which works as long as the cell in the table has an equation in x, but does NOT work if the students use “n” as the variable instead.
answer=6
left1=parseEquation(this.cellContent(1,1)).lhs
right1=parseEquation(this.cellContent(1,1)).rhs
check1=simpleFunction("\abs(${left1}-(${right1}))").evaluateAt(answer)<0.001
Later in the code, it makes it so that when “check1” is true, they get feedback that it’s correct, and otherwise they get feedback that it’s incorrect.
I want to be able to have equations that use variables other than x (e.g. n, p, etc.). So, I’ve tried to implement the solution offered in this post:
So I did this:
left1=simpleFunction(parseEquation(this.cellContent(1,1)).lhs, "n")
right1=simpleFunction(parseEquation(this.cellContent(1,1)).rhs, "n")
check1=simpleFunction("\abs(${left1}-(${right1}))").evaluateAt(answer)<0.001
But then got the same error described in this post:
And I’m not really understanding well enough how to apply the solution described there to this situation. Nothing I’ve tried changes the error.
Thanks for any help you can provide!
EDIT NOTE: Edited to link to Michele’s original activity instead of my edited copy.