Forum Discussion
Setting an expiry date for published content
Hi there.
As the title says, I was wondering if there was any way to set an expiry date for published content, which would basically stop users from being able to view the content after a specific date? I've used this feature in KnowledgePresenter before but can't find such a thing anywhere in Storyline.
It would be very handy, as we are basically looking to put our course on disc to send out to people to trial them, but we don't want them having access to our courses beyond the trial period.
Thanks again for any support on this.
Hi Martin and welcome to Heroes!
I haven't heard of this becoming a feature, or even one that is talked about here in the forums as a feature request, but you're welcome to submit one. I would suggest the best method to restrict users from accessing your content past a pre-determined date would be to host within an LMS or web server where you could restrict their access to a course.
- MartinHernqvistCommunity Member
Many thanks for your quick answer Ashley. It is a good suggestion but we have many clients who will be using the material in remote places and sometimes on board ships where internet connection may be poor or non-existing. Hence the need for CD or offline IPAD solutions. I'll submit a feature request.
Any other suggestions, that non-programmers may understand and use, still welcomed of course.
- JayMetzgerCommunity Member
Ashley - I will definitely post it as a request, but I think this is something that you should definitely consider. We create courses for clients that host the courses on their own LMS. I do not have the ability to set the expiration date that way, so I need to be able to do it in the code. Lectora and Captivate both have this feature, and I am inclined to use these products until this is a feature for Storyline (although I would like to use Storyline more), as I cannot create a great product only to give it away forever because I can't expire it when a contract is up.
Hi Jay,
Thanks for sending in a feature request, and I can see where this feature would be used by a lot of users. There may be something you could include in a Javascript trigger at the beginning of the course to check the date - but I'm not equipped to help write those. There may be someone in the community who could assist.
- RaymondMCommunity Member
I've been working with Javascript more in Storyline and have also been programming date related events. If I get some spare time, I'll try and post up a solution.
- JohnPieterse2Community Member
Hi Ashley,
As we also deliver our software to remote areas I strongly agree with Jay and others that this feature would be very useful, if not essential. I love SL and use it a lot. But like Jay, I am forced to use Captivate if I want to set an expiry date. I already made this a feature request.
Thanks John for sending this in as a feature request, and I certainly understand the reasoning why this would be essential, so the more feature requests the better!
- JohnPieterse2Community Member
Hi Ashley,
Ref to earlier request of Martin H. I wonder if somebody has found a way to work around setting an expiry date on a course after being downloaded on an iPad for offline viewing. It would be ever so helpful delivering content to clients in remote areas. The trick of Garth works fine but as it is in Java it won't work on the iPad. Any brilliant mind doing this in html5
Regards,
John
- SteveWootenCommunity Member
We just talked about needing this feature for materials that will be downloaded. I honestly assumed that this feature existed, so I'm scratching my head on how to create a work around that will allow me to do this. We would like to set expiration dates so that if someone needs to download the materials, then the materials will only work until the next revision date. Otherwise, we run the risk of having old versions of files circulating for years and years and years.
Any guidance on solving this would be greatly appreciated.
- ZioFontaCommunity Member
there are some errors in the story provided by Garth on date validation, when validating date you cannot simply compare each expire value (year, month and day) to actual one, while you must proceed first comparing year, then month, and finally day.
here is a story file that should work well.
I put 2 layers to display the result of validation on each one.
expire date is set in JS but you could also set it by system variable and retrieve those variable when executing the JS.
- BjWilsonCommunity Member
Thank you for this it works great for CD and web and upgrades to version 2 well
- RachelHorton-8bCommunity Member
Hi Zio,
Thank you for sharing your solution. I had it working in past versions of SL. It stopped working. Any ideas as to why?
When the "yearexpire" is set in the future I receive the Valid Layer as designed.
When the "yearexpire" is set in the past, I do not receive the Expired Layer.
Are you still using Storyline? Which version? I am using Storyline 360 v3.34.20804.0.
Any help would be much appreciated.
Thank you.
Rachel- OwenHoltSuper Hero
Let me simplify the process and code for you.
You need 3 variables:
- 1 text for a "published" or "created" date in the format of mm/dd/yyyy
- 1 number variable for the number (in days) that the course is valid for, like 60 or 365
- and one numeric variable (let's call it "Days") that will receive a value from the JavaScript below showing how much time has passed sine the course was published/updated
You need to execute the following JavaScript at TimeLine start on your first slide.
let player = GetPlayer();
var date1 = new Date(player.GetVar("CreationDate"));
var date2 = new Date();
var elapsedTime = date2.getTime() - date1.getTime();
var elapsedDays = elapsedTime/(1000 * 3600 * 24);player.SetVar("Days", elapsedDays);
Lastly, you need a trigger to run AFTER the Javascript to show your "Course Expired" layer. It should be something like Show layer Expired when timeline starts if Days > Valid_Days
You can see it in action here: Link to Demo
If that is what you you are looking for, there is a Template file in the resources of the published course that you can download.