Forum Discussion
PinarBicer-97dd
2 years agoCommunity Member
How to export sum of clicks on Radio Button to textbox
The optical reader I created has radio buttons. I need to pass the number of checked radio buttons to the textbox. Can you help me?
- JudyNolletSuper Hero
- Create a number variable with a default value of 0. For example, call it "Total."
- Insert a numeric data-entry field to hold the final value of total.
- When you insert a numeric field, Storyline automatically assigns it a text variable called "NumericEntry" (or "NumericEntry1," "NumericEntry2," etc. when you have more than one).
- I recommend renaming that variable. For example, call it "showTotal."
- To prevent users from typing in this field, put a transparent shape over it.
- Insert a button for the user to click when they are done selecting radio buttons. For example, call it "Submit."
- Add a trigger to the "Submit" button that sets the "Total" variable to "0."
- This is needed to ensure that the counting always starts at 0 when the user clicks "Submit."
- Add triggers to the "Submit" button, one trigger for each radio button.
- Each trigger should add 1 to the value of the "Total" variable with the condition that the associated radio button is in the Selected state. Those triggers would look something like this:
- Add a trigger to the "Submit button that adjusts the numeric "showTotal" variable to the value of the "Total" variable. That would look something like this:
FYI: Instead of using the extra "Total" variable, the "Submit" triggers could add directly to the "showTotal" variable associated with the numeric data-entry field. In that case, the user might see the numbers flash as the triggers execute.
The value of a variable is available from any slide. So you could insert the total number of clicks/selected buttons on another slide if needed.
For more info on conditions, data-entry fields, and variables, see these articles in the User Guide:
- https://community.articulate.com/series/articulate-storyline-360/articles/storyline-360-working-with-triggers#conditions
- https://community.articulate.com/series/articulate-storyline-360/articles/articulate-storyline-360-user-guide-how-to-work-with-data-entry-fields
- https://community.articulate.com/series/articulate-storyline-360/articles/articulate-storyline-360-user-guide-how-to-work-with-variables
- PinarBicer-97ddCommunity Member