Count number usage

I am trying to adapt a code from a colleague’s activity to a new activity but I can’t get the table to recognize a correct answer. I am pretty sure my error is in using countnumberusage. Can someone guide me on this?

Your > and < are backwards.

Thanks! I fixed that and now it only counts the first one as correct. Still not recognizing all the other ones.

Apparently, simpleFunction is more stable than numericValue, so I tried this and it works:

check2=simpleFunction("\sqrt{512}").evaluateAt(0)=
 simpleFunction("${table1.cellNumericValue(2,2)}").evaluateAt(0) and 
countNumberUsage(a2,16)=1 and countNumberUsage(a2,22)=0 and 
countNumberUsage(a2,7)=0 

Thanks! Will that also work for sqrt(-98)? Or will I need a different type of argument because of the i?

You could do something like:

check2=simpleFunction("\sqrt{98i}","i").evaluateAt(2)=
 simpleFunction("${table1.cellNumericValue(2,2)}","i").evaluateAt(2) and 
countNumberUsage(a2,7)=1 and countNumberUsage(a2,2)=1

So I still don’t know what I am doing wrong. Here is the activity again. I have fixed the first 5 on slide 8 and I will be honest, I am having the same issue on slide 9.

Your evaluations for a3 are not right.
For f(i)=-10+23i,
f(1)=13
f(2)=36

It will also be easier to compare simpleFunction to simpleFunction (which should work for your answers with radicals as well instead of using < and > comparisons). I made a few adjustments (like fa3 is the function for a3, and exp3 the function for the expected answer):

#(4+i)(-1+6i)=-10+23i
a3=table2.cellContent(3,2)
fa3= simpleFunction(a3,"i")
exp3=simpleFunction("-10+23i","i")
check3=fa3.evaluateAt(1)=exp3.evaluateAt(1) and fa3.evaluateAt(2)=exp3.evaluateAt(2) 
     and fa3.evaluateAt(3)=exp3.evaluateAt(3) 
     and countNumberUsage(a3,10)=1 and countNumberUsage(a3,23)=1
answer3 =
  when check3 1
  otherwise 0