How to save information about users: Difference between revisions

From Lifeguide Wiki
Jump to navigation Jump to search
(Created page with "== <code> savevalue </code> == The savevalue command allows you to save a variable for a username that can then be loaded again in later sessions.")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== <code> savevalue </code> ==
== <code> savevalue </code> ==


The savevalue command allows you to save a variable for a username that can then be loaded again in later sessions.
The savevalue command allows you to save a variable for a user that can then be loaded again in later sessions.
 
You can use it to save the group that users have been randomised to:
 
<code>savevalue(username, "group", "web") </code>
 
You can use it to save the time users have seen a particular page:
 
<code>savevalue(username, "s1time", currenttime())</code>
 
You can use it to save the response that they have given to a single or multiple-choice interaction:
 
<code>savevalue(username, "fatigue", page1.interaction1)</code>
 
N.B. You must use a '''Next''' type button on the page that you are saving information from when you use <code>savevalue</code>. If you use a '''Jump''' button, the logic referring to <code>savevalue</code> will not be read and so the variable will not save.

Latest revision as of 10:35, 25 March 2014

savevalue

The savevalue command allows you to save a variable for a user that can then be loaded again in later sessions.

You can use it to save the group that users have been randomised to:

savevalue(username, "group", "web")

You can use it to save the time users have seen a particular page:

savevalue(username, "s1time", currenttime())

You can use it to save the response that they have given to a single or multiple-choice interaction:

savevalue(username, "fatigue", page1.interaction1)

N.B. You must use a Next type button on the page that you are saving information from when you use savevalue. If you use a Jump button, the logic referring to savevalue will not be read and so the variable will not save.