Numeric vs Latex Issue

Here is my problem:

I created two variables a and b and want to add, subtract, multiply them and have CL check for correctness. I think have to do this in the graphing calculator. But I want students to have to input using latex (otherwise they will just put in the expression!)

So if I create a variable c in the graphing calculator how do I covert that number to latex so I can check when a student puts it in math type (expression)?

Hope that makes sense!

If you want to check that a specific number is used, you need to use countNumberUsage:

a=2
b=6
sum=numericValue("${a}+${b}")
c=input.latex
check= input.numericValue=sum and countNumberUsage(c,sum)=1
            and countNumberUsage(c)=1
correct: check

“check” is first checking if the student answer evaluates to “sum”, then checks if the actual number “sum” occurs in the answer once. Last, it’s checking there is only one number total being used, which may make the second check redundant, but it’s useful in many other cases like checking for expressions with more than one term.

1 Like

Thank you so much, Daniel!

Fixed a problem and… best of all, learned some new tricks!