Marking Correct When there are Multiple Correct Table Answers

I’m trying to create an activity that uses the triangle inequality theorem. This states that the sum of any two sides must be larger than the third side. The question is meant to be open-ended so that there could be infinitely many correct answers.

I have been messing around with the computation layer on this and can’t figure out how to get it to mark correctness.

Here’s what I’ve got:

a = table1.cellNumericValue(1,2)
b = table1.cellNumericValue(2,2)
c = table1.cellNumericValue(3,2)

check1 = (${a}+${b}>${c})
check2 = (${b}+${c}>${a})
check3 = (${a}+${c}>${b})

correct = check1 and check2 and check3

correct: correct

activity link

You’re close. If you want to make a calculation, you need to use simpleFunction or numericValue. If you’re referencing a number without needing any calculation you don’t need the ${ }…

#using numericValue
check1 = numericValue(`${a}+${b}`) > c

#alternately using a simpleFunction
add = simpleFunction(`x+y`,`x`,`y`)
check2 = add.evaluateAt(b,c) > a
check3 = add.evaluateAt(a,c) > b

Thanks so much! This worked great!