# Help needed for using conditionals for correctness

I am essentially brand new to Desmos activity building and coding in general for that matter.

I managed to get the correctness check working for simple expressions like 3+4.
correct = this.numericValue = 7
correct: correct

What I need to do is a check for tan 60. The exact answer is root 3. However, I also want to include values near this like 1.73, 1.732. Essentially anything within 0.04 of the exact value.

On Computation Layer Documentation it suggests using an inequality:
" Use Conditionals

For more advanced correctness in the calculator, you can use conditionals. Build in a little tolerance for extra safety (e.g.,C={|a-7.4| ≤ 0.1: 1, 0})."

I don’t know how to make this work. I don’t know how to create a variable, or use their answer in an expression. I don’t know what the 1, 0 would mean at the end.
What would I want to type exactly to check their answer for tan 60?

Sorry for being such a newbie to this. Thank you for any help you can give.

The format here is “when |a-7.4|<=0.1, then C=1 otherwise C=0”. This would be done in a hidden graph where the value of a is set in the graph’s CL to the student input:

number(a): inputNameHere.numericValue


You could then reference the value of C in input’s CL:

correct: graphNameHere.number(C)=1


You can use numericValue or simpleFunction in the input CL without the graph though:

correct= numericValue(\abs( ${this.numericValue}-\sqrt(3) ))<=0.04 correct: correct  Thank you so much for helping. Unfortunately, I still can’t seem to figure this out. It is supposed to be working on slide 16 of this activity. Here’s a modification for lengths6 that should work. correct = numericValue(\left|${this.numericValue}-\sqrt{3}\right|) < 0.04
correct: correct

feedback =
when correct "That's correct!"
otherwise "Not correct yet."


That’s working perfectly. Thanks so much!