Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Tracking the progress with variables and output to a progress bar

Engaged ,
Apr 10, 2018 Apr 10, 2018

Hi there, this may be a silly question but I just cannot get it straight.

Here is my case. I have a project with 4 levels.

The user can go to any level at any time - there is no prerequisites to go first to the first level and then to the second.

When the user goes to the last slide of each level, s/he would complete the level. I track that with a variable.

What I would like to track also is the overall progress with 4 stars. If the user has completed level 1 and 3, two of the stars will become yellow, the other two would be white. If the user completed level 2,3 and 4 three stars will become yellow and one will be white.

I am thinking of using a variable called v_ProgressVariable and to have it incremented with 1 every time the user completes a level. However, if the user completes level 1 twice for instance, s/he would get two stars... I do not want that. I want the user to get a star only for a unique visit of a level. I imagine that I can elaborate some complex schema with disabling buttons etc., but the project is already heavy with variables and I was thinking if anyone would have a simpler idea?

Thanks in advance!

Bobby

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

correct answers 1 Correct answer

Community Expert , Apr 11, 2018 Apr 11, 2018

OK, this means you already have the variables You need the Expression command because Captivate has only basic mathematic operators and restricting to two terms or factors (you know I'm an engineer and maths lover). If I label the variable v_stars, with a default value of 0, and you have 4 variables, you'll need 3 Expression commands to calculate v_stars:

    Expression v_stars = v_one + v_two

    Expression v_stars = v_stars + v_three

    Expression v_stars = v_stars + v_four

JS experts will laugh

...
Translate
Community Expert ,
Apr 10, 2018 Apr 10, 2018

Use a Boolean var for each level, toggled to 1  after completion. Calculate sum of those vars with Expression commands or JS, will give you number of stars.

Be careful with too much vars, try reusing vars and replacing advanced actions by shared action instances whenever possible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 11, 2018 Apr 11, 2018

Thank you for your usual kind reply Lieve, I followed your webinar and I must say that I am always trying to use shared actions when it is feasible.

As to the Boolean. This is what I am basically using right now. A variable will turn to 1 once the user has gone to the last slide of a level.

I am not sure about the Expression. Would you please give me a hint? This is how my action looks like, but what to use in the Expression to be sure that even if the user visits twice the level, s/he would not get another star? ...

11-04-2018 09-31-29.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2018 Apr 11, 2018

OK, this means you already have the variables You need the Expression command because Captivate has only basic mathematic operators and restricting to two terms or factors (you know I'm an engineer and maths lover). If I label the variable v_stars, with a default value of 0, and you have 4 variables, you'll need 3 Expression commands to calculate v_stars:

    Expression v_stars = v_one + v_two

    Expression v_stars = v_stars + v_three

    Expression v_stars = v_stars + v_four

JS experts will laugh at this workflow and use a function in JS, but if the number of terms is so small I prefer that 'ridiculous' sequence in an advanced action. I suspect you have already the setup for showing the stars?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 11, 2018 Apr 11, 2018
LATEST

The setup of the stars is one image with several states (see image). Just disregard the last fifth star please.

The initial state is normal (0 stars).

Just to rewind...

On Enter at the Menu Slide there is an Advanced action that should calculate how many levels the user has taken. So if s/he has taken only level 2 for instance, the state of the img_StarsInLift will change to One_Star. The menu is the buttons in the lift actually , hence the name.

To try and understand the how the Expressions would work.

Only Floor 2 visited

1. The user has gone to the last slide of the level 2.

2. The variable v_two changes the value from 0 to 1

3. OnEnter at the Men Slide the AA that is checking the completion stars

v_stars=v_one+v_two will give a 1 since the v_one is not visited

v_stars=v_stars+v_three will give a 1 since only the v_one is set to 1, the rest are 0

v_stars=v_stars+v_four will give 1 for the above reason

Floor 2 and 3 visited

1. The variables v_two and v_three will be both 1.

2. OnEnter AA will check the following

v_stars=v_one+v_two will give 1

v_stars=v_stars+v_three will give 2

v_stars=v_stars+v_fours will give 2

I think all that should work.

I will test thoroughly and give feedback if needed.

Thank you once again Lieve.

stars.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources