Action Button - resetOnChange for a table

I’ve been researching how to write a reset for the Action button for when a student changes their answer in a table. I have it set up so once a student enters their response and hits the “Check your answer” button they get “Correct” or “Try again”. If a student is incorrect and they get the “Try again”, I would like the button to reset to “Check your answer” when they make a change to the table. Everything I have read is for graphing so I don’t know how to translate it to a table.

Here’s my Action button coding:
a = t1.cellNumericValue(1,2)
b = t1.cellNumericValue(1,3)
count = button1.pressCount

capture(“a”): a
capture(“b”): b

disabled: button1.pressCount>0 and button1.lastValue(“a”)=numericValue(“1/3”) and button1.lastValue(“b”)=numericValue(“0.333”)

label: when (button1.pressCount=0) “Check your answers”
when not(button1.lastValue(“a”)=numericValue(“1/3”) and button1.lastValue(“b”)=numericValue(“0.333”)) and (count = 1) “\n\n\Incorrect! Try again!”
when not(button1.lastValue(“a”)=numericValue(“1/3”) and button1.lastValue(“b”)=numericValue(“0.333”)) and (count = 2) “\n\n\Still incorrect! Try again!”
when not(button1.lastValue(“a”)=numericValue(“1/3”) and button1.lastValue(“b”)=numericValue(“0.333”)) and (count > 2) “\n\n\Try looking for a pattern in the fractions or check your 3 sf and then try again!”
when (button1.pressCount>0 and button1.lastValue(“a”)=numericValue(“1/3”) and button1.lastValue(“b”)=numericValue(“0.333”)) “\n\n\Correct!\n\nContinue to the next screen.”
otherwise “Check your answers”

Thank you!

The resetOnChange basically turns a button from “pressed” to “not pressed,” which also resets the timeSincePressed. I’m going off of memory here, but I’m pretty sure you can just add resetLabel: "Edit my response" in the CL and then any changes to the table will reset the timer.

I use resetOnChange for moving points on a graph. For example, if you submit a graph as an answer and receive feedback, I might not want the feedback to remain in the note if a point is moved.