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

Is there a way to reset all variables at once?

New Here ,
Jun 16, 2015 Jun 16, 2015

I have a project where I need to reset all of the variables in the project (about 100) when the user selects the reset button. Is there a way to reset them all at once or do I have to add them to an advanced action individually?

1.1K
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
LEGEND ,
Jun 16, 2015 Jun 16, 2015

Well, one simple and effective way would be to have the "reset button" simply open the project again in the same window. Brand new ball game!

Cheers... Rick

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 ,
Jun 16, 2015 Jun 16, 2015

Will that still work if the project has SCORM enabled and is embedded within an LMS?

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 ,
Jun 16, 2015 Jun 16, 2015

If you reset that way, you are relaunching the project and maybe that is not really what you want. If you explained a little bit more in detail. I'm always astonished when I hear someone talking about using that many variables. Is that really necessary? Cannot you reuse variables if you look closer to the work flow?

Be a Captivate Ecologist: reuse variables! - Captivate blog

Since you are using CP7, did you think about shared 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 ,
Jun 16, 2015 Jun 16, 2015

Relaunching the project is fine but it doesn't work within the LMS.

We have captivate executing a javascript on the first slide of the project that generates a random number and then assigns that value to a variable in captivate. the value of that variable determines the starting slide for the learner. (One of 4 options). Each of the four options has the same flow just different content (numbers in a budget that the users need to calculate). The variables within each budget determine the feedback the learners receive along the way. We need to find a way to have a button at the end that the learner can click on that returns them to the beginning and resets everything as if it is the first time even if they receive the same starting point. (Better yet would be if we could find a way to eliminate the branch they already completed and still randomize the other three.) 

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 ,
Jun 16, 2015 Jun 16, 2015

You explained well the goal, but that still doesn't explain to me why you should need 100 variables? Cannot the same variables be reused in each branch? Or reuse a variable and store a new random number by executing the JS again? In many cases, when trying to optimize files for clients, I detect lot of superfluous variables that make a resetting like you now need very cumbersome.

Shared actions could also help, but since you are still on CP7 it is not possible to define variables and literals as parameters.

It should also be possible to prevent navigation to an already visited branch.

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
People's Champ ,
Jun 16, 2015 Jun 16, 2015
LATEST

What output are you using, swf, html5 or both?

Also, what are the slide numbers for your branches?

I have a script that uses an array of slide numbers to randomly navigate. I could modify it slightly to "shift" the random number out of the array.

So for example. if you navigate to slide 2, 10 15 and 20 for your branches, set an array "2,10,15,20"

If 15 comes up, shift it out of the array so it is now, "2,10,20" and so on until the array is empty at which time you could set a complete variable.

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