Hi , Iβm trying to cheack that students input to a probabilty question is correct: Thia is the code I have
t=table1
cellContent(1,3): when t.cellNumericValue(1,2)= \frac{1}{6} ββ OTHERWISE βNβ
You want cellContent not cellNumericValue.
If within the same component in this case table1 you can use βthisβ instead of βtable1β
cellContent(1,3): when this.cellContent(1,2)= \frac{1}{6}
ββ otherwise βNβ
1 Like
Also this would work and reduces the number of table columns.
cellSuffix(1,2): when this.cellContent(1,2)= \frac{1}{6}
ββ otherwise βNβ
1 Like
How can I get my table to mark correct for fraction answers? On slide 16β¦ I have tried numeric value and cellContent. Neither work.
Thank You
use latex=\frac{2}{3}
1 Like
You need backticks round \frac{2}{3}
1 Like
There are numerous ways to check fractions (for simplicity examples are for an input)
- Latex matching:
check= this.latex=`/frac{2}{3}`
Short and sweet, but can be inaccurate. Copy paste from Desmos calculator for intended latex. - Inequalities:
a.check= this.numericValue<=0.67 and this.numericValue>0.6
b.check= numericValue(`\abs(\frac{2}{3}-${this.numericValue})`)<0.01
- simpleFunction (a little more accurate than numericValue):
check= simpleFunction(`\frac{2}{3}).evaluateAt(0)=simpleFunction(this.latex).evaluateAt(0)
- Pattern matching:
p=patterns
check= p.fraction(p.integer.satisfies(`x=2`), p.integer.satisfies(`x=3`)).matches(this.latex)