How to use Location widget

Hi there, I am using Storyline 360. I tried using this widget, but not 100% working. I have pictures of different countries set as hidden, and I sent the link to people in different countries to check.

Here are the triggers:

1 - Execute Javascript when timeline starts (Javascript has been pasted in)
2 - Set Country variable to equal UAE when timeline starts if country is equal to, ignore case, United Arab Emirates
3 - Change stage of UAE pic to normal when timeline starts if Country variable is equal to UAE
4 - Set Country variable to equal Australia when timeline starts if country is equal to, ignore case, Australia
5 - Change stage of Australia pic to normal when timeline starts if Country variable is equal to Australia
6 - Set Country variable to equal India when timeline starts if country is equal to, ignore case, India
7 - Change stage of India pic to normal when timeline starts if Country variable is equal to India

I am based in the UAE, and it works for me. However when I send it to people in Australia or India, they too also see the UAE pic. I also tested if it was because the first country being set was UAE so I changed #2 and #3 to be the Australia triggers, however still showing the UAE pic.

I then tried changing #4 from 'Australia' to AU, and #6 from 'India' to IN. Still the same.

Could this be because I am publishing it in the UAE so therefore that location information is held in the course? Perhaps there are some settings I need to update in Storyline somewhere?

I don't understand Javascript so I just copy and pasted the widget link, no idea what is all means though ...

August 20, 2019, 7:33 am

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

Mikey, if you can upload the slide with your triggers using a service such as WeTransfer and post the link in a response below, we will take a look and tell you exactly how to fix your code. If this is not possible, you can try re-examining the logic behind your triggers/actions. E.g. does the widget finish loading before you check the country value (has the stencilrendered variable updated)? And no, the location where the module is published does not have any effect, there's something wrong in the triggers (Storyline) or actions (Captivate) you are using.

August 20, 2019, 8:45 am

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

Hi team!

Hopefully this link works: https://wetransfer.com/downloads/afe53e552f60a81865a1f1f5f502cb1d20190821044726/e1a770704d9b3d5d7825e2057cf4812520190821044726/942c60

I understand the purpose of the stencilrendered variable, to check if the Javascript has actioned, but not sure what trigger I need to use so I haven't included it.

August 21, 2019, 12:53 am

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

Here's the updated file: https://we.tl/t-XtBghEeBul

There are two ways to make it work:

OPTION 1:

Use the file posted. You'll notice that instead of "when timeline starts" all triggers were changed to "when stencilrendered changes." This is to ensure that the location loads before the value is checked by the triggers. This variable is explained in the "How to use..." instructions after you save the widget:

5. (optional step) If you need to track from within the learning course whether the script has finished executing, create a variable stencilrendered and set its value to 0. After the script execution, the value will increase by 1.

OPTION 2:

Move the widget's JavaScript code to an earlier slide in the training. The learner's country is not going to change in the time they move from slide 1 to slide 2, but you will ensure that the location is loaded by the time they reach this slide.

August 21, 2019, 8:07 am

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

Also a heads up about a problematic trigger that you have in your code: "Set Country to UAE if country equals to United Arab Emirates." The Country variable will never be equal to "United Arab Emirates," the ISO code for United Arab Emirates is "AE."

August 21, 2019, 8:44 am

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