Routing for End Of Day

FLDate := getDiaryDate()
Fill code of question 'FLToday' executed
ED000 (survey intro)
This survey asks about your activities, moods and interactions. For each of the questions, pick the answer that most closely resembles the experiences you had [Monday, /Tuesday, /Wednesday, /Thursday, /Friday, /Saturday, /Sunday, /today, ][date of diary measurement day[]].
ED001 (Mood - Happy)
Please move the slider to represent how happy you felt today, on a scale from not at all to extremely.
ED002 (Mood - Frustrated)
Please move the slider to represent how frustrated you felt today, on a scale from not at all to extremely.
ED003 (Mood - Cheerful)
Please move the slider to represent how cheerful you felt today, on a scale from not at all to extremely.
ED004 (Mood - Dejected)
Please move the slider to represent how dejected / blue / downhearted you felt today, on a scale from not at all to extremely.
ED005 (Mood - Lonely)
Please move the slider to represent how lonely you felt today, on a scale from not at all to extremely.
ED006 (Mood - Relaxed)
Please move the slider to represent how relaxed you felt today, on a scale from not at all to extremely.
ED007 (Mood - Stressed)
Please move the slider to represent how stressed you felt today, on a scale from not at all to extremely.
ED008 (Mood - Angry)
Please move the slider to represent how angry you felt today, on a scale from not at all to extremely.
ED009 (Pain – average Intensity)
Please move the slider to represent your average level of bodily pain today on a scale from no pain at all to extreme pain.
ED010 (Fatigue - Fatigue)
Please move the slider to represent how fatigued (i.e. weary or tired) you were today, on a scale from no fatigue at all to extreme fatigue.
ED013_2 (Physical Activity)
Did you do a total of 30 minutes or more of physical activity which was enough to raise your breathing rate, today? Include sports, exercise, brisk walking, cycling for recreation or to get to and from places, house or yard work, physical activity that may be part of your job, or any other physical activities.
1 Yes
2 No
ED015 (Stressful Event)
Did anything stressful occur today? A stressful event is any event, even a minor one, that negatively affected you.
1 Yes
2 No
ED016 (who interact with)
With whom did you interact today and how? Check all that apply.
1 With your spouse or partner, in person
2 With your spouse or partner, through email, online, or phone
3 With your children, in person
4 With your children, through email, online, or phone
5 With other family, in person
6 With other family, through email, online, or phone
7 With close friends, in person
8 With close friends, through email, online, or phone
9 With other people, in person
10 With other people, through email, online, or phone
11 No interactions today
if 1 in ED016 OR 2 in ED016 OR 3 in ED016 OR 4 in ED016 OR 5 in ED016 OR 6 in ED016 OR 7 in ED016 OR 8 in ED016 then
ED017 (Argument with spouse)
Have you had an argument with someone close to you today? Check all that apply.
1 Yes, spouse
2 Yes, close friend or family member
3 No
End of if
ED018 (Economic Strain)
Did you worry about money today?
1 Yes
2 No
ED019 (Financial Wellbeing)
Did you have enough money to do everything you wanted to do today?
1 Yes
2 No
ED020 (Purposefulness)
Did you feel useful or productive today?
1 Yes
2 No
ED022 (Diet: Eating well)
Did you eat well today?
1 Yes
2 No
ED023 (Diet: Skipping meal)
Did you skip any meal(s) today?
1 Yes
2 No
IF ED023 = 1 THEN
Group of questions presented on the same screen
ED023b (Diet: Skipped meal)
Which meal(s) did you skip? Please check all that apply
1 Breakfast
2 Lunch
3 Dinner
4 Other (specify)
ED023b_other (Diet: Skipped meal)
Which meal(s) did you skip? Please check all that apply
STRING
End of group of questions
End of if
ED024 (Physical health)
How was your health today?
1 Excellent
2 Very good
3 Good
4 Fair
5 Poor
ED025 (Sleep/resting quality: Rest)
Did you feel well-rested when starting the day today?
1 Yes
2 No
ED026 (Sleep/resting quality: Difficulty )
Please indicate to what extent you agree or disagree with the following statement:

I had trouble sleeping last night.
1 Strongly disagree
2 Somewhat disagree
3 Neither agree nor disagree
4 Somewhat agree
5 Strongly agree
ED027 (Sleep/resting quality; Day-Time Sleepiness )
Please indicate to what extent you agree or disagree with the following statement:

I got drowsy today during times when sleeping was not allowed.
1 Strongly disagree
2 Somewhat disagree
3 Neither agree nor disagree
4 Somewhat agree
5 Strongly agree
if 1 in ED016 OR 2 in ED016 OR 3 in ED016 OR 4 in ED016 OR 5 in ED016 OR 6 in ED016 OR 7 in ED016 OR 8 in ED016 then
Group of questions presented on the same screen
ED028 (Family Interaction: Conversation)
How many hours and minutes did you interact with family members, or people you are close to, today?

ED028_hours (Chatting- hours)
RANGE 0..24
ED028_minutes (Chatting- minutes)
RANGE 0..60
End of group of questions
End of if
if 1 in ED016 OR 3 in ED016 OR 5 in ED016 OR 7 in ED016 then
if not(1 in ED023b) then
ED029 (Family Interaction:Mealtime Interaction)
Did you eat breakfast with family members, or people you are close to, today?
1 I ate breakfast alone
2 I ate breakfast with family members
3 I ate breakfast with people I am close to
4 I ate breakfast with non-family or people I am not close to
5 I did not eat breakfast
End of if
if not(3 in ED023b) then
ED029b (Family Interaction:Mealtime Interaction)
Did you eat dinner with family members, or people you are close to, today?
1 I ate dinner alone
2 I ate dinner with family members
3 I ate dinner with people I am close to
4 I ate dinner with non-family or people I am not close to
5 I did not eat dinner
End of if
End of if
if 1 in ED016 OR 2 in ED016 OR 3 in ED016 OR 4 in ED016 OR 5 in ED016 OR 6 in ED016 then
ED030 (how functioned in family or relationship)
I am pleased with the way I functioned in my family or close relationships today. Please move the slider to represent how pleased you are, on a scale from not at all pleased to very pleased.
End of if
if 1 in ED016 OR 2 in ED016 OR 3 in ED016 OR 4 in ED016 OR 5 in ED016 OR 6 in ED016 OR 7 in ED016 OR 8 in ED016 then
ED031 (Social interaction: Enjoyed interaction)
My social interactions were satisfying to me today. Please move the slider to represent how satisfied you were, on a scale from not at all to very much.
End of if
ED032 (Social interaction: Support Satisfaction)
I am satisfied with the social support I received today. Please move the slider to represent how satisfied you are, on a scale from not at all satisfied to very satisfied.
ED033 (Social interaction: Felt connected)
I felt connected to my family/social network today. Please move the slider to represent how connected you felt, on a scale from not at all to very much.
ED034 (Job/Household satisfaction)
I am pleased with the way I functioned in my work (or in your household if you don’t work) today. Please move the slider to represent how pleased you are, on a scale from not at all pleased to very pleased.
ED032_rev (Time pressure: )
Did you have enough time today to do what you wanted to do?
1 Yes
2 No
ED035 (prompted exactly six times)
The next questions ask about your experiences with using the UAS phone app today.
Were you prompted by the UAS phone app to answer questions exactly six times today?
1 Yes
2 No
3 Not sure
if ED035 = 2 OR ED035 = 3 then
ED036 (how many prompts gotten)
How many prompts did you get? If you are not sure, please give your best guess.
0 None
1 One
2 Two
3 Three
4 Four
5 Five
6 Seven or more
End of if
if ED035 = 1 OR ((ED035 = 2 OR ED035 = 3) AND (ED036 = 1 OR ED036 = 2 OR ED036 = 3 OR ED036 = 4 OR ED036 = 5 OR ED036 = 6)) then
ED037 (able to use app every prompt)
Were you able to use the app to fill out the questions every time you got a prompt to do so today?
1 Yes
2 No
if ED037 = 2 then
ED038 (why not able to respond to all prompts)
Please tell us briefly why you were not able to respond to all of the prompts you got today.
STRING
End of if
End of if
ED039 (any other comments about UAS app)
Did you have any other comments about using the UAS app or answering these survey questions today?
STRING
rec_intro

