Forum Discussion
Trigger to unhide continue button before exit course not working.
I realize this isn't best practice, but this learner group needs the following scenario, and I can't get the "Change state from Hidden to Normal" function to work on a button.
I need them to be able to print an activity guide, which will take them a few days to complete during their daily workflow (retail).
Then they are to log back into the course to take an assessment. I am trying to hide the Continue button that leads them to the assessment until they click to exit the course. My triggers are:
- Print PDF button - one trigger to print the PDF, and it works fine.
- Exit Course button - two triggers - change the initial state of the Continue button from hidden to normal, THEN exit the course - this is what is not working when I test the course in SCORM Cloud by exiting and re-entering the course.
I need them to NOT see the Continue button until they return to the course, so they don't just skip activities and click Continue right away.
When I click the Exit Course button with the two triggers mentioned above and return to the course, my Continue button is still hidden.
Can anyone help? Thanks in advance!
3 Replies
- CarlFink1Community Member
This won't work, because they can simply exit the course and return immediately to get credit even after you fix the button.
Best practice would be to make the assessment a separate course, and set the LMS to not allow it to be taken until (e. g.) three days after completing the instructional portion.You still can't make them do that activity, of course, but you can encourage them. To make them take it, have questions or activities in your assessment that depend on the activity (and tell them you're doing that).
- AndrewBlemings-Community Member
I can see a simple, easy (but not foolproof) way and a more complicated, more secure way.
The easy way is to alter your triggers a bit. You don't need to unhide the Continue button before they exit in order for it to show when they return. Before closing the content, the Exit Course button c"an run a trigger that flips a variable called unhideContinue to true. Then the course is closed.
If the course is saved in an LMS, the value of that variable will be included in the "suspend" data that's reloaded when the course is reopened, which means when the learner reopens the course, you can have a trigger that checks that variable when the slide with the continue button starts, and if the value is (now) true, the trigger can unhide the button. As long as the trigger runs when the slide starts, it will still rerun every time.
The more complicated method is to script in an actual time lock. If you again make a variable called unhideContinue, we can change its value in a trigger that Executes JavaScript.
The script can set the variable to true when the today's date is numerically greater than or equal to the date you want the assessment to unlock.
let targetDate = new Date(2026, 10, 4); // Nov 4, 2026 let today = new Date(); today.setHours(0, 0, 0, 0); setVar("unhideContinue", today >= targetDate);If you're new to JavaScript, it might look a bit weird, but the gist is the last line compares today's date to whichever targetDate you want, and then resolves the comparison into a true or false that it sends to Storyline, triggering your Continue button to show.
Just change the numbers in the "new Date(2026, 10, 4)" parentheses to whatever works best. I think you can test/circumvent it by changing your computer's clock, if able.
- JudyNolletLegend
KimberlyFlet427: As Carl suggested, you could use separate courses and LMS settings to "encourage" users to complete the activity.
To address your problem using the one course: The triggers you describe sound okay. That should change the Continue button before the user exits.
You say the Continue button isn't Normal when returning to the course. It sounds like the Slide Properties for revisiting might be "Reset to Initial State." If so, switch to "Resume saved state."
Another potential issue: Do you have a trigger to change the state of the button to Hidden when the timeline starts? That trigger will run every time the user visits/revisits the slide, even if the slide is set to "Resume saved state." ("When the timeline starts on this slide" should really be called "When the user reaches this slide.") Instead of using a trigger to hide the button, set its Initial state to Hidden.
And if neither of those solutions work, here's one more long shot. It's possible that the updated button state isn't properly included in the suspend/resume data. The fix for that is to go to another slide, which forces the program to save the data. For example, instead of exiting, have the exit button jump to a "confirmation" slide without any of the built-in navigation. That slide would just have an "Confirm Exit" button and a "Return" button.
Related Content
- 1 year ago
- 10 years ago