Glitchy Button & Table with 'hidden" cl sink

Something’s not working the way it seems like it should.

When I … click in the table, it resets the previous button (and hides this component)

I saw … the table disappear when I clicked in the cell and the previous button reset.

But I expected … the table to stay put. (I used the following cl code
hidden: when button.timeSincePress()>0 false otherwise true

Here’s the link to the page, dashboard, or activity:

My goal in this is for kids to:

  1. Show work and click the first button, which will reveal the table to enter their answers.
  2. Students then enter their answers int he table and press the 2nd button to reveal the feedback notes.

Thanks for your help!

Table focus resets timeSincePress, can you use pressCount instead?

I’ve tried pressCount, but it also resets the previous components when you click in the cell.
As a work around, I figured out to make the previous button component hidden when pressed and the work is “complete” (as that is the purpose of the first button).

To make this work, I did change the table to pressCount also. That worked for this purpose. Thanks for the insight on Table focus resetting it. That’s just weird that it would make previous components reset…?

1 Like

Pretty much the same issue here. When students roll the die and then enter the table (cell has focus), the die changes. I suspect this is because timeSincePress is resetting-- like Munmath described. I don’t see a work around at the moment other than building the die to not use animation. Seems like there should be an option to disable the resetting of components-- resetOnFocus: false ??

Other ideas??

Use a capture initially, that displays at the end of your animation and at time=0.

I am a total failure at using capture! (Or the related functions.) I just have not got my head wrapped around those yet. TY-- you are amazing with your help! Will try :slight_smile:

capture creates a list of numbers where a new element is added each time the button is pressed. lastValue grabs the last element. history is the full list, which you can use for a numberList in a graph for calculations or whatever purpose.

I haven’t looked at your activity, so I don’t know how your dice roll is getting chosen. I would have a randomly chosen number seeded by the pressCount. So, I would have the button capture that value. lastValue will be the value of the number before the new one created at the time of the button press.

I’m using one of the slides from Desmos’ random generators. As far as I can tell random is being seeded by the pressCount. An animation for spinning the dice is being controlled by timeSincePress-- which I believe is getting reset to 0 when enter a cell in the table. I can’t figure out why that is causing the change of the die number. I’m not seeing how capture is going fix this, yet.

capture doesn’t get affected by anything but the button press, whereas timeSincePress resets with table focus. So if the displayed die number is set to lastValue, it will stay even when there is table focus.