Routing for Feedback End Of Day

FLDate := getDiaryDate()
Fill code of question 'FLToday' executed
day_cnt := 1
sectioncount1 := 1
sectioncount2 := 2
sectioncount3 := 3
startdate := date("Y-m-d")
diary_date[day_cnt] := startdate
acc_intro
To help us compare your daily activities to information collected by the activity watch, this survey asks about your sleeping patterns, any form of cycling activity (e.g. riding a bicycle, using a stationary bike) and any time you may have removed the activity watch for more than 10 minutes. Please fill it out as completely as you can.
d001_bed (time go to bed)
What time did you GO TO BED last night? To select a time, click on the textbox. Use the up and down arrows to select the time you wish to report. If you wish to switch from AM to PM, just click on the blue AM button. To switch back to AM, just click the blue PM button. You can also type the time directly into the textbox.
if d001_start[day_cnt] = empty then
d001_start[day_cnt] := d001_bed[day_cnt]
End of if
d001_start (time start sleep)
What time did you first FALL ASLEEP last night?
if (strtotime("2019-02-02 " . d001_bed[day_cnt]) > strtotime("2019-02-02 " . d001_start[day_cnt])) then
d001_warning1
You said you fell asleep at [time start sleep[]] before you went to bed at [time go to bed[]]. If this is not correct, please go back and enter the correct times.
End of if
d001_end (time end sleep)
What time did you WAKE UP today (eyes open, ready to get up)?
if d001_out[day_cnt] = empty then
d001_out[day_cnt] := d001_end[day_cnt]
End of if
d001_out (time out of bed)
What time did you actually GET OUT OF BED today?
if (strtotime("2019-02-02 " . d001_out[day_cnt]) < strtotime("2019-02-02 " . d001_end[day_cnt])) then
d001_warning2
You said you woke up at [time end sleep[]] after you got out of bed at [time out of bed[]]. If this is not correct, please go back and enter the correct times.
End of if
d001_awake (awake at night)
After you went to sleep last night at [time start sleep[]], did you ever wake up in the night and stay awake for more than about 15 minutes, then go back to sleep? (Do not count when you woke up and stayed awake at [time end sleep[]])
1 Yes
2 No
if d001_awake[day_cnt] = 1 then
Group of questions presented on the same screen
d001_awake_intro (intro)

Waking up

Please indicate up to four times that you woke up and stayed awake for more than 15 minutes between [time start sleep[]] and [time end sleep[]]. Write in the times you woke up and the times you went back to sleep again. If you aren’t sure what time you woke up or what time you went back to sleep, you can just give us an approximate length of time that you were awake
Loop from 1 to 4
d001_whenawake (when awake at night)
Time woke up
d001_whenback (when back at sleep at night)
Time back to sleep
d001_whendk (dont know when back at sleep at night)
If you aren’t sure about times, please indicate approximately how many minutes you were awake
End of loop
End of group of questions
if d001_whenawake[day_cnt,1] = empty AND d001_whenback[day_cnt,1] = empty AND d001_whendk[day_cnt,1] = empty then
d001_awake_warning
Please go back and indicate at least one time at which you woke up.
End of if
End of if
d001_nap (nap during day)
Since you got up this morning at [time out of bed[]], have there been other times you have slept? For instance, you may have taken a nap or fallen asleep while watching television.
1 Yes
2 No
if d001_nap[day_cnt,cnt] = 1 then
Group of questions presented on the same screen
d001_nap_intro (intro)

Sleep During The Day

Please indicate up to four times that you slept today after [time end sleep[]]. Write in the times you fell asleep and the times you woke up again. If you aren’t sure what time you woke up or what time you went back to sleep, just write in the approximate number of minutes that you were asleep.
Loop from 1 to 4
d001_whennap (when nap during day)
Time fell asleep
d001_whenupagain (when up after nape)
Time woke up again
d001_whenupagaindk (dont know when up after nape)
If you aren’t sure about times, please indicate approximately how many minutes you were awake
End of loop
End of group of questions
if d001_whennap[day_cnt,1] = empty AND d001_whenupagain[day_cnt,1] = empty AND d001_whenupagaindk[day_cnt,1] = empty then
d001_nap_warning
Please go back and indicate at least one time at which you slept.
End of if
End of if
Group of questions presented on the same screen
d001_intro (intro)
d002_intro (intro)
Cycling

If you cycled today, please report times when you cycled for more than 10 minutes, indoors or outdoors.
Loop from 1 to 4
d002_start (time started cycling)
Time you started cycling
d002_end (time you stopped cycling)
Time you stopped cycling
End of loop
d003_intro (intro)
Removing the Activity Tracker watch

If you took off the activity tracker watch today, please report times when you took it off for more than 10 minutes and when you put it back on again.
Loop from 1 to 4
d003_start (time started took off)
Time you took it off:
d003_end (time back on)
Time you put it back on:
End of loop
d003_more (more than 4 times taken off)
1 Please tick the box if this happened more than four times today.
End of group of questions
d004 (any problems)
Did you have any problems with wearing the activity tracker watch today? Please let us know if anything bothered you, or if you forgot to wear it, if you dropped it, if the battery ran out, or anything else that may have happened.
STRING
CS_001 (HOW PLEASANT INTERVIEW)
Could you tell us how interesting or uninteresting you found the questions in this interview?
1 Very interesting
2 Interesting
3 Neither interesting nor uninteresting
4 Uninteresting
5 Very uninteresting
CS_003 (comments)
Do you have any other comments on the interview? Please type these in the box below.(If you have no comments, please click next to complete this survey.)
STRING