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…?
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 ??
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
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.