I am creating an activity where students are given an image of a figure that has been translated and I want them to edit the following input to represent the transformation algebraically. For example (x,y)→(x-2,y+1).
I have the CL below included, so all students have to do is add the operation and number to each variable.
initialLatex: “(x,y)→(\ \ \ )”
What CL do I need to write so I can see a “Green Check Mark” in the teacher dashboard if the student puts the correct inputs?
It’s gotten easier bc Desmos understands LaTeX type directly now, so you can check their input directly and not worry about extra spaces or the similar.
I’d use
#predefine correct answer
ans= "`(x,y)→(x-2,y+1)`"
#output correct if stdt input=ans
#<input#> must be changed to component name
correct: <input#>.latex = ans
If you felt fancy (or you’re using this same thing multiple times) you could modularize it with some additional variables:
#predefine correct answer
xans= "`-2`"
yans= "`+1`"
ans= "`(x,y)→(x${xans},y${yans})`"
#output correct if stdt input=ans
#<input#> must be changed to component name
correct: <input#>.latex = ans