Highlighted

Increment/Decrement variable issue

Community Beginner ,
Feb 06, 2020

Copy link to clipboard

Copied

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.

Correct answer by BroRoyVa79 | Community Beginner

Thanks!

 

This worked. Appreciate the help!

Topics

Advanced, Advanced actions

Views

195

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Increment/Decrement variable issue

Community Beginner ,
Feb 06, 2020

Copy link to clipboard

Copied

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.

Correct answer by BroRoyVa79 | Community Beginner

Thanks!

 

This worked. Appreciate the help!

Topics

Advanced, Advanced actions

Views

196

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Advocate ,
Feb 06, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Feb 06, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Feb 10, 2020

Copy link to clipboard

Copied

Thanks!

 

This worked. Appreciate the help!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Feb 06, 2020

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Feb 06, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Feb 06, 2020

Copy link to clipboard

Copied

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.  

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Feb 06, 2020

Copy link to clipboard

Copied

Version 9.0.2.437.

Also, don't know if you saw this since I edited it in:

"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."

 

Thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Feb 06, 2020

Copy link to clipboard

Copied

Unlike Storyline, Captivate doesn't allow you to use the fact that a variable's value has changed as an event to trigger an Advanced Action.  (That would be a great enhancement to the app that would make a lot of sense.)

 

So you are left with the need to use one of the other available events to trigger actions.  Either have it done via a user interaction such as clicking a button, or else the On Enter Slide event at the beginning of a slide.

 

With your current interaction, which is really just a simple Menu Slide setup, using the On Enter Slide event to trigger a Conditional Action that changes the relevant object states would be the best option.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Resources
Captivate User Guide
New Group