How to make sure that users see the right page when they log back into the intervention

From Lifeguide Wiki
Jump to: navigation, search

You can use a combination of hasseen, comparetimes, isempty to show users specific pages when they log back in.

Example 1

after login2 if (and(... comparetimes(loadvalue(username,"baselinetime"), currenttime(),"seconds") >= fourweeks,... isempty(loadvalue(username,"followup_done"))... hasseen(username,"page10") )) goto followup

You can write the time in seconds (604800) in place of fourweeks in the logic above, but writing it as fourweeks means that you can change the times more easily when you test your intervention.

The logic above will show the page followup if all of the following are true/have happened:

- It has been more than ten weeks since baselinetime was saved

- The variable followup_done has not been saved (i.e. the variable followup_done is empty because the follow-up has not been completed)

- page10 has been seen by the user

In order for the above logic to work, the following should have been written in the logic in the appropriate places:

- baselinetime should be saved when the last page of the baseline questions is shown to the user, e.g.: savevalue(username,"baseline_time", currenttime() )

- fourweeks should have been set at the top of the logic file, e.g.:

set tenweeks to 604800

- followup_done should be saved when the last page of the follow-up questions was shown to the user, e.g.:

savevalue(username, "followup_done", "yes")