I'm trying to unlock part of the program checking the date on the computer. I tried using javascript and was successful unlocking for only that date, but I need to keep it unlock after that date...any ideas?
When your Javascript first unlocks part of the content you could also set a Storyline Variable to true (signifying that the content is now unlocked). Assuming that you set your player behaviour to always resume or prompt to resume, the variable's value can be used on subsequent visits to signify that the content is already unlocked. Hope that makes sense.
Thank you for the response. The issue is that right now is unlocking on that specific date, if somebody tries to open after that date it will not unlock. The code seems to work only for that date.
I used this Javascript for checking the date
var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() var dateString=month + "/" + day + "/" + year var player = GetPlayer(); player.SetVar("SystemDate",dateString);
then I put a condition on a trigger to check for that date, but I need something that will keep it unlock after that date
2 Replies
When your Javascript first unlocks part of the content you could also set a Storyline Variable to true (signifying that the content is now unlocked). Assuming that you set your player behaviour to always resume or prompt to resume, the variable's value can be used on subsequent visits to signify that the content is already unlocked. Hope that makes sense.
This post was removed by the author
HI Michael
Thank you for the response. The issue is that right now is unlocking on that specific date, if somebody tries to open after that date it will not unlock. The code seems to work only for that date.
I used this Javascript for checking the date
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var dateString=month + "/" + day + "/" + year
var player = GetPlayer();
player.SetVar("SystemDate",dateString);
then I put a condition on a trigger to check for that date, but I need something that will keep it unlock after that date
Any ideas?
Thanks
This discussion is closed. You can start a new discussion or contact Articulate Support.