Possible bug? Variables copied to 2nd screen briefly appear, then disappear

Dear Desmos CL folks,
I’ve run into a weird problem when trying to copy variables from one activity screen to another via CL. The variables successfully copy, very briefly show up on the second screen, then immediately disappear! This second screen literally doesn’t do anything other than try to plot those variables.

Here’s the activity. (Note: folks at Desmos might recognise that there is a certain context in which I am posting this. I hope, and believe, that it is legit to be posting to the CL forum in this context, because it really does seem like a possible bug, or at least something quite weird).

And here is a screen-recording of the briefly appearing then disappearing graph. You’ll see a diagonal line, plotting the copied variables, very briefly flash up towards the end of the 9s movie:

Any help in figuring out what is going on greatly appreciated!

Raj

I appreciate that the example I posted is not very minimal. My apologies for that. I figure, though, that it might be useful to add the following: if you hit “Stop” on the car before it reaches the end, then the graph up till that point does get successfully copied on to the next slide.

However, that doesn’t happen when the car makes itself stop by a conditional detecting that it has reached the end of its journey. In both cases, whether manually hitting “Stop” or the end being detected, the outcome is a variable called Go getting changed from 1 to 0. So, I am very puzzled why one path does succeed in copying the graph without it disappearing, whereas the other does not!

Upon further investigation, it appears that any click action is both necessary and sufficient to “flush” the state of the graph such that it will get enduringly saved and displayed on the subsequent screen.

If I put in a dummy “Save” click target that doesn’t actually do anything, but I instruct the user to click that Save button before progressing onto the next screen, that turns out to be enough to make the time and distance records show up on screen2 without immediately disappearing again.

However, if the car comes to the end of its journey and then the user goes to the next screen without clicking on any subsequent in-graph button, then the variables read-in by screen2 appear but then immediately disappear again.

I think this actually is a small bug in the CL. It only seems to show up in the rather specific circumstance of continuously updating records being read into a subsequent screen without any in-graph click happening first. Somehow that in-graph click is needed to flush or consolidate the variables into an enduring store that can be read out by a later screen.

TL;DR: add
saveOnChange: "${this.number(`t_{ime}`)}"
or
saveOnChange: "${this.number(`G_o`)}"
to the CL of car_graph1.

It doesn’t appear to be a bug. The ticker resets itself and only gives that last “known” graph state when you navigate to a different slide. My thinking is that Desmos only saves the calculator state for an animation when there is a direct change from an external input (say, by a human moving a point, clicking something, etc). It doesn’t save the state if a variable is changed only because a condition was met – I assume because it’s usually better to have the animation restart if a student navigates back to the slide – unless you tell it to.

saveOnChange in the CL layer tells Desmos to save the calculator state whenever a particlar string changes [which means you need to turn numerical variables into strings, and I’m sure there’s a good reason for that].

If you go with the time variable, you can click start and go to the next slide before the car reaches the end without pressing stop and the graph will show up to the last point it got to. The animation pauses and will pick up where it left off when you go back. Saving when Go changes means that they will see the correct graph once the car has reached the end (and Go changes back to 0), but not if they try to move on mid-animation without pressing stop.

The Desmos documentation has a slide that demonstrates two animations with & without saveOnChange

Unrelated: while I was playing around with this, I noticed that if you press Start without Resetting after the animation is finished, it keeps adding time & distance to those lists, even though the car image won’t move.

I wanted to expand on the state thing a bit more; select this to read on.

You can see this state-saving at work in the car activity: Press start, then go to the next screen without pressing stop. The graph is blank because the last known state of the graph was Go = 1, car position = (x0, y0) (where t and d are still empty lists). Go back to the first screen and it essentially picks up where it thinks you left off: Go = 1, initial position. Press Stop [e.g, when the car is at (3,4)], then Start again and let it finish. Now when you go to the next slide, you’ll see the graph up to where you clicked Stop because the last known calculator state was Go = 1, car position = (3,4). When you go back to the car slide, it will restart the animation at the last stopping place.

So it’s not the fact that you need a click, what you need for Desmos to save the current calc state when you go to the next slide is some kind of external change to the graph – even if it’s just adding a blank line. I made car_graph1 a full-screen calculator, then looked at the student preview. Start the car finishes, Desmos says “new graph state; save it!” and you see the full graph.

Not saving the calculator state automatically when the ticker is going is different from what we see without a ticker, and I can’t (now) find anything that explicitly talks about tickers and activities – I feel like I saw something that was more explicit than what’s on the timers slide, but I can’t find it again. I wish there was more documentation available about the nuts and bolts of Desmos. There’s no information about when you would need to specifically save the calculator state. /rant

Thanks so much for your extremely informative and helpful reply! Much appreciated!!

I also absolutely agree with you that it would be useful for the Desmos folks to add a bit more to the documentation on this, e.g. on a new big-picture-overview page about tickers and states. I also found that the documentation on reading out info from the sketch tool was a little sparse. That said, they are a small number of very busy people who have already made something wonderful. Fleshing out this documentation might get tacked on to their doubtless already very long to-do lists! :smiley:

Raj

1 Like