Forum Discussion
Reset multiple variables to default values
Is there any shortcut for reseting many variable to their default values? I'm creating a scenario based training in which I have about 20 variables tracking user progress. If they choose to restart the training I need to reset all of the variables. Can that be done with a single trigger or javascript versus adding 20 individual triggers to my Restart button? Thank you!
39 Replies
- YvetteHealeyCommunity Member
Hi, Ashley! A preliminary test in preview mode seems to indicate it's working!! I will test in my LMS today to be certain. Thank you so much!
So happy to hear that - and also if you're not ready to load up into your LMS you'll want to look at using SCORM Cloud as it's an industry standard for testing LMS content. This article will walk you through how to properly test content.
- RajeshRamesh-2bCommunity Member
Thanks Steve, It really helped our team and saved much amount of time. :)
- garywilliams713Community Member
Hi Ashley
I'm just working through this thread now as I need to reset all my variables when a course restarts. I really don't want to incorporate any JS (due to the potential errors that it might produce further down the line) so is there a Reset All Variables option in SL2?
Hey Gary!
Looks like all of your options have been shared in this thread.
- Triggers for each variable
- JavaScript shared by community
Just be sure that the triggers have time to execute before you jump to the beginning of your course, or they could execute when the timeline starts on that first slide.
- DwayneSchamp-f3Community Member
I'm thinking it would be a great idea to add the resetvars option to the action list. SL already has a complete list of user created vars, their type, default values, etc. so creating the code to run through the list and reset them based on those default options is quite easy with a recursive function call.
having to create 10s of triggers or create a javascript solution is a time wasting issue.
- EducacionVirtuaCommunity Member
Hola, alguno me podrĂa ayudar!
Tengo una variable incorporada que cambia el estado de un objeto, necesito que la variable se reinicie si el usuario quiere volver a empezar el "juego"Muchas gracias.
- WaltHamiltonSuper Hero
Si empiece de nuevo el proyecto entero, todos los variables se reinicien.
Si no, puede usar la accion que hace el usario para reempezar como iniciador de disparador que cambia el variable.
- GeneTothCommunity Member
Seems this could be managed using a series of master slides.
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago