Skip to main content
Participant
February 6, 2020
Answered

Increment/Decrement variable issue

  • February 6, 2020
  • 2 replies
  • 1210 views

I have three buttons set up on a main lesson slide that go to respective lesson slides: 1, 2, and 3. I set up that when each button is clicked that a checkmark appears next to the buttons. I have a situation where the customer wants the viewer to be able to click one of the buttons, say lesson 2, go to the lesson 2 overview slide and then hit the previous button to take them back to the main lesson slide. My issue is that I'm trying to keep the checkmark from appearing if they do that since they didn't progress through the entire lesson to complete it. 

 

I have it set up with variables, of course, and when the viewer clicks on a button it changes the value of the variable to 1. So on the lesson 2 overview slide, for instance, I thought a good solution was to decrement the value of the variable by 1. Perhaps I'm not understanding something here because the checkmark remains. Just looking for thoughts on this. I'll be happy to give a more detailed explanation if needed.

This topic has been closed for replies.
Correct answer leroyva

Thanks!

 

This worked. Appreciate the help!

2 replies

Lilybiri
Legend
February 6, 2020

It would help if you mentioned the exact version you are using as you can see under Help, About Captivate.

 

You need to split up the actions: have an action triggered by the Back button on the last slide of the lesson to toggle the Boolean variable. Use the On Enter action of the menu slide to check the values of the variables and show the checkmarks. However I would use a custom state instead of having an extra object showing up. I am not talking about the Visited state, which is an InBuilt state. 

leroyvaAuthor
Participant
February 6, 2020

Sorry, Captivate 9.

I'll look at the "On Enter" option. I thought about creating a custom state for the buttons, but thought that wouldn't really solve the problem since I still have to get it to change states based on the variable's value and the decrement option wasn't changing the value back to 0.

Lilybiri
Legend
February 6, 2020

Please, full version number! There have been several versions of Captivate 9.

 

Advantages of states is that you can choose to keep the state on revisiting, and you don't need an extra object as well which can be an advantage if you are on a responsive project.

 

Decrement will happen on the variable, although I largely prefer Assign for Booleans.  

Stagprime2687219
Legend
February 6, 2020

How many slides make up each lesson?

Have you considered only having the variable increment on the final slide when the learner completes the lesson?

On your main slide, then, you can have it so that the checkmark only shows if the variable equals 1 for that lesson rather than simply when they click on the button.

leroyvaAuthor
Participant
February 6, 2020

No, I didn't consider that. Will try it out today to see if that's a better option.