Control File: Structure
Creating the Control File
The Control File is a text file which prescribes the content and scheduling of a survey or multiple surveys. This file can also include contingent surveys which can be triggered by the research participant during the survey schedule. When imported into the PIEL Survey app, the control file creates a project that can be seen on the app's home screen.
Save the file created in Notepad (Windows) or TextEdit (Mac) by creating a ".survey" extension. In the “Save as type” box, select “All Files”. In the Encoding box, select “UTF-8”.
Some software may try and add a different extension (e.g. TextEdit). Make sure it is saved correctly. If there is a problem, you may need to edit the name in File Explorer or Finder by enabling the display of file suffixes and changing the extension.
Layout
The control file consists of project settings and individual survey settings. The project settings should be at the top of the file followed by the survey settings. Each survey should commence with the keyword "%SURVEY" on a separate line. You can have multiple surveys in one file.
There are some simple syntax rules which must be followed when creating a control file.
- Each command is placed on a new line.
- Keywords are case sensitive. Make sure you use the same upper and lower cases as in these instructions.
- Many commands are optional, often having default values. This will be described in the following text.
- A vertical bar "|" (usually located above the enter key) is used in the Control File to separate its different components. Do not use "|" at the beginning or end of a line. You do not need any spaces before or after this separator.
- Do not use the symbol “%” followed immediately by a letter in the text of questions.
- You can put comment lines in a Control File by inserting # in front of each line. # stops these lines from being read as a command.
- Delete a Control File line by simply removing it or alternately by inserting # in front it. This second option is useful if there are lines that might be needed later. Rather than repeatedly deleting and reinserting lines, simply add or remove # at the front of the line.
Sample Files
Below are some sample Control Files to show some feature of the PIEL Survey.
All of them have test mode enabled to facilitate testing. This should be disabled prior to actually starting the project.
1. Simple Schedule
This project has a simple survey that will run at 5pm for one day.
# You can insert comments as long as the line begins with a hash mark.
# Project Section
project-name|PIEL Tutorial Sample 1
author|PIEL Administration
author-email|MyName@MyDomain.com
can-test|1
subject-id|0001
placeholder-message|Thanks for checking in. No survey is due at the moment.
# Survey Section
%SURVEY
name|PIEL Tutorial Survey
exit-message|3|Thank you for testing the PIEL Survey.
# This is the schedule.
can-run-once|0
run-for|1
run|*|1700
#Below are the questions.
1|This is a List question. %TYPE list|Answer 1|Answer 2
2|This is a Checkbox question. %TYPE checkbox|Answer 1|Answer 2
3|This is a Basic Slider question. %TYPE slider|left anchor|right anchor
4|This is a Text question. %TYPE text
2. Hints and Participant ID
This project has all question types with customised hints. It also does not have a "subject-id" so the participant will be prompted for an ID.
# You can insert comments as long as the line begins with a hash mark.
# Project Section
project-name|PIEL Tutorial Sample 2
author|PIEL Administration
author-email|MyName@MyDomain.com
can-test|0
# Survey Section
%SURVEY
name|PIEL Tutorial Survey
can-run-once|1
exit-message|3|Thank you for testing the PIEL Survey.
#Below are the questions.
1|This is a List question. %TYPE list %HINT Question 1 hint|Answer 1|Answer 2
2|This is a Checkbox question. %TYPE checkbox %HINT Question 2 hint|Answer 1|Answer 2
3|This is a Basic Slider question. %TYPE slider %HINT Question 3 hint|left anchor|right anchor
4|This is a Text question. %TYPE text %HINT Question 4 hint
3. Branching
This project has a run once survey with 3 list questions and a text question. A "Yes" to question 1 will take us to the last question.
# You can insert comments as long as the line begins with a hash mark.
# Project Section
project-name|PIEL Tutorial Sample 3
author|PIEL Administration
author-email|MyName@MyDomain.com
can-test|1
subject-id|0001
# Survey Section
%SURVEY
name|PIEL Tutorial Survey
exit-message|3|Thank you for testing the PIEL Survey.
#Below are the questions.
1|List question 1. %TYPE list|Yes, go to last question %NEXT 4|No, go to next question
2|List question 2|Yes|No
#We have to skip the next text question.
3|List question 3 |Yes %NEXT END|No %NEXT END
4|You branched here. You can provide more information. %TYPE text
4. First Survey and Contingent Survey
This project has 3 surveys. It has a simple survey that will run at 5pm for one day. It also has a first survey which will run at the beginning of the project. Finally, it has a third survey which is a contingent survey and will run on demand.
# You can insert comments as long as the line begins with a hash mark.
# Project Section
project-name|PIEL Tutorial Sample 4
author|PIEL Administration
author-email|MyName@MyDomain.com
can-test|1
subject-id|0001
placeholder-message|Thanks for checking in. No survey is due at the moment.
# Scheduled Survey Section
%SURVEY
name|PIEL Tutorial Survey
exit-message|3|Thank you for testing the PIEL Survey.
# This is the schedule.
can-run-once|0
run-for|1
run|*|1700
#Below are the questions.
1|This is a List question. %TYPE list|Answer 1|Answer 2
2|This is a Checkbox question. %TYPE checkbox|Answer 1|Answer 2
3|This is a Basic Slider question. %TYPE slider|left anchor|right anchor
4|This is a Text question. %TYPE text
# First Survey
%SURVEY
name|PIEL Tutorial First Survey
exit-message|3|Thank you for testing the PIEL Survey.
can-run-once|1
position|1
#Below are the questions.
1|This is a List question. %TYPE list|Answer 1|Answer 2
# Contingent Survey
%SURVEY
name|PIEL Tutorial Contingent Survey
exit-message|3|Thank you for testing the PIEL Survey.
can-run-once|1
position|4
#Below are the questions.
1|This is a List question. %TYPE list|Answer 1|Answer 2
5. Run-once Survey
This project has 1 run-once survey with 5 list questions. The survey is based on the WHO-5 Well-Being Index The survey has customised hints to add context to the questions.
# Project Section
project-name|PIEL Tutorial Sample 5
author|PIEL Administration
author-email|MyName@MyDomain.com
can-test|1
subject-id|0001
# Survey Section
%SURVEY
name|Well-Being
exit-message|3|Thank you for testing the PIEL Survey.
#Below are the questions.
1|I have felt cheerful and in good spirits. %HINT Indicate which is closest to how you have been feeling over the last two weeks %TYPE list|All of the time|Most of the time|More than half of the time|Less than half of the time|Some of the time|At no time
2|I have felt calm and relaxed. %HINT Indicate which is closest to how you have been feeling over the last two weeks %TYPE list|All of the time|Most of the time|More than half of the time|Less than half of the time|Some of the time|At no time
3|I have felt active and vigorous. %HINT Indicate which is closest to how you have been feeling over the last two weeks %TYPE list|All of the time|Most of the time|More than half of the time|Less than half of the time|Some of the time|At no time
4|I woke up feeling fresh and rested. %HINT Indicate which is closest to how you have been feeling over the last two weeks %TYPE list|All of the time|Most of the time|More than half of the time|Less than half of the time|Some of the time|At no time
5|My daily life has been filled with things that interest me. %HINT Indicate which is closest to how you have been feeling over the last two weeks %TYPE list|All of the time|Most of the time|More than half of the time|Less than half of the time|Some of the time|At no time
Further Information
Further information on the control file can be found at the following links.