Date limit or password protect course


I'm looking into ways of protecting our courses from being illegally redistributed or accessed after a certain date. The two ways I have thought of so far are either to use the built-in JavaScript functionality to get a password from a server and having the user enter the same password to proceed beyond the first slide, or to disable any access beyond the first slide after a set date.

Is something like this feasible either through current features, or JavaScript inside Storyline 2? I'd love to hear your thoughts!

24 Replies
Matthew Bibby

Hi Marcus,

If you want a secure and reliable way of managing user access I'd recommend using an LMS. That being said, here is an example of how you could use JavaScript to check if an expiry date has passed:

var player = GetPlayer(); 
var currentDate = new Date();
var expiryDate = new Date("January 25, 2016 13:00:00");
if(expiryDate < currentDate){
var expiry = "True";
} else {
expiry = "False";
player.SetVar("courseExpired", expiry);

For this to work you'll need to setup a True/False variable in Storyline called courseExpired and make if False by default. 

You'll also want to change the expiryDate in the code above, for example, if you want your course to expire at 5pm on the fifth of May 2017 you would change the third line to:

var expiryDate = new Date("May 5, 2017 17:00:00");

When the expiry date has passed the courseExpired variable in Storyline will change from False to True. See source file attached.

Christie Pollick

Hi, Markus -- I see that Matthew has provided you with one potential solution involving JavaScript, so I just wanted to note if you should decide to go that route, unfortunately we are not able to provide support for JavaScript coding. In case you wanted to take a look, here is a document on recommended JavaScript Best Practices

John McGrath

Hi Leslie

Thanks for your reply. I would like to achieve this within the Articulate suite rather than a LMS.

I believe the feature is in Adobe Captivate but am trying to find a way of doing this in Articulate.

Surely this is a simple task for your Devopps team and there are plenty of users who will test it for them.  Thank you. 

James Bright


I am trying to publish to an LMS with a date expiry option. I have a client who would like to test one of my courses, but I don't want them to have more than a day or two to try it. I see the information above about JavaScript, but was wondering if there was an easier way to set up the expire date when publishing to LMS.




Philippe JEANTY

Hi Matthew

I look at your ExpiryDate.story above. Neat.. but then how to incorporate this ? I suspect this is the first slide.

You would add a trigger like

Show layer "expired" when "courseExpired" changes, if "courseExpired" is equal to True

and have a layer on that slide that says "Expired, please obtain a new version" and a a trigger on the layer that says:

Exit course when the timeline reaches xx second


and in case the "courseExpired" is false a trigger on the base layer that says:

Jump to Next slide when "courseExpired" changes, if "courseExpired" is equal to False

Is that about correct ?

Brian Dennis

Place Matthew's javascript code inside an Execute Javscript trigger on the very first slide of your project, as the topmost trigger that starts on timeline start. Once created, you should be fine to follow Matthew's directions regarding the project variable. A note to all - this technique relies on scripting support, which does not exist on all platforms and devices. See Articulate's official KnowledgeBase regarding the availability of javascript

Matthew Bibby

Thanks for sharing that James.

Looks like I made a mistake in my code (again).

If using a T/F variable, this code should do the trick:

var player = GetPlayer(); 
var currentDate = new Date();
var expiryDate = new Date("January 25, 2016 13:00:00");
if(expiryDate < currentDate){
var expiry = true;
} else {
expiry = false;
player.SetVar("courseExpired", expiry);
Massimo Scali

I'm sorry to say that this is not a good solution if your goal is to provide the SCORM to the customer and make the course expire after a given time. The problem is that the JavaScript code you write in the Storyline project is perfectly readable and editable by the customers and thus they can change the expiration date whenever they want and extend the lifetime of the course. In other words, this solution is not reliable for you as a content provider.

The only reliable solution would be a core feature in Storyline but it seems they don't care about this because after 6 years (!) they haven't still provided it.