Self Checking Table

I’m trying to create a self checking table, but can’t figure out the CL to have it recognize the third column in latex. It will only work if I change the column to format as text. Any advice would be greatly appreciated!

Instead of trying to match the exact text, you could use simpleFunction and evaluateAt(). I like using Booleans for checking answers.

checkf1= simpleFunction(final1.latex).evaluateAt(3)=0 and simpleFunction(final1.latex).evaluateAt(2)=1

Repeat choosing whatever you want to evaluate x at and the appropriate results. Then,

content:
when not…
when table4.submitted and value2=1 … =144 and checkf1 and checkf2… etc.

checkf1 outputs true or false depending on results, so you don’t need to use an equality or inequality for your conditional.

I’m needing some help with a similar issue. But instead of checking a numerical value, I need it to check a text input (participants are suppose to answer with A, B, C, or D).

I figure there is some way to do simpleFunction, but i’m not sure how it works. Link to the activity is below

I think you need to add the button… that might be a recent update? (I’ve been figuring things out and just realized that maybe that’s why I was struggling with a table “submit” before?)

I fiddled with it and this seems to work! I also added “or” statements to allow lower case. :slight_smile:

1 Like

Text matching as @SqrtOfPi is probably the easiest way, but you could conceivably use simpleFunction which would have the benefit of working even if there were extra spaces. Something like this would be correct with either capital or lowercase ‘a’:

correctA = isDefined(simpleFunction(this.cellContent(1,1),"A","a").evaluateAt(1,1))

Obviously you’d need to change which cell and the letters.

1 Like

Hi,

I understand that Desmos is recommending the use of simpleFunction and evaluateAt() in certain cases.

However I was just looking for a simple text comparison, similar to what Elizabeth was doing above. The code I wrote to do that is not working. If the characters entered into the table by the user match exactly what I am checking for, as in:
matches = (testTable.cellContent(4,3) = “foo”),
should that work? Thanks!

Text comparisons work. Just realize that they need to be exact matches (latex causes lots of problems), so capitalization, unintended spaces, etc. can all yield incorrect evaluations.