I’m trying to randomly generate numbers for students to find the distance between points using the Pythagorean Theorem. Every variable will check correctly until I get to the final stage of taking the square root of g. Do you see a problem with my code?
content:"Find the distance from ({x_1},{y_1}) to ({x_2},{y_2}).
${result}"
result =
when input19.submitted and input19.latex=("\sqrt${g}") “\n\n\Correct:raised_hands:”
when input19.submitted “\n\n\Incorrect. Try again.”
otherwise “”
Latex matching isn’t the best and it’s hard to tell what you’re actual code is (since the forum reformats some things). If you use triple backticks for the first and last lines of your code in the forum it will show your intended code.
However, I’d guess the problem is in the sqrt g, which should be something like:
...input19.latex=`\sqrt{${g}}`...
Also, not sure if you’re using c, d, e, and f to assess anything, but you could define g in one shot: