In the previous Downright Sneaky Tricks tutorials for Lectora®, you learned how to create devMode, turn it on and off with a hidden button , add an indicator , and give yourself special powers . In this tutorial, you will learn how to make your secret entrance to devMode a little harder to access by adding a password.If there’s one thing I learned from Scooby Doo, it’s that you’ve got to account for meddling kids. A “secret passageway” needs to be “secret;” otherwise, it’s just a passageway.When you think about it, using an invisible button as the gateway to devMode is not very tight security. Some meddling kid mousing around might see the cursor change into a finger. If they clicked, they would discover your secret passageway, and after some shenanigans involving running on barrels, the jig would be up.So how do you beef up security for your secret passageway? With a password, of course! Instead of going right into devMode, if users click on our secret entrance, they will get a password field. They’ll have to guess the correct password before they can access the riches of devMode. Take THAT, meddling kids!Here’s the recipe...EVEN MORE SECRET ENTRANCE RECIPEYou will need…
The password process Let me take a moment to explain how this password will work.
Step 1: A user clicks the hidden button which displays the password group (password field, submit button, and cancel button).
Step 2: The user enters the password in the password field.
Step 3: The user clicks the green SUBMIT button which checks if the password is correct (or the user clicks the EXIT button to back out)
Step 4: If the password is correct, devMode is turned ON and the green checkmark appears (as well as anything else associated with devMode). If the password is incorrect, the password items all hide and devMode is turned off.
First, let’s add the groups we will need.
Next, let’s add the password field, green submit button, red Exit button, and green checkmark.
The entry field is where the user enters the password. Selecting the Password checkbox means when a user types in the field, it shows up as dots instead of alphanumeric characters. SNEAKY!
The Red Exit button is there for the user to back out if he or she gets here accidentally. The action associated with clicking the CANCEL button is to hide the 3 PASSWORD components.
Next we will repurpose the devEntrance button. Instead of toggling devMode on and off, its function will only be to show the Password group.
We will trigger these actions ONLY when the user enters the correct password.10. Select the devEntrance button and add the following action:
Now the only thing that the devEntrance does is toggle the password group on or off.Next, we will add the action that checks the password. When is the password checked? When the user clicks the green SUBMIT button. Our password will be scoobysnack. (Or anything you like. The key is to pick a password that no meddling kid is likely to guess.)11. Select the green Submit button and add the following action:
“When the user clicks the green Submit button, if the password is equal to scoobysnack, then run the RIGHT Password actions. Otherwise, run the WRONG password actions.”
If a user enters the wrong password, or if they click the red EXIT button, then this should HIDE the Password group and turn off devMode (if it is on).
The WRONG Password action group is where you define what happens if the WRONG password is entered. We want 2 things... hide the password elements and change devMode to OFF (0).
12. Select the WRONG Password action group and add the following action:
13. Select the WRONG Password action group and add another action:
The RIGHT Password Action Group is where you nest all of the good and happy events associated with entering the correct password such as showing the green checkmark, the devMode indicator, the devMenu, and turning devMode to ON.14. Select the RIGHT Password action group.15. Select the devMode Toggle Click the IF condition and remove the condition. Rename the action devMode ON.
16. Add a new action to the RIGHT Password action group with the following settings:
Add one more new action to the RIGHT Password action group with the following settings:
This last action will clear out the password from the entry field.17. Select the green Statuscheck checkmark, add a Fade for the Transition In and Transition Out, and add the following action:
We only need the checkmark to show up briefly when the correct password is entered. Once it shows up, it will fade away after 2.5 seconds.We need to do one last thing: clicking the red Exit button should trigger the WRONG password actions.18. Select the red Exit button and add the following action:
Okay, that’s everything. Give your password field a test!In conclusionSo, at the end of the day, we’ve made accessing devMode is much harder. If users find the hidden button (devEntrance), they only see the password group. If they enter an incorrect password, it all disappears! BUT if the correct password is entered, they enter the devMode, where they have SUPER-POWERS of instant navigation and god-like knowledge of right and wrong answers!At long last, you too can be the creepy villain in your own online courses! Happy haunting!
Download the Lectora and Lectora Online files for this course in the Trivantis® Community.John Mortenson is the Online Learning Manager for The Fresh Market. He has been developing online courses for over 10 years and is a member of the Lectora Advisory Board. He is also an Adobe Creative Suite Guru and cartoonist. You can contact him onLinkedIn andTwitter.