Trigger to Initialise/Reset ALL Variables in Storyline 360

Sep 11, 2018

I've been building an interaction today that uses a lot of variables. There's a point in the interaction where the learner has the chance to reset everything and I've had to add a LOT of triggers to reset the variables.

With this in mind I came up with a new feature request. It would be great if there was a trigger to reset either all developer-created project variables (obviously excluding Storyline's system variables) and/or have a check list of variables used in the project where a developer can specify which variables they want to reset via a trigger, i.e. reset variable X, Y & Z when button clicked, timeline starts etc. I believe this would save developers a lot of time and would help keep this element of a build clean.

I've requested the new feature here, if anyone else likes the sound of this I encourage you to do the same thing.

58 Replies
Lindsay Lutman

I support this feature request; particularly the ability to select a subset of project variables to be reset!  

In a project just updated from Storyline 2 to 360, I was using JavaScript to reset all of the variables to "False".  There are interactions that Toggle the variables when the user clicks (single) to either show an X (when True) or hide an X (when False).  However, after the variables were reset using JavaScript it required users to double click to change the variable to True and display the X.  

[View Project Using JavaScript to Change Variables]

I did not observe the same issue when using the built-in options of the "trigger builder"; if I made a trigger for each variable to change the value to "False" when the timeline starts it only required a single click.  

[View Project Using Built-in Options to Make Triggers to Change Variables]

I tried using both lowercase "false" and uppercase "False"; both had the same result.  

It seems like Storyline is not treating the "False" values in the JavaScript the same as the "False" values used in the built-in triggers. Has anyone run into a similar issue when using JavaScript to reset variables; do you have any suggestions to resolve the issue?

Robert Auchenpaugh

I was just looking for a way to reset all variables, as I have a set of courses where the user has the option before taking the quiz of starting the module over.  I have chosen "revert to initial state" but really need to reset all the variables... or have the option to choose which variables to reset or not reset would be even better.

Any progress made on this request in the past few months? 

Alain Quilliam

I also support this request, as we create various games where we'd like learners to restart without exiting/relaunching the content on the LMS, and hopefully without having to manually reset tons of variables at the end. In addition, we often have slides with "Resume saved state" ticked...but these would need to be reset once learners reach the end. I don't know if some kind of trigger could exist for this as well. Reset all variables + Reset all slides! 

Math Notermans

i use 2 solutions to tackle this.

1) when setting a variable, also add it to an array. So when resetting i loop the array an set all to false, null, blank or 0.

2) name all variables as v_str_somename , v_num_ or v_bool_.. now you can loop all vars and reset them depending on string, number or boolean.

Glenda DeHoff

I am looking for a solution to reset all of my variables as well. I read on another thread that due to the differences in how Storyline and JavaScript deal with Boolean variables ( JS returns a string), a Javascript solution would not work to reset these variables. Did I misread the other thread?

Math Notermans

Although there indeed is a difference in Booleans between Storyline and Javascript. SL writes and reads them as False, whereas in JS you write/read them as false. This is no problem however when writing a Boolean variable.

This is a line of code i have in most of my Storylines.
player.SetVar("javascriptsLoaded", true);
When my external JS libraries are loaded ( jQuery eg. ) it sets the Boolean variable javascriptLoaded to true ( In Storyline its shown as True ). This works perfectly.

Math Notermans

2nd Day of presentations on the Articulate Usersdays overhere done. One trick i learned was some nice script ( i guess its from somewhere on the forum too... Zsolts i presume ) that shows all available variables in a popup. I guess i can rework that perfectly to reset all variables.
On my TODO list ;-)

Theodore Stefaniw

I would be very interested in this as well. I have several numeric entry variables in some courses that I would like to reset. I have a "Try again" button that returns the user to the beginning of a section, not the beginning of the course and the numeric entry field holds on to what initially was typed in. Of course I can change the variable  to say "0" when the user leaves the slide but then they have to type over the 0 which is not what they would actually need to do. It would be nice if you could  set the numericEntry variable to blank, but you have to type in a number

Robert Auchenpaugh

Hi: 

Looking to see an update on this.  I was just reworking a section of a course where the user can go back and try again and had to write 50+ triggers to reset variables. In this particular case I needed most variables reset, but not every one.... quite tedious.   Even if it we had an "all or none" solution, I could have much more easily had it reset them all and then revert the ones that didn't need to be reset back to the current value.

Thanks!