Featured Categories
-
Lectora®
Lectora® is the most trusted authoring tool in the world. Rock out your creativity! Author courses any way you like. Lectora adheres to best practices for Accessibility and Web Content Accessibility Guidelines (WCAG), offers responsive authoring for eLearning, and publishes to any LMS (Learning Management System).
-
CenarioVR®
Experience virtual reality through CenarioVR®, our training and virtual reality (VR) authoring software that allows you to create immersive learning in minutes! No coding required!
-
Rockstar Learning Platform®
Our Rockstar Learning Platform® has all the features you’ll love. Help your employees be better at their jobs, more valuable to your company, and most effective in servicing your customers.
-
The Training Arcade®
Level up your learner engagement with the Training Arcade®! The Training Arcade is a library of fun, mobile-ready, casual games that can be rapidly customized with your content to create effective gaming!
-
ELB Learning Content
Did you know that our AssetLibrary™ has over 120 million engaging, interactive, and awe-inspiring templates and assets to help you become an eLearning Rockstar®?
Using the CurrentDate variable as a condition

I have to admit I haven't looked into this on my own much yet. I'm in the middle of a project and was going to try after but I figured I'd see if anyone has ever done it.
I have some courses that have a survey link in them that takes them to a external site (Survey Monkey). We decided that we should start removing the survey links after 30 days.
So I was thinking, instead of going back in and removing the link and republishing, is there an action I can set to show the survey link?
Something like, On Show / Show: Survey Link / On Condition: CurrentDate is less than 30 days.
I would figure that the date doesn't on days, so it may have to be something more like giving it an exact date, like less that 9/22/13.
However, I am not sure how Lectora handles less than and greater than on a date field. There is an option of adding 30 conditions I guess and making the conditions to SHOW if CurrentDate is equal to: and list all the possible dates for the next 30 days. That seems long winded though.
Has anyone done something like this before?
Comments
-
Create variable called "MyMonkeyExpired".
Add another action to the page, before showing the monkey link:
On Show / Execute JS / Script:
var d = new Date();
var ex = new Date("11/22/2013"); //set this by hand as MM/DD/YYYY
Math.floor((Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()) - Date.UTC(ex.getFullYear(), ex.getMonth(), ex.getDate())) / 1000 * 60 * 60 * 24) > 30 ? VarMyMonkeyExpired.set('YES') : VarMyMonkeyExpired.set('NO');
Change the condition on your action to "if myMonkeyExpired contains YES". -
@sirwise23 55936 wrote:
Hmmmm.... No luck with this. I tried setting the condition for both Yes and No. Seems like the variable is not being written to. I will play with it though. Thanks.
1. Any JS errors in console?
2. Make sure the variable is either used in that page or added to Required variables list, otherwise Lectora won't create the variable and it consequently won't be populated.
3. If you're testing locally, make sure you test in IE, since other browsers don't work all that well with Lectora when the course is running from local hard drive. -
Ok, I just checked - it all works, no problem.
Set the expiration date to e.g. 05/22/2013 - and you'll get and Expired! message. Set it to 11/22/2013 - and you'll get a "not expired!" message.
Download the project here - https://dl.dropboxusercontent.com/u/11433463/trivantis/expiration/Title%201.awt -
Ahhhhh. Silly me. I didn't realize the date was to be set to the expiration date. I took it as the date should be today's date and that it would expire if it was more than 30 days from today. I never tried setting it as a date in the past to see if it works. This works great. Thank you.
Categories
- 35.9K All Categories
- 110 ✫ Announcements
- 33.2K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 27 ELB Learning Content
- 27 ELB Learning Content Discussions
- 346 CenarioVR®
- 205 CenarioVR Discussions
- 141 CenarioVR Feature Requests
- 44 Rockstar Learning Platform®
- 41 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 48 ReviewLink®
- 48 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 938 All Things eLearning
- 39 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products