August 13, 2019
Change state variable to endlessly select and deselect an image
Comments
(3)
August 13, 2019
Change state variable to endlessly select and deselect an image
Newbie 2 posts
Followers: 0 people
(3)

Dear community,

I have created a slide in an online module where I ask learners to select up to 4 images. The images are inserted in gray scale (state 1) and when selected change state to their colored version (state 2). Now due to their task it is possible that they decide to deselect an image again after having selected it in the first place.

For this to work I created a variable (“clickendlessly”)  and when running the Advanced Action (conditional) the variable “is equal to 0” so that a click on an image changes its state to state 2 (color). The variable is toggled so “if ELSE” by clicking again it changes back to gray (state 1). So far so clear.

Now, when I switch between the 4 images, e.g. I first clicked image 1 and it changed its color to state 2 and I click on image 2, what happens now is that the first click kind of only selects the image and only when selected by clicking it again the advanced action is “released” and change of state therefore needs a second click. Once selected I can change state again and again. But as soon as I move on to another image I need to select the image first (click 1) and change state/color works only with click 2.

Question: Is that how it is and I have to live with it OR is there any way around it? So that whenever clicking on an image it changes color right away, no need for the “pre selection process”?

Help would be great!

Thanks in advance!

Jane

3 Comments
2019-08-13 15:09:49
2019-08-13 15:09:49

Hi Jane!

Sounds like Lieve got you right if you use only one variable for all images it will continue to change once you click from one to another. For example, you click on the first image and you turn the variable clickendlessly=1. Then you select the second image, but as the variable has already been changed it won’t function as intended and instead will turn back to clickendlessly=0. That’s why you had to click twice to the second image to make it work as intended.

I would suggest creating four variables, like clickendlessly_1, clickendlessly_2, etc. Then you could use a separate variable for each image and they would all work as you wanted.

Just remember if you create multiple slides like this you will either have to reset all variables to 0 on entering the slide or you have to create new variables, so the situation wouldn’t happen again when you change the value for one  variable in one slide and it’s already been turned from 0 to 1  when you come to the next slide.

I hope this helps!

Karlis

Like
(1)
(1)
>
FasterCourse e-learning templates
's comment
2019-08-13 15:16:33
2019-08-13 15:16:33
>
FasterCourse e-learning templates
's comment

Hmmm…. would prefer better names, indicating that it is a variable, by starting with v_one…. Since the unique name law in Captivate is very critical, it avoids the situation where you have the same name attached to an object or an action.

Moreover I would NOT use a advanced action but a SHARED action in that case, with the image and the variable as parameters. Resetting the variables On Enter for each slide is necessary and will allow to reuse the variables on multiple slides. It is necessary for that On Enter action to reflect on the desired situation when returning to a slide: keep the images in the state where they were when you left? Never use more variables than necessary is a golden rule as well. You can avoid having to create variables by using a trick I explained in this post:

http://blog.lilybiri.com/rare-tips-for-shared-actions

 

Like
(1)
2019-08-13 14:53:14
2019-08-13 14:53:14

It would have helped if you did post the advanced action. From your description it looks like you have only on user variable? Can you confirm? You would need a user variable, a Boolean for each of the images. That is completely logical, but will explain fully after you confirmed having only one user variable.

Like
(2)
Add Comment