Skip to content
Nick Ruggieri edited this page Sep 23, 2020 · 117 revisions

Welcome to the Quest Wiki!


QUEST – Questionnaire App – Documentation v0.6 7-23-20

Default Settings

  1. The following response codes correspond with the following options:
    a. 77 = Don’t Know
    b. 88 = NA
    c. 99 = Prefer not to answer
    The length of these response codes is increased as needed to avoid confusion with codes for other possible responses or the limits for integer responses. For example, if there are 10 other response categories, 777 = Don’t know. If age is requested as an integer and the maximum age allowed is 150, then 7777 = Don’t know.

  2. #YN following a question indicates binary, 0 = No, 1 = Yes, response options.

  3. #YNP following a question indicates 0 = No, 1 = Yes, 99 = Prefer not to answer, response options.

  4. (99) or [99] preceding a response, indicates that if selected all other previously selected responses will be cleared.

Syntax

Text or question

[TEXT], [TEXT#] – Brackets enclosing all upper-case text indicates the beginning of a text section (e.g. background information, directions) or a question. Numbers and underscores may be included, but there can be no spaces (e.g. A1, BQBCK_AGE_V1R0, INTRO). Text sections that are followed by response options will be read by the QUEST app as questions. Text included in the brackets will be used as the name for that question should it be referred to in other questions (i.e. for applying skip logic or piping an answer given for one question into the text of another question) and for the variable name for that question in the output. Text sections may contain spaces between paragraphs. A new text section or question will not be created until indicated as described above.

Answer required

[TEXT!], [TEXT#!] - An ! following the text between brackets indicating a question is used when that question must be answered in order for the participant to move on to the next question. Also referred to as a hard edit.

Answer prompt

[TEXT?], [TEXT#?] - A ? following the text between brackets indicating a question is used if a prompt to answer the question, should the participant skip, is wanted. Also referred to as a soft edit. The participant will still be allowed to move on to the next question even if the current question is unanswered.

Skip logic

-> TEXT – Skip logic is indicated with an arrow after the response variable to which the skip logic is applied. The text following the arrow is the name of the question displayed if the indicated response variable is selected.

Piped response

{$ID} – To pipe a response from one question (e.g. A1) into the text of another question (e.g. A2) insert the id of the first question, preceded by a $, in curly brackets (e.g. {$A1}) into the text of the other question where the response should appear. Piped response can take optional text. Just add a : after the ID (e.g. {$A1:this is optional text}. If there is no value given for the id, the optional text will appear instead.

Conditional text

|displayif= <condition>|text and piped reponses| - Pipe, displayif=, the condition that is required, pipe, the text that the user would like to be displayed, pipe indicates a conditional text.

Informational Pop-up

|popup|buttonText|title|popupText| - Pipe, popup, pipe, Button text, pipe, Title, pipe, Popup text, pipe to insert an informational pop-up button and associated text into a question or other text block insert the name of the button (e.g. information, definition, term to be defined) in buttonText followed by an optional title for the pop-up and the text to be included in the pop-up in brackets.

Example:
|popup|Example|Title|Here is the pop-up text|

Categorical responses

Select one

(#) - Parenthesis preceding response options indicate that only one option may be selected. This is also referred to as a radio button.

Select many

[#], [Text], [Text#] – Brackets preceding response options indicate multiple options may be selected (i.e. Select All That Apply questions). Numbers, text, and underscores may be used in between the brackets in any combination as long as it’s a single string. Strings included between brackets will be used as the variable name for the output indicating selection of individual response options. Selection of an option will be recorded as a binary (1 = Selected, 0 = Not Selected) in the output for that question. This is also referred to as a check box.

Numeric and free text responses

Numeric

|__|__| - Pipe, underscore, underscore, pipe, underscore, underscore, pipe indicates a numeric response.
|__|__|id=VARIABLENAME| - Allows for a variable name to be entered. Variable name has to be in all capital letters.
|__|__|min=# max=#| - Allows for a minimum and maximum number range for the number input. Example: |__|__|min=0 max=100|
The min or max can take a previous Variable Name from a previous number input. Example: |__|__|min=AGE max=100| or |__|__|min=0 max=AGE|
Combined, every thing should look like |__|__|id=VARNAME min=0 max=100|

Free text

|__| - Pipe, underscore, underscore, pipe, indicates a free text response that is limited to a single line. Note, length of line is indeterminate unless otherwise specified.
|___| - Pipe, underscore, underscore, underscore, pipe, indicates a free text response that may wrap around to multiple lines. Note, length of response is indeterminate unless otherwise specified. For all numeric and free text responses that are not part of a categorical response, the variable name for the response in the output is the same as the question name. Note, length of response is indeterminate unless otherwise specified.

[textbox: VARIABLE_NAME] - Bracket, the word "textbox", colon, Variable Name, bracket indicates a free texr response that may wrap around multiple lines

One or the Other (XOR)

In order to create a response that is only able to be answered one or the other, the text response input needs to have an attribute called xor and a unique ID. (e.g. |__|__|xor=Q1 id=Q1_A| and the second element |__|__|xor=Q1 id=Q1_B|)

Date

|date| - pipe, date, pipe, denotes date entry. It takes an optional id (e.g. |date|id=DATE1|)

Time

|time| - pipe, the word "time", and pipe should create an input type of time. It takes an optional id (e.g. |time|id=TIME1|)

Social Security Number

|SSN| - pipe, the letters "SSN" all caps, pipe denotes a 9 digit social security number entry. It takes a default pattern of ###-##-####, which is the default placeholder as well. To set the default pattern, set the markdown to |SSN|pattern=| to whatever pattern you would like. To set the default placeholder, set the markdown to |SSN|placeholder=| to whatever placeholder you would like.

Shortened Social Security Number

|SSNsm| - pipe, the letters "SSNsm" all caps except "sm", pipe denotes a 4 digit social security number entry. It takes a default pattern of ####. To set the default pattern, set the markdown to |SSN|pattern=| to whatever pattern you would like. To set the default placeholder, set the markdown to |SSN|placeholder=| to whatever placeholder you would like.

Phone Number

|tel| - pipe, the letters "tel", pipe denotes phone number entry. It takes a default pattern of (###)-###-####, which is the default placeholder as well. To set the default pattern, set the markdown to |tel|pattern=| to whatever pattern you would like. To set the default placeholder, set the markdown to |tel|placeholder=| to whatever placeholder you would like.

Email address

|@| - Pipe, @, pipe, indicates an email address and entries are checked for a valid email format. It takes an optional id (e.g. |email|id=EMAIL1|)

Images

|image|URL|height,width| - Pipe, image, pipe, the image URL (without https:// attached), and as an optional input of the height of the image and the width of the image and concluding with another pipe.

Looping [advanced]

The questionnaire doesn't actually loop, but rather unrolls the loop. The <loop> tag writes out the questions within the tag "max" times. The question Id are changed from QID to QID_#. A variable #loop, the loop index, is defined starting with the value of 1 for the first iteration of the loop. The displayif tag must be used in all questions within the loop to prevent questions from being displayed after the loop is completed. Typically, a question before the loop will provide the number of iterations.

<loop max = num>
[QID, displayif=function(responseId,#loop)] 
 ...
</loop>

where function = {greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, equals}

Example

[NAME] What is your name?
[FST_NAME] First name |__|
[LST_NAME] Last name |__|

[AGE] {$FST_NAME}, how old are you?
|__|__|

[OWNER] Do you own a pet?
#YN

[PETS] Select from below all the animals you think make good pets.  Select as many as apply.
[1] Dogs -> BREED
[2] Cats
[3] Fish
[4] Birds
[5] Other: Specify [text box:otherpets]

[BREED] List your favorite breed of dog
|__|

[WALK] How many times per day should a dog be walked?
(1) Once per day
(2) Two times per day
(3) Three or more times per day
(99) Prefer not to answer

Output for Sam Smith, a 38-year-old pet owner who selected Dogs, Fish, and Other, whose favorite breed of dog is a lab, and would prefer not to answer how many times per day a dog should be walked.

NAME FST_NAME LST_NAME AGE OWNER PETS 1 2 3 4 5 OtherPets BREED WALK
1 Sam Smith 38 1 1 1 0 1 0 1 rabbits lab 99

Looping Example

[NUMKIDS] Number of Children |__|__|id=numchildren|

<loop max=20>
[KIDNAME|firstquestion=#loop loopmax=numchildren|] What is child # #loop's name? |__|id=kidsname|
[KIDAGE]  What is child # #loop's age? |__|__|id=kidsage|
< -> _CONTINUE >
</loop>
Clone this wiki locally