Trouble with Tables and Timer

Not sure what is going on with this activity I’m developing. The hope is that students press a button and see the sine curve with the 5 key points that are driven by the time since pressed. Additionally a table fills out showing the x-values in time sync with the graph. This works fine.

Then I want students to input values for a second cycle into a second table. However when any cell in the second table has focus, the graph and the first table reset as if the time since pressed was back to zero.

Tried a few work arounds, but it just ends up being more variables and flags that still don’t really solve the problem.

Any ideas?

Trouble with Tables and Timer

This is a known issue. Table focus resets buttons so that your beautiful animations are rendered unusable.

It’s a significant UX bug imo and one of the longer standing issues that need to be addressed.

Can you add a button that will reveal the second table? Then you could conditionally show the top table based on the timer OR the second button’s pressCount=1.

I don’t fully understand the capture function (sink?) but could you use it to capture the t values as it animates and use those new values for the repeated points that will remain once the button resets and you lose all the t values?

capture only collects values when the button is pressed.

@SteinSchreiber Could you add a playhead instead of using a button to start the animation?

@SteinSchreiber Or make a draggable slider in the graph that acts as in place of timesincePress()!

Like this:

Here’s with a playhead. I still needed a button to control display of the second table.

Thanks so much for the help.

Thanks. I haven’t really used the playhead before interesting.

It’ll pop up as long as you have some kind of animation source/sink referenced or defined. I just used the animationTime to define t the same way you used timeSincePress, but it doesn’t get reset by table focus. It also allows the student to rewind or pause where they want, which could be positive or negative depending on the intentions of your animation.

1 Like