Forum Discussion
How to shown a specific question depending on a variable number?
Morning Abner!
I've created a very simple little tech demo for you which outlines the process of using dynamic text. (see attached story file)
Ive made all the question text dynamic - so that is not just the question, but also all the choices, and both the correct and incorrect feedback.
You dont have to do as much as this - you can choose to do as much or as little as you want, even mixing some regular static text elements with dynamic elements.
eg. if you wanted the same question text for all users, but changed the choice text depending on their chosen 'class'
NOTE - Ive used a little Javascript routine here to do this, because it allows me to use something called a nested switch statement. This just makes the code compact and very easy to adjust or expand.
Im not sure if you are familiar with JS in Storyline, but when you are previewing the project, press F12 to open your developer tools, then click on the CONSOLE tab. I have put little messages in there as your javascript fires so that it explains what is going on a little bit.
However, you absolutely dont need to use JS for this, and could do it all using triggers within Storyline.... though depending on how many question slides (and elements within each slide) that you want to make dynamic... the number of triggers could be big!
So my advice would be to go with whatever feels more comfortable with you.
Let me know if I can help further!
- AbnerNoriega-825 months agoCommunity Member
That's the most awesome thing I have seen. Thank you so much for your help.
I'm not familiar with JS but I can understand what is going on by seeing the code, I will make some test with this code.
And I have to add JS to my to-learn list, for sure... wow, thank you again.