Please read carefully then follow each step on the next pages.

For the final activity, we would like to learn more about the social contacts that you had with other people today, if any, and how you felt during these social encounters.

We will ask you to first listen to, or read, an example of the kind of information we would like you to provide. Then you will use the UAS cell phone app to verbally tell us about how you spent your day.

We would like to hear if you spent the day alone, or if you interacted with anyone, and how you felt during those interactions. You can tell us about any people you spoke to or spent time with today and how your mood was when you interacted with them. When you are done recording on your phone, you will come back here, let us know that you finished the recording, and finish this survey.
rec001 (listen or read)

Before you begin...If your cell phone with the downloaded UAS app is not nearby, please get it, as you will need to use the app in this section.


Step 1: Listen to or read an example

Would you prefer to listen to, or read, the example?
1 Listen
2 Read
if rec001 = 1 then
rec_sound
Please turn on (or turn up) the volume on your speaker, or plug in a headphone.
rec002 (describes day)
Which of these describes your day?
1 I interacted with people today
2 I did not interact with people today
if rec002 = 1 then
sample2_sound
1 If you are having trouble hearing this recording, check this box to read the transcript instead .
if sample2_sound = 1 then
sample2_text

Example – Please read the example, then tell us in your own words about your social interactions today and how you felt during them.


Here’s a summary of my social interactions today. None! I didn’t really interact with anyone because I have a cold and just sent some emails and didn’t really want to talk. When I woke up this morning, I didn’t feel well and I was kind of sad because I miss my boyfriend who’s out of town. I decided to take a sick day and stay home to rest and sleep so I don’t get anyone else sick. One of my closest friends called me to check in on me because we were supposed to do something tonight but I cancelled because I didn’t really feel up for going out. I just stayed in today. That was that!
End of if
Else
sample1_sound
1 If you are having trouble hearing this recording, check this box to read the transcript instead .
if sample1_sound = 1 then
sample1_text

Example – Please read the example, then tell us in your own words about your social interactions today and how you felt during them.


Here’s a summary of my social interactions today. When I got up this morning, I had breakfast with my family-the two kids and my husband. This is a typical day for us, we have breakfast together and then the kids go to school and the adults go to work.

Today was a little hectic because I had a work meeting and felt kind of stressed during breakfast. But my kids always make me laugh so we still had a nice breakfast. On my way to work, I called my sister because we are planning a birthday party for my uncle. The phone call annoyed me because everyone wants to organize the birthday party their own way and we went back and forth a little bit with the details for the party. Then, I had my meeting at work with my boss, which went well and I was really happy about it. I was nervous before the meeting because it was about an important project that my co-workers and I worked on, and my boss can be really demanding but he was very impressed with our work and I felt really happy that he liked our project. Then during lunch, one of my friends from the gym met me at a local cafe and it was nice and relaxing to do something outside of work. She’s great. In the afternoon, my sister called me again about the birthday party and I couldn’t really talk because I was at work, and was busy, so she got upset with me and I got annoyed but then calmed down again. The rest of the day was uneventful. For dinner, my husband and I met at our favorite Italian restaurant because the kids are at a sleepover tonight so we got a date night, and a movie too. It was fun to spend time with him alone and I feel happy now. So those are my social interactions today! Thanks!
End of if
End of if
Else
rec002 (describes day)
Which of these describes your day?
1 I interacted with people today
2 I did not interact with people today
if rec002 = 1 then
sample1_text

Example – Please read the example, then tell us in your own words about your social interactions today and how you felt during them.


Here’s a summary of my social interactions today. When I got up this morning, I had breakfast with my family-the two kids and my husband. This is a typical day for us, we have breakfast together and then the kids go to school and the adults go to work.

