How to use saved information about users: Difference between revisions

From Lifeguide Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:


You can use saved information in many ways:
- to display the responses end-users gave to an interaction. This would be displayed as text.
- to display the original page so end-users can see how they responded to an interaction and then change their answer
- to provide feedback based on their responses
- to calculate a score for a quiz
To save responses, the commands <code>save, saveandload</code> and <code>savevalue</code> are used:


== <code> save </code> ==
== <code> save </code> ==


The <code> save </code> key command allows you to save the responses that an end-user enters on a page. This can then be loaded using the <code> load </code> key command onto another page to re-show it to your end-user. The save and load commands can be used across sessions and requires end-users to have registered a user account.  
The <code> save </code> command allows you to save the responses that an end-user enters on a page. This can then be loaded onto another page using the <code> load </code> command to re-show it to your end-user. The save and load commands can be used across sessions and requires end-users to have registered a user account.  


Example:
Example:
Line 29: Line 18:


So, in the first part of this logic page1 is saved for the end-user. Then when they get to page20 in the intervention the response that they entered on interaction1 on page1 will be reshown to them on interaction2 on page20.
So, in the first part of this logic page1 is saved for the end-user. Then when they get to page20 in the intervention the response that they entered on interaction1 on page1 will be reshown to them on interaction2 on page20.




== <code> saveandload </code> ==
== <code> saveandload </code> ==


This key command can be used after a page that includes interactions so that if an end-user moves away from that page and then comes back to it, the page will automatically show them what they entered the last time they were on that page. This line of logic would simply be written as so:
This command can be used after a page that includes interactions so that if an end-user moves away from that page and then comes back to it, the page will automatically show them what they entered the last time they were on that page. This line of logic would simply be written as:


<code> show page1</code>
<code> show page1</code>

Latest revision as of 16:28, 15 May 2015


save

The save command allows you to save the responses that an end-user enters on a page. This can then be loaded onto another page using the load command to re-show it to your end-user. The save and load commands can be used across sessions and requires end-users to have registered a user account.

Example:

show page1

save page1 for username

Then, later on in the logic (either in the same session or a later session) the following logic would be used:

show page20

set default page20.interaction2 to load page1.interaction1 for username

So, in the first part of this logic page1 is saved for the end-user. Then when they get to page20 in the intervention the response that they entered on interaction1 on page1 will be reshown to them on interaction2 on page20.


saveandload

This command can be used after a page that includes interactions so that if an end-user moves away from that page and then comes back to it, the page will automatically show them what they entered the last time they were on that page. This line of logic would simply be written as:

show page1

saveandload page1 for username

Any interaction on page1 would then be saved and loaded each time the end-user comes back to that page.