I have a self checking table for exponents of 2, 3 and 4. I’m having issues with exponents of 3 because of the repeating decimals. I’ve tried the following code for 1/3 but I’m getting an x when I type 1/3 in the table. What am I doing wrong?
cellContent(6,3): whentable2.cellNumericValue(6,2)<0.334 AND table1.cellNumericValue(6,2)>0.333 “” otherwise “”
correct:
table2.cellNumericValue(6,2)<0.334 AND table1.cellNumericValue(6,2)>0.333
It’s screen 6 for anyone who wants access to the activity
Everything that you want checked in the table on screen 6 should start with table2. Most of your code shows that, but the other parts say table1.
cellContent(6,3): when table2.cellNumericValue(6,2)<0.334 AND table2.cellNumericValue(6,2)>0.333 “✅" otherwise “❌”
correct:
table2.cellNumericValue(6,2)<0.334 AND table2.cellNumericValue(6,2)>0.333
A common practice for this issue is to define a variable to be a component, then you only have to change the component name in one place (usually near the top of your CL):
t= table2
cellContent(6,3): when t.cellNumericValue(6,2)<0.334 AND t.cellNumericValue(6,2)>0.333 “✅" otherwise “❌”
correct:
t.cellNumericValue(6,2)<0.334 AND t.cellNumericValue(6,2)>0.333