How to check equation input of students

Hello Everyone, I want to learn how to check equation input in desmos activities. The answer of the question will be 3x+4=21 for example. When the student writes this answer, she will get immediate feedback by smile emoji
Thank you
Pınar

Hi Pinar! Here is an example of one way to check equation inputs:

Instead of checking for the exact equation 3x+4=21, it looks for any equation with x=17/3 as a solution. This way, students can enter something slightly different like 21=4+3x without being marked incorrect. I hope that helps!

Your intended purpose is a little important here. Is it for representing a word problem? In which case, using the particular values are important, but you might want to allow for commutative answers. You can add something like:

...and countNumberUsage(this.latex,3)=1 and countNumberUsage(this.latex,4) 
         and countNumberUsage(this.latex,21)=1 and countNumberUsage(this.latex)=3

This will check that those particular numbers (not digits) are being used once each in the answer, and there are only 3 numbers total used. Alternatively, look into some pattern matching, which can get complex.

Thank you for your help. I wrote all the possible answers including commutatives. I really meant any equation with x=17/3. Thank you again

I wrote all the possible answers including commutatives, I realized that there must be a way other than this because ther can be alternative answers from students that I did not include as a correct answer. Thank you for the help, I appreciate.

I’m glad that helped!

In the interest of thoroughness, I’ll also add that for some equations, I think you could run into rounding errors introduced by the calculator (someone who knows more about this than I do, chime in!). If that happens, you might need to check that the function rounds to 0, rather than being exactly 0:

numericValue(`\round( ${parseEquation(input.latex).differenceFunction("x").evaluateAt(numericValue(`17/3`))},3)`)=0

Thank you for your help. It didn’t happen but just in case

Looks like you have something that works. This is what I use to check linear equations which will allow them to write the equation in many different ways.

Thank you a lot for different solution ways :slightly_smiling_face:

Thanks for this entire thread and especially to ian for the clarifying point.
I was setting up this sort of self-checking activity and was baffled that Desmos would mark an input like “x=sqrt{75}” as correct but would mark “x^2=75” as incorrect. I take it that’s a calculator rounding issue. Any suggestions for a resource for more info on this sort of issue and cases I should be aware of?

Good catch! When I used CL to pull the numeric value of sqrt(75) and square it, I ended up with:

Other folks on this forum introduced me to rounding as a best practice for checking answers, and unfortunately I haven’t seen other resources outside of forum posts. In general, I would err on the side of using rounding rather than exact equality checks, but you can safely leave a tiny margin of error, like 10^(-10). You can also experiment and type something like ${numericValue("\sqrt{75}^2")} inside the content for a note and see if a rounding error arises.

it also works, thanks a lot for your valuable help