Forum Discussion

AbnerNoriega-82's avatar
AbnerNoriega-82
Community Member
3 months ago

How to shown a specific question depending on a variable number?

For reference, in some courses, we have a variable named "ClassNumber" which can be a number from 1 to 9.

If the learner is from Class 1, its going to follow path 1; if class 2, then path 2; and it goes on.

It is unpractical since the content is 80% the same, just varying 2 or 3 slides. So, what I did is to group those slides within layers and now thanks to the variable, it's gonna shown the content depending which class they belong to.

The issue comes with the questions, most of the questions are similar, but some has slight difference in wording or references. So what I want is to shown specific question accordingly to the class they belongs.

We can't have different courses for different classes since the way the LMS team sets the LMS demands us to work this way; also the SME or Content provider is the same for all the classes, it's a lot of work.

Is this possible? 

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    Hi Abner, yes, this is entirely possible.

    You can do the same thing as you have with the layers, except you will use a trigger on the NEXT button that will jump to the specific question slide(s) corresponding to your variable.

    Another way to do this that might be even better is to use dynamic text in your question slides. By changing the question, choice or feedback text dynamically, you can use the same slides for every use Class.

    This will make your course smaller because you don't need duplicated slides, and therefore it's easier to update and change in the future too.

    Does that help at all?

    • AbnerNoriega-82's avatar
      AbnerNoriega-82
      Community Member

      Andrew, that's something I have never heard of and will surely meet the requirements. But, can you shed a light on how to use dynamic text on the question's slides?

      Thank you.

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    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-82's avatar
      AbnerNoriega-82
      Community 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.