Variables don't work

pkulpinski3055
Community Member Posts: 7
Hi,
I need to stop users from proceeding to the next page until they explore all content on the current page. I have seven buttons with tooltips hiden in them, so user has to enter all of them with mouse cursor and until he does it, he can't proceed to the next page.
I created action for each of the seven buttons:
on mouse enter - modify variable called "i" - add to variable value (first button adds value 1, second button adds value 2 etc.) (I attach screenshot of the action).
Then I created two actions for button "Next". One action is "display a message" IF variable "i" does not contain 1, variable "i" does not contain 2, varibale "i" does not containt 3 etc. (any condition can be true). The other action is go to next page IF variable "i" contains 1, variable "i" contains 2 etc. (all conditions must be true).
The first action works well, but the other one - doesn't. Even when I enter all the buttons with mouse, I still cannot proceed to next page.
Maybe someone can help me with it? I've only used Lectora for few days, so maybe I'm making some rookie mistake, that I'm not aware of
PS. I attach screenshots of actions and conditions.
I need to stop users from proceeding to the next page until they explore all content on the current page. I have seven buttons with tooltips hiden in them, so user has to enter all of them with mouse cursor and until he does it, he can't proceed to the next page.
I created action for each of the seven buttons:
on mouse enter - modify variable called "i" - add to variable value (first button adds value 1, second button adds value 2 etc.) (I attach screenshot of the action).
Then I created two actions for button "Next". One action is "display a message" IF variable "i" does not contain 1, variable "i" does not contain 2, varibale "i" does not containt 3 etc. (any condition can be true). The other action is go to next page IF variable "i" contains 1, variable "i" contains 2 etc. (all conditions must be true).
The first action works well, but the other one - doesn't. Even when I enter all the buttons with mouse, I still cannot proceed to next page.
Maybe someone can help me with it? I've only used Lectora for few days, so maybe I'm making some rookie mistake, that I'm not aware of

PS. I attach screenshots of actions and conditions.
Comments
-
First, let's clear up what happens when you add to a variable. I'm assuming the value of i is initially 0. When the action shown in your attachment 2.png fires, the value of i becomes 7, not 07. If that same action fires again, the value becomes 14; it's adding as in math, not adding as in extending.
Knowing that, you might be tempted to change your condition to if i >= 7, but that won't give you the result you want either -- because if button 3, for instance, adds 3 to the variable, I could mouse over button 3 three times, the variable would equal 9, and the test would be true.
The approach that might be easiest to understand is to create a separate variable for each button (button1, button2, etc.) and set the initial value to 0 or False for each variable. On the mouse-over action for each button, change the corresponding variable to 1 or True (using "Set Equal To", not "Add to Variable"), and make the condition for showing the Next button button1 = 1, button2 = 1, button3 = 1, etc., and all conditions must be true.
-
All clear now! I got it wrong from the beggining. I read this post on blog (http://elearningbrothers.com/how-to-disable-the-next-button-in-lectora/), that variables are like containers, so adding to variable means puting something into it, so I thought that if I add to variable 1, 2 and 3, in the variable there will be 1, 2 and 3, and it's 6! Life's gonna be much easier now
Thank you!
Categories
- 4.8K All Categories
- 6 New Feature Releases
- The Training Arcade®
- Arcades™
- 123 ✫ Announcements
- 9 ✪ Contests
- 34.1K eLearning Brothers® Products
- 33.6K Lectora®
- 31.6K Lectora Discussions
- 1.9K Lectora Feature Requests
- 71 Lectora User Groups
- 16 Asset Library
- 10 AssetLibrary Discussions
- 6 AssetLibrary Feature Requests
- 301 CenarioVR®
- 176 CenarioVR Discussions
- 125 CenarioVR Feature Requests
- 36 Rockstar Learning Platform®
- 24 Rockstar Learning Platform Discussions
- 12 Rockstar Learning Platform Feature Requests
- 4 Off-the-Shelf Course Library
- 3 Off-the-Shelf Course Library Discussions
- 1 Off-the-Shelf Course Library Feature Requests
- 114 CourseMill®
- 107 CourseMill Discussions
- 44 ReviewLink®
- 32 ReviewLink Discussions
- 12 ReviewLink Suggestions
- 2 The Training Arcade®
- 1 The Training Arcade Discussions
- 1 The Training Arcade Feature Requests
- 10 Additional Learning Products
- 2 Adobe®
- 4 Articulate®
- 2 Camtasia®
- Docebo®
- 1 iSpring®
- 1 Microsoft® PowerPoint®
- 930 All Things eLearning
- 5 Course Development Showcase
- 1 eLearning Brothers® Downloads
- 1 Compliance Training
- 11 eLearning Development
- eLearning Game Design
- 7 Instructional Design
- 545 Learning Management System (LMS) Integration
- 2 Mobile Learning
- 21 Visual Design
- 331 Web Accessibility
- 1.2K ♪ The Green Room
- 8 ♡ Community Feedback
- 7 Community Tips