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?
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.
Rae, keep in mind that if you are using javascript to read the computer date of the person viewing the course, that can be circumvented if the user changes the date on their computer. It is unlikely that many people would go through this trouble, but I just wanted you to be aware of that.
4 Replies
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
Or, if it really needs to be on every slide, use the slide masters.
This post was removed by the author
Thanks for Allison & Owen's help. I will try the slide masters. Thanks again! =)
Rae, keep in mind that if you are using javascript to read the computer date of the person viewing the course, that can be circumvented if the user changes the date on their computer. It is unlikely that many people would go through this trouble, but I just wanted you to be aware of that.
This discussion is closed. You can start a new discussion or contact Articulate Support.