JavaScript runs locally but not in LMS

Jul 30, 2020

Hey guys,

I am working as an intern and I worked on several storyline courses of the company I work for. But now I ran into a problem and I hope that the community can help me out.

We use some JavaScript lines in our courses and I thought it would be a good improvement if we use an external JavaScript file (as described here) because we run the same code on a lot of slides. This improves maintainability a lot.

All works fine when publishing it on our machines, however it does not work when we upload it to our LMS. Online, the JavaScript code does not get executed somehow. The file exists on the server, but I don't know if it is not loaded or if it is not run or whatever the problem might be...

Did anyone of you guys run into the same problem? Do you have any idea how to fix this?

(We use Articulate Storyline 3 as development software and our LMS is Global Teach by swissteach)

2 Replies
Dave Cox

Hi Sven,

Although it sounds like a good idea to use external Javascript in a course, I would recommend that you try to keep the Javascript internal when you are using it with Storyline. It make it easier to find, and easier to publish. In fact, in general, I always recommend to users; if there is a way to do what you want without resorting to Javascript, then that is generally your best option. There is a lot you can do with Storyline's triggers, states, and layers. 

With that being said, you can still use external Javascript, but you will have to add it back into your course after you publish it. If you publish a course with Javascript, you will notice that Storyline adds a folder for the Javascript files. You will need to copy your external Javascript into that folder after your publish. Since you are publishing for an LMS, this means you need to add it to the .zip file. 

I'm going to leave to you to experiment, and locate that folder. Good Luck,

Dave

Michael Anderson

If your LMS is running from an "https" website instead of "http", then make sure your external javascript source is also called with "https". See if that fixes the problem.

I do agree with Dave that relying on external javascript may not be the best solution, because if the site hosting the js ever goes down, it will break your course.

This discussion is closed. You can start a new discussion or contact Articulate Support.