Forum Discussion
Reset multiple variables to default values
GREAT thread! I have incorporated JavaScript to reset a large number of variables, and it's working great. The PROBLEM is that, after all variables are reset to a value of FALSE (after one particular value having been true), it appears as though a user going through the course subsequent times, triggering Variable 2 to be "true" on the second go-round, that the variable 2 is NOT marked true by the same trigger that successfully made Variable 1 "true" the first time through the course. In other words:
1) Initial course run through, Variable 1 triggered from "False" (default) to "True"
2) Element later in course successfully recognizes Variable 1 as "True" and behaves properly!
3) User clicks "return to menu", which executes JavaScript to reset all variables to "False" (regardless of which variable the user clicks).
4) User runs through course a second time and Variable 2 is triggered from "False" (default and result of JavaScript execution during Course Round 1) to "True".
5) But when user gets to element later in course (as in 2) above), the variable is NOT recognized as true. In fact, ALL variables are false, regardless of which variable was set to True earlier.
What did I do wrong? Is there some software issue of which I am not aware? I DID test this in a live LMS Environment (not just on course preview mode in Storyline 2).
Thank you for any help! I have to launch this course in 2 days, and this is my last little (?) glitch! The other elements of the course are working beautifully!
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago