Javascript rookie - need clearer, more specific instructions for the non javascript fluent

Hi - I’m trying to set up the chat widget. When I add a response, and it asks me what variable and javascript to execute, I’m not sure what to input here.
1. Am i supposed create new variables for every possible response? (and then also instantiate within storyline also?)

2. The action...what javascript am i supposed to put here? It’s not clear to me - am i telling it what to do when a certain response is given? Am i supposed to know what variable the agent responses are, in case i want to have the agent say something, or is that all handled with each agent response inquiry? I’m confused as to what to do here.

3. Where do i put the trigger for the bulk of this chat script...in the master slide? or in the first slide? Do I also add a second trigger to display the chat on that same slide too? It would be extremely helpful if you provided a quick start for the less javascript versed among us.

Thank you!
p.s. I found the elearning tutorials section very helpful as I could download and see for myself how something was done. Unfortunately there’s no tutorial for this widget. 🙁

August 10, 2020, 10:41 pm

Click for thumbs down.0Click for thumbs up.0#1

Hi Kathy.

1. I'm not sure what you mean by "supposed." If you want to have a new variable with each response, you can create them. If you don't need new variables for each response then don't add them.

2. The code you want to run when the answer is selected. If you don't want to run any code then don't put anything.

3. It doesn't matter, either one will work. You don't need an additional display trigger.

August 11, 2020, 8:03 am

Click for thumbs down.0Click for thumbs up.0#2