Today was a little hectic because I had a work meeting and felt kind of stressed during breakfast. But my kids always make me laugh so we still had a nice breakfast. On my way to work, I called my sister because we are planning a birthday party for my uncle. The phone call annoyed me because everyone wants to organize the birthday party their own way and we went back and forth a little bit with the details for the party. Then, I had my meeting at work with my boss, which went well and I was really happy about it. I was nervous before the meeting because it was about an important project that my co-workers and I worked on, and my boss can be really demanding but he was very impressed with our work and I felt really happy that he liked our project. Then during lunch, one of my friends from the gym met me at a local cafe and it was nice and relaxing to do something outside of work. She’s great. In the afternoon, my sister called me again about the birthday party and I couldn’t really talk because I was at work, and was busy, so she got upset with me and I got annoyed but then calmed down again. The rest of the day was uneventful. For dinner, my husband and I met at our favorite Italian restaurant because the kids are at a sleepover tonight so we got a date night, and a movie too. It was fun to spend time with him alone and I feel happy now. So those are my social interactions today! Thanks!
Else
sample2_text

Example – Please read the example, then tell us in your own words about your social interactions today and how you felt during them.


Here’s a summary of my social interactions today. None! I didn’t really interact with anyone because I have a cold and just sent some emails and didn’t really want to talk. When I woke up this morning, I didn’t feel well and I was kind of sad because I miss my boyfriend who’s out of town. I decided to take a sick day and stay home to rest and sleep so I don’t get anyone else sick. One of my closest friends called me to check in on me because we were supposed to do something tonight but I cancelled because I didn’t really feel up for going out. I just stayed in today. That was that!
End of if
End of if
rec_rec

Step 2: Record a short description of your day using the UAS app.

We would like you to spend 2-5 minutes telling us about your day. We are especially interested in hearing if you interacted with other people today, and if you did, how you felt during those interactions. You do not have to write it up in advance, but can simply talk about what you did today, starting from if you had breakfast alone or with anyone, all the way through to your evening activities with or without other people. Here is how to do it:
  • Leave this page open - don’t close it. After recording, you will come back here to finish the survey.
  • Open the UAS EMA app on your phone.
  • Tap on the 3 dots in the upper right corner to pull down the menu.
  • Tap on "Sound Recording".
  • If you see a screen that says "UAS would like to access the microphone" tap "OK" to continue
  • When you are ready, tap on the microphone. It will turn into a red button. Start talking, and tell us about your day.
  • When you are done recording, tap on the red button and it will turn into a green check mark.
  • If you would like to listen to your recording, you can play it back by tapping the "play" button.
  • If you would like to re-record, click on the green check mark to begin again (your previous recording will be deleted).
  • When you are done, and can see the green check mark:
  • Tap the "upload" button.
  • When it has finished uploading, tap the "<" symbol in the upper left corner to return to the app.
  • Come back here to finish taking the survey.

Step 3. After you are done recording on your phone and have uploaded the recording by tapping the “upload” button, click the "Finished Recording" button below on this screen..

rec_003 (any trouble recording)
Thank you for the recording! Did you have any trouble making the recording today?
1 Yes - difficulty using the phone app
2 Yes - difficulty knowing what to say
3 Yes - something else – please describe briefly, below
4 No
if rec_003 in [1,2,3] then
rec_004 (how improve recording)
To help us understand how we can improve, we would appreciate it if you could please briefly describe the problem you had with recording today. If you have already provided this feedback, you can just press enter to continue.
STRING
End of if
day_cnt := 1
sectioncount1 := 1
sectioncount2 := 2
sectioncount3 := 3
startdate := date("Y-m-d")
diary_date[day_cnt] := startdate
acc_intro

Thank you. We have a few more questions.

The next questions are about your use of the GeneActive watch, so you can inform us about your sleeping pattern, any form of cycling activity (e.g. riding a bicycle, using a stationary bike) and any time you may have removed the watch for more than 10 minutes.

You can access instructions by clicking on the 'Review instructions' link in the top right of the next page. If you have further questions, please call us at 855.872.8673 or email the help desk (uashelp@usc.edu). If you have questions about the device, check our frequently asked questions here. Click next when you are ready to start.
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 At Night

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 GeneActiv watch

If you took off the activity tracker watch today, please report times when you took it off for more than 10 minutes.
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
doDRM := getDRM()
if doDRM = 1 then
RN001 (day reconstruction intro)
We are going to ask you to tell us about yesterday. Think of yesterday as a series of scenes or episodes in a movie. You can decide how long each scene is. Most people choose episodes that last between 15 minutes and two hours, but they can also be shorter or longer. A new episode begins when you start doing something else or something happened that changed your mood. Sequences of short routine activities like showering or dressing are best grouped as a single episode. Choose the episodes in ways that make most sense to you.

Starting on the next screen, we will ask you to describe the episodes of your day yesterday. You will see that you can label each episode in a way that makes most sense to you (e.g. "work, main job", or "playing sports").
starttime := getTimeNearestHalfHour(date('U'))
FLStartTime[1] := starttime
Group of questions presented on the same screen
startingDRM (start time for DRM)
What time did you wake up yesterday?

Time:
[start time for the DRM[]]
endingDRM (how long awake)
How many hours were you awake once you woke up?
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 More than 24 hours
endingDRM_extra
If you were awake for more than 24 hours, enter episodes for the first 24 hours you were awake.
End of group of questions
maxpassed := endingDRM
if endingDRM = empty OR endingDRM = 25 then
maxpassed := 24
End of if
maxpassed_original := maxpassed
FLStartTime[1] := startingDRM
RN003[1] := startingDRM
NumberOfEpisodes := 0
timepassed := 0
Loop from 1 to 50
addlastone[RNCnt] := empty
RN004[RNCnt] := getHalfHourPastGivenTime(RN003[RNCnt])
Fill code of question 'FLTimeline' executed
IF RNCnt = 1 THEN
Group of questions presented on the same screen
RN002 (day reconstruction label)
Please think about the first episode after you woke up yesterday. What did you do? Please enter a label for this episode below that best describes what you did. In addition, please select the time when the episode ended from the time scale below.

When you are finished choosing a label and end time for yesterday’s first episode click “NEXT”.

Don’t worry about making mistakes, you will be able to make changes after you have entered ALL of the episodes of yesterday’s day! Also, should you want to you can start from scratch by checking the 'I wish to restart' checkbox at the bottom of the screen.

Episode label:
RN004 (episode end)
When did this episode start and end?

Start time:
[episode start[]]

End time:
restart (indicates restart)


1   I wish to restart (NOTE: this will clear any episode(s) you listed so far)
End of group of questions
if restart[RNCnt] = 1 then
restartfinal
If you are 100% sure you want to restart and lose any episodes you entered so far, please click Next to continue. Otherwise please go back.
dummy := resetCalendar()
restart[RNCnt] := empty
restartfinal[RNCnt] := empty
End of if
IF RN002[RNCnt] = EMPTY THEN
errorNoLabel (Error entered no label)
You did not enter a label. Please go back and enter a label.
End of if
Else
Group of questions presented on the same screen
RN002 (day reconstruction label)
Please think about the first episode after you woke up yesterday. What did you do? Please enter a label for this episode below that best describes what you did. In addition, please select the time when the episode ended from the time scale below.

When you are finished choosing a label and end time for yesterday’s first episode click “NEXT”.

Don’t worry about making mistakes, you will be able to make changes after you have entered ALL of the episodes of yesterday’s day! Also, should you want to you can start from scratch by checking the 'I wish to restart' checkbox at the bottom of the screen.

Episode label:
RN006 (recall any other episodes intro)
Please select a label for an episode and the time it began and ended, and then choose 'NEXT'. If you have entered something that you later want to change, you will be able to make changes after you have finished entering new episodes. Once you are done entering new episodes, please choose 'This is the last episode 'NEXT'. You will then move on to a review screen where you will be able to make changes to earlier episodes, if you wish.

Don’t worry about making mistakes, you will be able to make changes after you have entered ALL of the episodes of yesterday’s day! Also, should you want to you can start from scratch by checking the 'I wish to restart' checkbox at the bottom of the screen.

    

When did this episode start and end?

Start time:
[episode start[]]

End time:


RN005 (recall any other episodes)
1 This is the last episode
RN004 (episode end)
When did this episode start and end?

Start time:
[episode start[]]

End time:
restart (indicates restart)


1   I wish to restart (NOTE: this will clear any episode(s) you listed so far)
End of group of questions
if restart[RNCnt] = 1 then
restartfinal
If you are 100% sure you want to restart and lose any episodes you entered so far, please click Next to continue. Otherwise please go back.
dummy := resetCalendar()
restart[RNCnt] := empty
restartfinal[RNCnt] := empty
End of if
IF 1 IN RN005[RNCnt] AND RN002[RNCnt] != EMPTY THEN
ELSEIF RN005[RNCnt] = EMPTY AND RN002[RNCnt] = EMPTY THEN
errorNoLabel (Error entered no label)
You did not enter a label. Please go back and enter a label.
End of if
End of if
IF not(1 IN RN005[RNCnt]) OR (1 IN RN005[RNCnt] AND RN002[RNCnt] != EMPTY) THEN
diff := 0
if stripos(RN004[RNCnt], "am") AND stripos(RN003[RNCnt], "am") then
if strtotime(RN004[RNCnt]) < strtotime(RN003[RNCnt]) then
diff := (1 + strtotime("11:59:59 pm") - strtotime(RN003[RNCnt])) + (1 + strtotime(RN004[RNCnt]) - strtotime("12:00:01 am"))
Else
diff := (strtotime(RN004[RNCnt]) - strtotime(RN003[RNCnt]))
End of if
elseif stripos(RN004[RNCnt], "pm") AND stripos(RN003[RNCnt], "am") then
diff := (strtotime(RN004[RNCnt]) - strtotime(RN003[RNCnt]))
elseif stripos(RN004[RNCnt], "am") AND stripos(RN003[RNCnt], "pm") then
diff := (1 + strtotime("11:59:59 pm") - strtotime(RN003[RNCnt])) + (1 + strtotime(RN004[RNCnt]) - strtotime("12:00:01 am"))
elseif stripos(RN004[RNCnt], "pm") AND stripos(RN003[RNCnt], "pm") then
if strtotime(RN004[RNCnt]) < strtotime(RN003[RNCnt]) then
diff := (1 + strtotime("11:59:59 pm") - strtotime(RN003[RNCnt])) + (1 + strtotime(RN004[RNCnt]) - strtotime("12:00:01 am"))
Else
diff := (strtotime(RN004[RNCnt]) - strtotime(RN003[RNCnt]))
End of if
End of if
IF diff < 0 THEN
errorTimeBeforeStart (error time entered before start)
The end time of the episode you entered, [episode end[]], is before its start time, [episode start[]]. Please just go back and correct your answers.
ELSEIF diff = 0 THEN
errorZero
The episode you entered is 0 minutes long. If this is correct, please click "Next" to continue. Otherwise please go back to correct your answers.
End of if
if (diff/60/60) > 4 then
Fill code of question 'FLTooLong[RNCnt]' executed
errorEpisodeLong
The episode you entered is [ hours and / minutes] long. If this is correct, please click 'Next' to continue. Otherwise please go back to correct your answers.
End of if
timepassed := timepassed + diff
if 1 IN RN005[RNCnt] then
addlastone[RNCnt] := 1
elseif endingDRM = 25 OR endingDRM_updated = 25 OR endingDRM = empty then
if (24 < timepassed/60/60) then
error24Done
You have entered more than 24 hours of episodes. If you are finished entering episodes, click Next to see your episode summary. Otherwise, go back to correct your answers.
addlastone[RNCnt] := 1
RN005[RNCnt] := 1
End of if
elseif maxpassed < timepassed/60/60 then
temppassed := round(timepassed/60/60, 1)
error24NoMore (error time entered before start)
Including the episode you added the time you spent awake ([[]] hours based on the duration of all the episodes you mentioned) is greater than the time you said you were awake ([maximum duration of drm in number of hours[]] hours). If this is correct, please click Next to continue and you will be able to adjust the time you have been awake. Otherwise, please go back to correct the duration of your last episode.
Group of questions presented on the same screen
endingDRM_updated (updated how long awake)
How many hours were you awake once you woke up?
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 More than 24 hours
endingDRM_extra
If you were awake for more than 24 hours, enter episodes for the first 24 hours you were awake.
End of group of questions
newmaxpassed := endingDRM_updated
if endingDRM_updated = 25 OR endingDRM_updated = empty then
newmaxpassed := 24
End of if
if newmaxpassed < maxpassed then
errorShorterTime
The time you said you were awake ([how long awake updated[]] hours) is shorter than what you said before ([maximum duration of drm in number of hours[]] hours). Please go back and correct your answer.
addlastone[RNCnt] := 1
RN005[RNCnt] := 1
Else
moreepisodes (more to list)
Thank you. We have updated the time you said you were awake since you woke up yesterday.

