Skip to main content
lashondrac51319316
Known Participant
December 13, 2017
Question

Show 'hint' after clicking the wrong place on the screen three times

  • December 13, 2017
  • 2 replies
  • 393 views

Hello all!

I am developing a simulation of requesting time off in our hr system. I would like that after the learner clicks the wrong place in the program three times they are given a hint about where to click. I know that if I set the amount of attempts to three times for example, and have it show the hint after the third time it will not let the user then click the correct answer. I'm thinking I need to do an advanced action for me to do this but I'm not sure how to do that.

This topic has been closed for replies.

2 replies

Lilybiri
Legend
December 14, 2017

I would use advanced actions (of course).  But have to know if this is a responsive project or not. Reason: in CP2017 you cannot have two objects stacked when developing a responsive project with Fluid Boxes.

You need to put a click box behind the first button, that click box should cover the slide. You can use the Success event of that click box to do what Jeremy explained with JS. It is up to you, but first have to be sure about the type of project.

lashondrac51319316
Known Participant
December 14, 2017

It is not a responsive project. I feel more comfortable using advanced actions. Im not sure how to increment the variable when it is clicked though.

lashondrac51319316
Known Participant
December 14, 2017

Okay, I figured it out! I set the 'clicks' variable to 1 and then did this.

Jeremy Shimmerman
Participating Frequently
December 14, 2017

You can do this with javascript or advanced actions / or a combination.  But essentially you will need to create three things:

1. An 'invisible' button over the incorrect area

2. A variable that goes up incrementally each time you click

3. An if statement that is triggered on each increment / button press.  This statement would 'check' if you reached the number of clicks. 

 

I prefer to use javascript over advanced actions so this would be how I do it. 

1. Under Project -> Variables, create a new variable title 'clicks' and give it a value of '0'

2. Create a text hint and title it 'msg'.  Make it hidden by clicking on the eye icon.

3. Create your invisible button shape over the area that will trigger the clue.  On this invisible button execute the following:

clicks = clicks + 1;

if (clicks == 3){

cp.show('msg');

}

If you want it to be more clicks just change the '3' to whatever value you want.  Hope this helps.