The command [b]UpdateConstruction()[/b] recalculates all random defined objects in the applet, creating a new exercise. You can put this command as a script in a button. [br]Select the Button Tool in the Toolbar and create a button with as caption [i]new exercise[/i] and GeoGebra Script [i]UpdateConstruction()[/i].
This first applet shows two random defined numbers in a [b]dynamic text[/b] and a [b]button[/b] with a script to recalculate the numbers. See how it works and follow the steps to create it yourself.
[table][tr][td]1[/td][td][/td][td]Type following two commands in the inputbar and define the numbers a and b: [br][b]a = RandomBetween(1,10)[/b] [br][b]b = RandomBetween(1,10)[/b][/td][/tr][tr][td]2[/td][td][icon]/images/ggb/toolbar/mode_text.png[/icon][/td][td]Select the Text Tool and type the text [b]a + b[/b], while selecting[br]a and b in the list of objects, making the text dynamic.[/td][/tr][tr][td]3[/td][td][icon]/images/ggb/toolbar/mode_buttonaction.png[/icon][/td][td]Select the Button Tool.[br]Type [b]new exercise[/b] as caption and [b]UpdateConstruction()[/b] as script.[/td][/tr][/table]