Solved

Help with setting up complicated variables/conditions for actions

Hello Lectora Community. My name is Jase and I am still a beginner with Lectora. I am creating a training course for my company and I am needing help with actions/variables/conditions for a specific page. I have attached a screenshot for the page I am working on. I have the page set up with instructions text and then the learner presses a button where the instructions text and button are hidden and doors with the door key are shown. The learner has to choose one of six doors to enter to start their adventure. I have added a custom status indicator (green checkmark) for the completion. But, I am wanting to have it set up with actions/variables/conditions to have it set up in Lectora to track the learner's status for completion. I am also wanting to have it set up so that the first five doors are completed and once they are completed, the sixth door appears. Finally, I would like it set up so that if the learner has to come back to this page throughout the training, they are able to bypass the instructions and reveal doors button. Is there a way to set this up? If so, can someone help me with setting it up since I don't know how to set it up.

Thank you in advance.

Solution

Hi Jase and welcome!

The following is generally how I set up pages like this.

When working with a more complex situation like this, variables are used to track the status of actions/states.

You'll need 8 variables:

1. One for each door to show status indicators, and determine if the 6th door can be shown.

2. One to track if Door6 can be shown

3. One to track if the Instructions were viewed

When you create the variable, check Retain variable value between sessions if you want the user to pick up where they left off when re-entering the course, or leave unchecked to reset when they re-enter. If you do this, you may want to have a button to View Instructions so the user can get back to the instructions.

You can use what ever you want for the variable values, such as unseen/seen, notclicked/clicked, false/true, but I usually use 0 and 1 for everything, where 0 is false, 1 is true.

Next, place objects in groups. My groups differ a little from yours, as it will require fewer actions to toggle objects.

The items highlighted are set to Initially Hidden in properties.

Use an action group to toggle to make things easier in the long run - you'll always know to go back to that area if you need to make a change. Add your actions in there. Most actions will be to show a group if the group's status is 1, otherwise hide the group. See the example below.

  • MainInstructions will show if InstructionsViewed =0, else condition of hide

  • PageInstructions, doors, and buttons will show if InstructionsViewed =1, else condition of hide

  • Door6Available sets the variable Door6Available to 1 if all Door variables are set to 1

  • ShowDoor1StatusInd shows Door1StatusInd if Door1=1 (same set up for the other ShowDoorXStatusInd actions

  • Door6 and Door6Button is shown if Door6Available=1

  • Door6 and Door6Button is shown if Door6Available=1

  • Door6StatusInd is shown if Door6Available=1 and Door6=1

Add actions to your buttons to set the variable and then go to the page/section you want.

Finally, add actions at the page level to run the Toggle and Set the InstructionsViewed (in that order otherwise the instructions will never show). Alternately, you could put the InstructionsViewed action on each button (you'd need to change the action trigger to on click though. These actions will allow for the the instructions to be shown on first time on page, then show the other objects when returning to the page.

Hope this helps:) I'm attaching an example.

Chrystal

Discussion (1)

Hi Jase and welcome!

The following is generally how I set up pages like this.

When working with a more complex situation like this, variables are used to track the status of actions/states.

You'll need 8 variables:

1. One for each door to show status indicators, and determine if the 6th door can be shown.

2. One to track if Door6 can be shown

3. One to track if the Instructions were viewed

When you create the variable, check Retain variable value between sessions if you want the user to pick up where they left off when re-entering the course, or leave unchecked to reset when they re-enter. If you do this, you may want to have a button to View Instructions so the user can get back to the instructions.

You can use what ever you want for the variable values, such as unseen/seen, notclicked/clicked, false/true, but I usually use 0 and 1 for everything, where 0 is false, 1 is true.

Next, place objects in groups. My groups differ a little from yours, as it will require fewer actions to toggle objects.

The items highlighted are set to Initially Hidden in properties.

Use an action group to toggle to make things easier in the long run - you'll always know to go back to that area if you need to make a change. Add your actions in there. Most actions will be to show a group if the group's status is 1, otherwise hide the group. See the example below.

  • MainInstructions will show if InstructionsViewed =0, else condition of hide

  • PageInstructions, doors, and buttons will show if InstructionsViewed =1, else condition of hide

  • Door6Available sets the variable Door6Available to 1 if all Door variables are set to 1

  • ShowDoor1StatusInd shows Door1StatusInd if Door1=1 (same set up for the other ShowDoorXStatusInd actions

  • Door6 and Door6Button is shown if Door6Available=1

  • Door6 and Door6Button is shown if Door6Available=1

  • Door6StatusInd is shown if Door6Available=1 and Door6=1

Add actions to your buttons to set the variable and then go to the page/section you want.

Finally, add actions at the page level to run the Toggle and Set the InstructionsViewed (in that order otherwise the instructions will never show). Alternately, you could put the InstructionsViewed action on each button (you'd need to change the action trigger to on click though. These actions will allow for the the instructions to be shown on first time on page, then show the other objects when returning to the page.

Hope this helps:) I'm attaching an example.

Chrystal