Hello everyone, I’m new with Desmos but I have some coding experience. I was wondering someone could help me with this.
I’m creating a quadratic equation activity where roots are complex, 2+1 and 2-1 so I created two Math answer boxes input for students to input their answers. I was able to use this code to check the first answer: check = this.latex = 2+i or this.latex = 2-i correct: check
For the second Math answer box, I will like to check that:
List item if the first answer entered is 2+i then the correct will be 2-i
List item if the first answer entered is 2-i then the correct will be 2+i
How can I do this? Any other advise will be appreciate.
If you want to use an evaluative method instead of latex matching, you can “trick” desmos into evaluating complex answers by making a function in terms of i.
#student input as a function in terms of i
f=simpleFunction(this.latex,"i")
#checking for 2+i
checkPosI= f.evaluateAt(0)=2 and f.evaluateAt(3)=5
#checking for 2-i
checkNegI= f.evaluateAt(0)=2 and f.evaluateAt(3)=-1
correct: checkPosI or checkNegI
For box2 CL repeat above except last line
correct: (box1.script.checkPosI and checkNegI) or (box1.script.checkNegI and checkPosI)