• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Resetting variables when learner switches to another browser

New Here ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

At my organization, most of our staff still use Internet Explorer. However, IE does not always handle HTML5 very well, so we want to force them to open our e-learning modules in Chrome.

So I wrote a bit of JavaScript that detects whether or not the learner is using Chrome. The JS then assigns a value of 1 to a user variable (chromecheck) if the browser is Chrome. Then I have a conditional advanced action that says: if chromecheck = 1, continue on, else display a message that tells the user to close their browser and relaunch the lesson in Chrome.

This works just fine if the user initially launched in Chrome. The lesson proceeds as normal. And if they open in Internet Explorer, they receive the message that they need to switch to Chrome.

But when they reopen in Chrome, they are told they aren't in Chrome and need to switch to Chrome. I assume this is because the LMS has retained the value of the chromecheck variable, and that variable is telling Captivate that they user is in a non-Chrome browser, even though they have switched to Chrome.

I realize that there is an option in Preferences > Quiz > Reporting > Advanced to instruct CP to never send resume data. That would solve the problem.

HOWEVER, we don't want to check that option. If the user has to quit a module for some reason, we want them to be able to pick up where they left off. So checking the "Never Send Resume Data" option is not an option.

How, then, can I reset the chromecheck variable if the user launches the module again in Chrome after first opening it in IE?

Any help is very much appreciated!

Views

168

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

Going out on a limb here...

What if you had the chromecheck run again so that when the user opens where they left off with the "Go and use Chrome" message - it will check, trip the flag, and move on?

What if you had a little JavaScript run onEnter with it?
What about putting a little button on the pop up message that says "I'm on Chrome" - The user clicks that and your script to verify runs again and continues if true.

Just some thoughts - hope they help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

LATEST

I appreciate the feedback! After I slept on it, I woke up with the answer. Your first suggestion is the correct one.

(1) On entering the first slide, run javascript to see if the browser is Chrome. If it is, assign chromecheck = 1, else chromecheck = 2. Then go to next slide.

(2) On entering the second slide, look at the value of chromecheck.

If chromecheck = 0, go to previous slide (in other words, go back and re-check if the browser is Chrome)

If chromecheck = 1, go to next slide and start the module

If chromecheck = 2, give the learner the message to switch to Chrome and reset chromecheck to 0

That way, if the browser is not Chrome, the chromecheck variable will be reinitialized. It will be 0. So when the user re-launches the module in Chrome, even though they will automatically start out on slide 2, the advanced action will see that the value of chromecheck has been reset to 0, which send the user back to the first slide where the browser will be checked again. If it's Chrome, they're good to go.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources