Skip to content

Text Response

A text response allows participants to answer a question or leave a comment by typing in a text box.

Required Properties

type

  • Definition: The type of response
  • Possible values: For a text response, type must be specified as "text".
1
2
3
{
  "type": "text"
}

Optional Properties

delay

1
2
3
4
{
  "type": "text",
  "delay": 1
}

duration_timer

1
2
3
4
{
  "type": "text",
  "duration_timer": true
}

duration_timer_onset

1
2
3
4
5
{
  "type": "text",
  "duration_timer": true,
  "duration_timer_onset": "start"
}

height

  • Definition: The height of the text box, in “px” (pixels).
  • Possible values: pixels (i.e. "50px")
  • Default value: "200px"
  • See also: width

1
2
3
4
{
  "type": "text",
  "height": "50px"
}
The height of the resulting text box will be 50 pixels.

instruction

  • Definition: A string of text providing instructions for participants about the current response. Use empty quotes ("") to remove the instruction text.
  • Possible values: A string of text
  • Default value: "Type your answer here:"

1
2
3
4
{
  "type": "text",
  "instruction": "Type the first number that comes to mind:"
}
In this example code, participants will see the instruction "Type the first number that comes to mind:" above the text box.

1
2
3
4
{
  "type": "text",
  "instruction": ""
}
In this example code, participants will see no instruction accompanying the text box.

max_characters

  • Definition: The maximum number of characters allowed in this response.
  • Possible values: A number

    Note

    What counts as a character may differ between languages, and will be determined by the browser used by the participant.

  • Default value: -1, meaning no limit

1
2
3
4
{
  "type": "text",
  "max_characters": 50
}

min_characters

  • Definition: The minimum number of characters allowed in this response.
  • Possible values: A number

    Note

    What counts as a character may differ between languages, and will be determined by the browser used by the participant.

  • Default value: 0, meaning no minimum.

1
2
3
4
{
  "type": "text",
  "min_characters": 50
}

min_seconds

  • Definition: The minimum number of seconds that a participant must wait before they can submit their response.
  • Possible values: A number in seconds
  • Default value: 0, meaning no restrictions.

Note

Participants will still be able to begin typing before the min_seconds duration. This feature simply prevents participants from submitting what they've written before the min_seconds duration. This feature may have varying effectiveness in encouraging a longer response from participant to participant.

1
2
3
4
{
  "type": "text",
  "min_seconds": 10
}

parent

Given a response named "response1" defined as follows:

1
2
3
4
5
{
  "type": "text",
  "width": "100px",
  "height": "50px"
}

You can define a child response "response2" that inherits all of its parent's properties:

1
2
3
4
{
  "type": "text",
  "parent": "response1"
}

required

  • Definition: Whether participants must provide a response to this response.
  • Possible values: true, false
  • Default value: false
1
2
3
4
{
  "type": "text",
  "required": true
}

prevent_paste

  • Definition: Whether the participant will be able to paste content into the text response. If set to true, this disables pasting behavior at a system level - not only will right-clicking the text response not bring up a menu, but Ctrl/Command + V keyboard shortcuts will not work either.
  • Possible values: true, false
  • Default value: false
1
2
3
4
{
  "type": "text",
  "prevent_paste": true
}

spellcheck

  • Definition: If set to false, the text response will not alert participants about potential misspelled words, which is useful if participants are supposed to type non-dictionary words.
  • Possible values: true, false
  • Default value: true

Note

Spellcheck functions are provided by the browser and may differ between browsers.

1
2
3
4
{
  "type": "text",
  "spellcheck": false
}

target

  • Definition: The expected response. If the participant enters the same response, it would be marked as "correct" in the participant data CSV.

    Note

    All leading and trailing whitespaces in the participant's response will be removed before being compared to the target.

  • Possible values:

    • Any string of text (e.g., "Paris")
    • A stimulus attribute reference in the format "%s:stimulus_name|attribute" (e.g., "%s:s1|answer"). Glob patterns (*, ?, [...]) are supported in the stimulus name to match multiple stimuli (e.g., "%s:exp_*|correct_response").
  • Default value: Not set
  • See also: target_match

In most cases, the target is simply a string that matches the expected response:

1
2
3
4
{
  "type": "text",
  "target": "Paris"
}
In this example code, if a participant enters the word "Paris" in the text box, FindingFive will recognize their response as correct.

To make paradigms where the correct answer varies by stimulus easier to implement, the target can also be defined as a stimulus attribute reference. In this example, each stimulus has an answer attribute containing the correct response:

"q1": {"type": "text", "content": "What is the capital of France?", "answer": "Paris"}
"q2": {"type": "text", "content": "What is the capital of Italy?", "answer": "Rome"}
Then, we can create a text response that uses the answer attribute of the stimulus as the target:

1
2
3
4
{
  "type": "text",
  "target": "%s:q*|answer"
}
You'll need to make sure that the resolved value of the target matches what you expect participants to type.

target_match

Dependencies

Requires target to be defined.

  • Definition: If set to true, participants must type in an answer that matches the target as defined above in order to continue the study (a good use case of this feature is to implement a passcode).
  • Possible values: true, false
  • Default value: false
  • See also: target

1
2
3
4
5
{
  "type": "text",
  "target": "LEFT",
  "target_match": true
}
In this example code, participants will not be able to move on unless they ender the word "LEFT" in the text box.

timeout

  • Definition: The number of seconds for which the participant can type their response. When the timeout duration passes, the text box will be immediately disabled and the response typed in by the participant will be automatically submitted.
  • Possible values: A number in seconds
  • Default: Not set, meaning the response will not time out
  • See also: min_seconds
1
2
3
4
{
  "type": "text",
  "timeout": 15
}

width

  • Definition: The width of the text box, in “px” (pixels).
  • Possible values: pixels (i.e. "100px")
  • Default value: "500px"
  • See also: height
1
2
3
4
{
  "type": "text",
  "width": "100px"
}

Recorded Data

  • value: the text typed in by the participant
  • rt: reaction time, defined as the number of milliseconds between when the text box starts accepting input and the moment when the participant submits their response