action to reset all variables

build learning interactivity

Moderator: Nav

action to reset all variables

Postby amg1405 » Mon Oct 29, 2012 7:16 pm

I'm creating a learning planning tool that learners can use over and over again to plan their development for the year. In order to allow re-use instead of them having to re-enrol, I would like to put a button at the end that 'wipes' all variable values and returns them to their original state.

How would I create the action?
amg1405
 
Posts: 5
Joined: Mon Jan 30, 2012 2:34 pm

Re: action to reset all variables

Postby Nav » Tue Oct 30, 2012 12:08 pm

Hi.
Do you already have functionality in place to store all their variables somehow? By default, the Global Variables only exist during that session, and it requires some extra steps to store them into the LMS, in a Cookie, or to a database. If you're not already persisting the data somehow, you don't need to do anything different. The next time they open the lesson, the Global Variables will be forgotten.

If you are storing the data somehow (perhaps so they can leave in the middle and come back), you would have to create an action to reset the variables. There isn't a "resetAllVariablesToInitialValue" method, so you'll have to do them one at a time.

Trigger: reset button > onClick
Response: Global Variables > Number > First Variable > setValue "0"
Response: Global Variables > Number > Second Variable > setValue "0"
Response: Global Variables > Text > Third Variable > setValue [blank]
Response: Global Variables > True False> Fourth Variable > setValue [false]
...etc

Hope that helps!

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: action to reset all variables

Postby amg1405 » Sun Nov 04, 2012 9:01 pm

Thanks Nav, I thought this might have been how to do it but was hoping there was a special action for it :P

Anne-Marijke
amg1405
 
Posts: 5
Joined: Mon Jan 30, 2012 2:34 pm


Return to Action/Flow Chart/Variable

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Not able to open ./cache/data_global.php