I think this is more of a question about how the variables update and communicate than it is about a specific piece of code, but what I’m trying to do is have students type an expression that matches a graph and then have that expression be graphed in the graph window. That part works fine.
The concern is that it graphs in real time, so every new character updates the graph. I’d like it to wait until the students are ready to check before actually graphing their expression. Here is what I tried:
I tried using the timeSincePress function with some conditionals to only update the function when timeSincePressed resets to zero:
fn1 =
when try1.timeSincePress = simpleFunction(eqn1.latex)
otherwise = simpleFunction("")
But this doesn’t work because, although I think it probably is updating when timeSincePress = 0, it instantly re-updates back to the default.
I’ve tried some other variations (adding more conditionals, changing the syntax or where the function assignment goes, etc) but haven’t found anything that works.
Basically, I want to store the contents of a student generated expression when they click try it and have that value persist until they click try it again. Is there a way to store a value like that? Everything seems to update so dynamically. Thanks for any help.