How to re-show information that users have told you: Difference between revisions

From Lifeguide Wiki
Jump to navigation Jump to search
Line 3: Line 3:
=Free-entry text boxes=
=Free-entry text boxes=
First you will need to create a text box on a page and then write the logic to save the goal that end-users enter:
First you will need to create a text box on a page and then write the logic to save the goal that end-users enter:
<code> savevalue(username, "goal1", page1.interaction1) </code>
<code> show page1
 
savevalue(username, "goal1", page1.interaction1) </code>


The logic above is saving interaction1 on page1 as a variable called '''goal1'''
The logic above is saving interaction1 on page1 as a variable called '''goal1'''
Line 20: Line 22:


6) The text in your text box should now have angular brackets (<>) around your variable name
6) The text in your text box should now have angular brackets (<>) around your variable name
7)
show session2_allgoals
              set session_8_allgoals.sad_goal1 to loadvalue(username,"sad")
              set session_8_allgoals.anger_goal1 to loadvalue(username,"anger")
              set session_8_allgoals.anxious_goal1 to loadvalue(username,"anxious")
show session_8_allgoals.sadgoal if (not(isempty (loadvalue(username,"sad"))))
show session_8_allgoals.angergoal if (not(isempty (loadvalue(username,"anger"))))
show session_8_allgoals.anxiousgoal if (not(isempty (loadvalue(username,"anxious"))))

Revision as of 13:39, 5 February 2014

An example of this would be to re-show a goal that an end-user has entered in a previous session so that they can say whether they achieved it.

Free-entry text boxes

First you will need to create a text box on a page and then write the logic to save the goal that end-users enter: show page1

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

The logic above is saving interaction1 on page1 as a variable called goal1

To show the goal on a page in a different session, you will need to set the text as a variable:

1) Click on Text box

2) In the white box under Textbox Properties, delete edit me and enter a unique name (e.g. s1goal)

3) Highlight the unique name you have just entered

4) Click on Set Selected Text As...

5) Select Set as variable

6) The text in your text box should now have angular brackets (<>) around your variable name

7)

show session2_allgoals

             set session_8_allgoals.sad_goal1 to loadvalue(username,"sad")
             set session_8_allgoals.anger_goal1 to loadvalue(username,"anger")
             set session_8_allgoals.anxious_goal1 to loadvalue(username,"anxious")

show session_8_allgoals.sadgoal if (not(isempty (loadvalue(username,"sad")))) show session_8_allgoals.angergoal if (not(isempty (loadvalue(username,"anger")))) show session_8_allgoals.anxiousgoal if (not(isempty (loadvalue(username,"anxious"))))