TABLE COMPONENT: how to limit the number of times the student enters a cell

I am creating a 5 x 3 table
Column 1 has a fraction
Column 2 is where the student will type the decimal equivalent
Column 3 is the correctness check.

What I’d like to do is limit the number of times a student can edit the cell in column 2, so they don’t just type in numbers a bunch of times until the correctness column shows true.

I know in the math input component you can hide the submit button after a defined number of tries.

Can I do this for a CELL in a table? If so, how? I’ve tried several things but the syntax of CL hurts my head…

(I’m aware that the whole table can be hidden, but I don’t want that)

Here’s how I would approach it. If you use your own action button, you can capture corrections. I’ll use 1 as correct 0 as incorrect, as capturing only accepts numeric values. You’ll need one capture per student cell entry. Use lastValue for your correctness check in column 3. Then, same as math input, disable or hide your action button after your defined number of times.
In the button CL:

table= yourTableNameHere
disabled: this.submitCount>3
capture(`ans1`): when (your regular correction check here) 1 otherwise 0

In your table CL:

button= yourButtonNameHere
cellContent(1,3): when button.submitCount=0 "" #I like blank cells before checking
                  when button.lastValue(`ans1`)=1 "✅" 
                  otherwise "❌"

You can also just capture the values entered in the cells and do corrections in the table CL, if you want to use the actual values entered for anything else.

3 Likes