How to record whether or not a user has completed a particular section of the intervention (e.g. a questionnaire): Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<code>savevalue</code> can be used to record when users complete a specific part of your intervention. For example, you may want to record whether users have completed the baseline questionnaire so you know if they can move on to the next part of the intervention. | <code>savevalue</code> can be used to record when users complete a specific part of your intervention. For example, you may want to record whether users have completed the baseline questionnaire so you know if they can move on to the next part of the intervention. | ||
To do this, type the following line in the logic when you want to save the questionnaire as 'complete' (this may be after the last page of the questionnaire or earlier if all of your questions are not mandatory). | To do this, type the following line in the logic when you want to save the questionnaire as 'complete' (this may be after the last page of the questionnaire or earlier if all of your questions are not mandatory). | ||
<code>savevalue(username, "baseline_done", "yes")</code> | <code>savevalue(username, "baseline_done", "yes")</code> | ||
You can then load the variable '''baseline_done''' so that if it has been saved as '''yes''' (i.e. the baseline questionnaire has been finished), users are directed to the session page: | |||
<code>after login if (loadvalue(username,"baseline_done") = "yes" ) goto sessionpage </code> |
Revision as of 12:16, 25 March 2014
savevalue
can be used to record when users complete a specific part of your intervention. For example, you may want to record whether users have completed the baseline questionnaire so you know if they can move on to the next part of the intervention.
To do this, type the following line in the logic when you want to save the questionnaire as 'complete' (this may be after the last page of the questionnaire or earlier if all of your questions are not mandatory).
savevalue(username, "baseline_done", "yes")
You can then load the variable baseline_done so that if it has been saved as yes (i.e. the baseline questionnaire has been finished), users are directed to the session page:
after login if (loadvalue(username,"baseline_done") = "yes" ) goto sessionpage