How to record the time at which users viewed an intervention page or completed a particular section of the intervention: Difference between revisions
Jump to navigation
Jump to search
(Created page with "The logic command <code>currenttime()</code> is used to record the time. ===Example 1=== show session1_page10 savevalue(username, "session1time", currenttime()) show session...") |
|||
Line 3: | Line 3: | ||
===Example 1=== | ===Example 1=== | ||
<code> | |||
show session1_page10 | show session1_page10 | ||
savevalue(username, "session1time", currenttime()) | savevalue(username, "session1time", currenttime()) | ||
show session1_endpage | show session1_endpage | ||
</code> | |||
The above example will save the current time (in seconds) when users click on the next button on page session1_page10. | The above example will save the current time (in seconds) when users click on the next button on page session1_page10. | ||
N.B. If users see '''session1_endpage''' more than once, '''session1time''' will be saved and overwritten each time they see it. If you want to only save the time the first time '''session1_endpage''' is seen, you can add a line of hasseen '''logic'''. | N.B. If users see '''session1_endpage''' more than once, '''session1time''' will be saved and overwritten each time they see it. If you want to only save the time the first time '''session1_endpage''' is seen, you can add a line of hasseen '''logic'''. | ||
<code>savevalue(username, "session1time", currenttime()) if (not(hasseen (username, "session1_endpage")))</code> | <code>savevalue(username, "session1time", currenttime()) if (not(hasseen (username, "session1_endpage")))</code> | ||
This logic will only save '''session1time''' if the page '''session1_endpage''' has not been seen by that user before. | This logic will only save '''session1time''' if the page '''session1_endpage''' has not been seen by that user before. |
Revision as of 17:03, 25 March 2014
The logic command currenttime()
is used to record the time.
Example 1
show session1_page10
savevalue(username, "session1time", currenttime())
show session1_endpage
The above example will save the current time (in seconds) when users click on the next button on page session1_page10.
N.B. If users see session1_endpage more than once, session1time will be saved and overwritten each time they see it. If you want to only save the time the first time session1_endpage is seen, you can add a line of hasseen logic.
savevalue(username, "session1time", currenttime()) if (not(hasseen (username, "session1_endpage")))
This logic will only save session1time if the page session1_endpage has not been seen by that user before.