Do you have any more episodes to list?
1 Yes
2 No, I'm done
if moreepisodes[RNCnt] = 1 then
maxpassed := newmaxpassed
if newmaxpassed = 25 then
maxpassed := 24
End of if
addlastone[RNCnt] := 1
Else
addlastone[RNCnt] := 1
RN005[RNCnt] := 1
End of if
End of if
End of if
End of if
IF 1 IN RN005[RNCnt] THEN
if addlastone[RNCnt] = 1 then
IF RN002[RNCnt] = RESPONSE THEN
RN002_code[RNCnt] := getCode(RN002[RNCnt])
End of if
NumberOfEpisodes := NumberOfEpisodes + 1
FLStartTime[RNCnt + 1] := RN004[RNCnt]
FLPreviousEpisode[RNCnt + 1] := previousEpisode(RN002[RNCnt]) . ' (' . RN003[RNCnt] . ' - ' . RN004[RNCnt] . ')'
RN003[RNCnt + 1] := RN004[RNCnt]
End of if
Else
IF RN002[RNCnt] = RESPONSE THEN
RN002_code[RNCnt] := getCode(RN002[RNCnt])
End of if
NumberOfEpisodes := NumberOfEpisodes + 1
FLStartTime[RNCnt + 1] := RN004[RNCnt]
FLPreviousEpisode[RNCnt + 1] := previousEpisode(RN002[RNCnt]) . ' (' . RN003[RNCnt] . ' - ' . RN004[RNCnt] . ')'
RN003[RNCnt + 1] := RN004[RNCnt]
End of if
End of loop
Group of questions presented on the same screen
RN010 (Overview of episodes)
Please look at your list of yesterday’s episodes below. You can make changes by choosing the episode you want to alter. You can remove an episode by clicking on the x icon to the right of the episode. You can insert a new episode before an existing episode by clicking the up arrow, or after it by clicking the down arrow.

If all episodes are entered correctly, please choose 'NEXT' to continue.
restart_summary (indicates restart)


1   I wish to restart (NOTE: this will clear any episode(s) you listed so far)
End of group of questions
if restart_summary = 1 then
restartfinal_summary
If you are 100% sure you want to restart and lose any episodes you entered so far, please click Next to continue. Otherwise please go back.
dummy := resetCalendar()
End of if
episodeErrors := checkEpisodes()
IF episodeErrors != '' THEN
RN011 (Overview of episodes)
Please look at the problems for the episodes you listed in the blue box below.
[number of errors in episodes - overlap etc[]]
You can make changes and delete episodes by choosing the episode you want to alter below.

If all episodes are entered correctly, please choose 'NEXT' to continue.
End of if
errors := 2
episodeErrors := checkEpisodes()
IF episodeErrors = '' THEN
errors := 1
End of if
IF NumberOfEpisodes > 0 THEN
if TreatmentMoods = empty then
TreatmentMoods := mt_rand(1,3)
End of if
IF TreatmentMoods = 1 THEN
TotalMoods := 3
ELSEIF TreatmentMoods = 2 THEN
TotalMoods := 5
Else
TotalMoods := 10
End of if
Loop from 1 to NUMBEROFEPISODES
Group of questions presented on the same screen
WhereMoods (WHERE WERE YOU)
Where were you?
1 At home
2 At work
3 Somewhere else
WereInteracting (INTERACTING WITH SOMEONE)
Were you interacting with anyone (including on the phone, online, etc)?
1 Yes
2 No
End of group of questions
IF WereInteracting[cntEpisodes] = 1 THEN
WhoInteracting (WHO INTERACTING)
If you were interacting with someone (please check all that apply)
1 spouse/significant other
2 friends
3 co-workers
4 clients/customers/students/patients
5 my children
6 parents/relatives
7 boss
8 other people not listed
End of if
if TreatmentMoods = 1 OR TreatmentMoods = 2 OR TreatmentMoods = 3 then
cntMood := 1
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 2
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 3
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMinOne := cntEpisodes - 1
Fill code of question 'prevEpisode' executed
Group of questions presented on the same screen
gaugeExplanation
[] Please rate each feeling on the scale given. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt.

