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

Reset variables

New Here ,
Sep 18, 2017 Sep 18, 2017

Hello,

Need some help with resetting variables please (probably a simple fix is needed). 

I have a branching scenario - For one of the variables, say X, the default value is 0 and on visiting a specific slide (on enter), it is assigned with 1. 

Then later on in the course, if X is greater than or equal to 1, a few other specific slides display. T

Its not working during my previews - I guess X has been incremented with 1 initially. And its not getting reset to 0 on subsequent previews/publishing. 

I don't want it to reset during the course. However, even for my preview/testing, it just doesn't get reset 😞

Any ideas will be helpful.

Thanks!

1.2K
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 , Sep 18, 2017 Sep 18, 2017

Oops, forgot the last action, bit distracted by multitasking.

You'll need another conditional action which could be triggered on Enter for Slide 21:

   IF v_choice is equal to 2          means they choose first the second scenario

        Jump to Slide 2

   ELSE

        Continue

Translate
Community Expert ,
Sep 18, 2017 Sep 18, 2017

I normally will use the On Enter action of slides for reset purposes. You will need to provide more information about the scenario and the actions you are using at this moment to be able to help you set up those On Enter actions.

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
New Here ,
Sep 18, 2017 Sep 18, 2017

Hi Lilibri,

Thanks for the response. Here is the scenario.

I have a simulation, where based on learner selection of options, the sequencing of slides changes.

Here it goes:

Slide 1 has 2 scenarios/options. Both the scenarios should display irrespective of the order of the options they choose.

Scenario 1: Select - No address match

Scenario 2: Select – Area

  • Slides 2-10 explain No address match concepts. On entering Slide 2, I’m assigning Address_variable = 1 (Default value =0).
  • Slides 11-20 explain Area concepts. On entering Slide 11, I’m assigning Area_variable = 1 (Default value = 0).
  • Slide 21 is the end of simulation common to both scenarios.

  • When learner selects No address match, slides 2-10 display. On slide 10, I’m executing a Conditional Advanced Action 1 – i.e. if Area_variable is greater than or equal to 1, jump to Slide 21. Else, move to Next slide (which is slide 11). [I’m assuming if slide 11 is not visited yet, Area_variable should still be 0, therefore, it would go to slide 11).
  • When learner selects Area, slides 11-20 display. On slide 20, I’m executing a Conditional Advanced Action 2 – i.e. if Address_variable is greater than or equal to 1, jump to Slide 21. Else, jump to slide 2. 

Hope it's not too confusing. Any help will be greatly appreciated. Thank you!

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 ,
Sep 18, 2017 Sep 18, 2017

Trying to summarize:

  • The sequence is chosen on slide 1, I would use the variable v_choice (sorry my labeling discipline is to have a variable always starting with v_) to track the choice, by using an advanced (or shared) action for each of the two scenario clicks. To be sure that everything works fine when revisiting that first slide:
    • Use the On Enter event to Assign the value 0 to the variable v_choice
    • Use the Success event of both interactive object (don't know what you use, a shape button or a click box over something) to set the value of the variable and jump to the appropriate slide; for the first scenario that would be:
          Assign v_choice with 1
          Go to Next Slide
      For the second scenario:

        Assign v_choice with 2
        Jump to slide 11

  • On Enter for slide 11 use this conditional action
       IF v_choice is greater than 1
           Jump to Slide 21
       ELSE
            Go to Next Slide

You have to try it out, I have not time to double-check myself. If it could happen that no choice has been made - which is possible when you use a default playbar, let me know.

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
New Here ,
Sep 18, 2017 Sep 18, 2017

Thanks again Lilibri.

I'm wondering if it would still work if the scenarios have to play one after the other whatever option they choose first. (sorry it that wasn't clear in my post).

Also, a query in this:

  • On Enter for slide 11 use this conditional action
       IF v_choice is greater than 1
           Jump to Slide 21
       ELSE
            Go to Next Slide

Assume  I choose the second scenario, so vchoice = 2 and jumps to slide 11. If the above action is executed, since v_choice is going to be 2, it would go to slide 21 instead of slide 12. Isnt'd ?

I'm going to try your suggestion in the morning though, if you have any further input in the meanwhile, please let me know. Thanks so much!

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 ,
Sep 18, 2017 Sep 18, 2017

Oops, forgot the last action, bit distracted by multitasking.

You'll need another conditional action which could be triggered on Enter for Slide 21:

   IF v_choice is equal to 2          means they choose first the second scenario

        Jump to Slide 2

   ELSE

        Continue

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
New Here ,
Sep 19, 2017 Sep 19, 2017

Lilibiri,

Thanks again - it worked! I had to make a few tweaks to make it work for my case. However, the main catch was:

  • Use the On Enter event to Assign the value 0 to the variable v_choice

I set up 0 as default value to the variable. However, did not add this action to reset the variable on each visit. 

Thanks again. Cheers!

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 ,
Sep 20, 2017 Sep 20, 2017
LATEST

Thanks for coming back to report about succeeding!

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