countNumberUsage with negatives

How can you use countNumberUsage to count instances of a negative number being used? I tried this:

countNumberUsage(CurrentTable.cellContent(1,2), -1)

but it didn’t seem to work

It only takes positives. So, as long as your using a combination of countNumberUsage and evaluateAt you should be fine.

I want my students to expand (-2)^3 as (-2)(-2)(-2), and I want to be sure they are not simply writing -2 x 2 x 2.

From what you are saying, though, there is no way to determine which way they are writing it?

Not in this case, and there’s too much variation to match latex. No way to autocheck it, but you can always go through the dashboard to see their actual work.

1 Like