add a Javascript once for entire course

Feb 02, 2018

Hi, I have a Javascript code for detecting the expire date. After the expire date, student should not able to read this course. However, I need to add this Javascript code in every slide now.

Is there any way that I can add this Javascript code only once and it will affect all the slides?

4 Replies
Allison Goldthorpe

Hi Rae,

You should be able to have Javascript code execute on the first slide and then store relevant information in variables which can be used across all slides. For instance, your code could evaluate if the current date is after a specified date, then set a "CourseExpired" variable to True. Then on your other slides or on the master, you can set up triggers to do something if that variable is True.

Taking a step back though, where are you hosting the course? If it's in an LMS, you might be able to set a course expiration date there which would be much easier to do and much easier to update down the road if you need to.

Allison

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