Replies: 2 comments
-
|
Thanks for reporting ... the idea is that a script can subscribe to outputs of another script, and whenever the output changes, then the subscriber is reevaluated ... <script
input="range"
default="0"
value="0"
output="topic"
modify="false"
input-always-active>
@input
</script>
<script>
Math.sqrt(@input(`topic`))
</script>I added a similar button input for your example, however, the result is only reevaluated if the input topic or in other words the result from the previous script is a new one ... that is why I added a counter to your example ... as an alternative, you can also do something like this: <script input="submit" default="neu" output="neu">
send.lia(Math.random())
"neu"
</script>This will change the value twice, once with a random value, and then always show "neu" as the button-text. However, this might result in a little glitch, since your quiz will be generated two times. Thanks for mentioning that Kind regards ... |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the fast response and solution. Adding another variable into the output of the button seems to do the trick. I tried to use the current title as input and switch between "Reload" and "Neu" but that resulted in a continuous switching as a change in the output triggered the script again. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I combined an eChart together with a multiple choice question. The graph is representing a function and the user has to click on the correct equation from a multiple choice test.
You get a new question by reloading the page but I would prefer a new graph and corresponding question by clicking a button. Is there any best approach to update more than one script with a click of a button?
You can have a look at the current state
More Details if necessary:
Any help appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions