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!
GREAT idea! Let me try setting up a new thread now in addition to having replied to this older one. If all else fails within the next 24 hours, I'll try using the built-in variable reset to see if that works. Thank you!
Ashley...I think the reason I initially looked into the JavaScript code is because I was having trouble with multiple individual triggers to reset 11 variables to true when a button is pushed. In other words, won't only the FIRST variable in the 11 triggers reset once the button is clicked? Or will ALL 11 triggers run to reset all 11 variables to 'false' before the trigger "to to main menu" runs?
You'd have to have a trigger for each variable and all those would appear before the jump to main menu trigger to ensure they were executed in time. Again - a lot of triggers! So the Javascript may be the option that you're looking for...but the code can be tricky. One errant comma and the whole thing is off.
Indeed! If I could be assured (by specifying order) that each variable could be reset to False in the split second before the "Jump to slide" trigger, I'd feel better. Isn't that theoretically what's supposed to happen?
Theoretically yes :) You can see the information here in regards to the order in which triggers are executed. So from top down, within each of the sections (player, slide, object).
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.
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?
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.
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.
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"
39 Replies
GREAT idea! Let me try setting up a new thread now in addition to having replied to this older one. If all else fails within the next 24 hours, I'll try using the built-in variable reset to see if that works. Thank you!
Ashley...I think the reason I initially looked into the JavaScript code is because I was having trouble with multiple individual triggers to reset 11 variables to true when a button is pushed. In other words, won't only the FIRST variable in the 11 triggers reset once the button is clicked? Or will ALL 11 triggers run to reset all 11 variables to 'false' before the trigger "to to main menu" runs?
Hi Yvette,
You'd have to have a trigger for each variable and all those would appear before the jump to main menu trigger to ensure they were executed in time. Again - a lot of triggers! So the Javascript may be the option that you're looking for...but the code can be tricky. One errant comma and the whole thing is off.
Indeed! If I could be assured (by specifying order) that each variable could be reset to False in the split second before the "Jump to slide" trigger, I'd feel better. Isn't that theoretically what's supposed to happen?
Theoretically yes :) You can see the information here in regards to the order in which triggers are executed. So from top down, within each of the sections (player, slide, object).
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.
Thanks Steve, It really helped our team and saved much amount of time. :)
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.
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.
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.
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.
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.
Seems this could be managed using a series of master slides.