Gauge_slider
Gauge_slider
Gauge_slider
End of group of questions
IF gauge_slider[cntEpisodes,1] = EMPTY OR gauge_slider[cntEpisodes,2] = EMPTY OR gauge_slider[cntEpisodes,3] = EMPTY THEN
gauge_empty (no answer given gauge)
You did not rate all of your feelings. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt. You can use the minus (-) or plus (+) sign under the gauge to adjust your answer.

Please go back and rate your feelings.
End of if
End of if
if TreatmentMoods = 2 then
cntMood := 4
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 5
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMinOne := cntEpisodes - 1
Fill code of question 'prevEpisode' executed
Group of questions presented on the same screen
gaugeExplanation
[] Please rate each feeling on the scale given. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt.

Gauge_slider
Gauge_slider
End of group of questions
IF gauge_slider[cntEpisodes,4] = EMPTY OR gauge_slider[cntEpisodes,5] = EMPTY THEN
gauge_empty (no answer given gauge)
You did not rate all of your feelings. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt. You can use the minus (-) or plus (+) sign under the gauge to adjust your answer.

Please go back and rate your feelings.
End of if
elseif TreatmentMoods = 3 then
cntMood := 4
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 5
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 6
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMinOne := cntEpisodes - 1
Fill code of question 'prevEpisode' executed
Group of questions presented on the same screen
gaugeExplanation
[] Please rate each feeling on the scale given. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt.

Gauge_slider
Gauge_slider
Gauge_slider
End of group of questions
IF gauge_slider[cntEpisodes,4] = EMPTY OR gauge_slider[cntEpisodes,5] = EMPTY OR gauge_slider[cntEpisodes,6] = EMPTY THEN
gauge_empty (no answer given gauge)
You did not rate all of your feelings. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt. You can use the minus (-) or plus (+) sign under the gauge to adjust your answer.

Please go back and rate your feelings.
End of if
End of if
if TreatmentMoods = 3 then
cntMood := 7
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 8
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMood := 9
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMinOne := cntEpisodes - 1
Fill code of question 'prevEpisode' executed
Group of questions presented on the same screen
gaugeExplanation
[] Please rate each feeling on the scale given. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt.

Gauge_slider
Gauge_slider
Gauge_slider
End of group of questions
IF gauge_slider[cntEpisodes,7] = EMPTY OR gauge_slider[cntEpisodes,8] = EMPTY OR gauge_slider[cntEpisodes,9] = EMPTY THEN
gauge_empty (no answer given gauge)
You did not rate all of your feelings. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt. You can use the minus (-) or plus (+) sign under the gauge to adjust your answer.

Please go back and rate your feelings.
End of if
cntMood := 10
Fill code of question 'FLAdjectiveFeel[cntEpisodes,cntMood]' executed
cntMinOne := cntEpisodes - 1
Fill code of question 'prevEpisode' executed
Group of questions presented on the same screen
gaugeExplanation
[] Please rate each feeling on the scale given. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt.

Gauge_slider
End of group of questions
IF gauge_slider[cntEpisodes,10] = EMPTY THEN
gauge_empty (no answer given gauge)
You did not rate all of your feelings. A rating of 0 means that you did not experience that feeling at all. A rating of 6 means that this feeling was a very important part of this experience. Please select the number between 0 and 6 that best describes how you felt. You can use the minus (-) or plus (+) sign under the gauge to adjust your answer.

Please go back and rate your feelings.
End of if
End of if
End of loop
End of loop
End of if
dummy := setDRMCompleted()
End of if
CS_003 (comments)
Do you have any other comments about this survey, or your experiences with the 7-day study today? Please type these in the box below. (If you have no comments, please click next to complete this survey.)
STRING
cs_end
Thank you for participating in this intensive UAS study today! Keep up the great work tomorrow!