Dynamic Form¶
Use a Dynamic Form task to collect structured information from participants using simple form elements. The form appears once and collects all responses on a single page, making it a flexible tool for gathering background information, survey responses, or any custom data relevant to your research.
Common use cases¶
- Demographics collection: Collect standard demographic information including age, gender, country, and education level
- Pre-screening: Filter participants by eligibility criteria before they begin your study
- Post-experiment feedback: Gather participant comments, strategy descriptions, difficulty ratings, and assess instruction comprehension during debriefing
- Likert scale: Collect rating scale data with radio buttons for discrete responses (e.g., I very much agree to I completely disagree)
Alternative tasks¶
- Use a Stimulus Form for rating or responding to individual stimuli with form elements.
- Use a Consent Task for obtaining formal ethical consent with required agreement checkboxes.
- Use a Label Task for text responses to individual stimuli.
Parameters¶
Customize the task by changing these on the Parameters tab of the task.
Form main text¶
Formatted text that is displayed at the top of the form page. Use this to provide context for the participant. The editor is the same as for the text in the Information Task and Consent Task.
Built-in fields¶
These are fields that you can select to include without further customization.
age-
A drop-down box with options: 10-120.
gender-
A drop-down box with options: male, female, neutral.
handedness-
A drop-down box with options right, left, neither
country-
A drop-down box with 249 countries from ISO 3166
language-
A drop-down box with languages from ISO 639-3
race-
A drop-down box with 5 options based on the UK census classification
- African or Black
- Asian
- Caucasian or White
- Mixed
- other
Custom fields¶
You can add any number of Custom Fields. Each new custom field has the following parameters:
type-
The type of input mechanism. One of:
- input (single row text field)
- slider (slider)
- radio (radio choice)
- select (dropdown choice)
- select_multi (dropdown choice, allow multiple)
- textarea (multiple row text field)
name-
The name of the field, as it appears in the data.
title-
The name of the field, as it is shown to the participant.
description-
A helpful text for the participant, displayed under the item.
options-
Only applied to custom fields of kind
select. Add available choices here. required-
If this is unchecked, an empty text field may be submitted.
Data¶
For general information about the various structures and file formats that you can download for your data see Downloads.
As a "Table" for multiple participations in a task:
- Each row represents one participant's responses
pidcolumn contains the participant ID- Additional columns correspond to each field you configured (both built-in and custom fields)
- Column names match the
nameparameter of each field
In the Tree structure:
- Variables are stored at the top level for the participation. Keys correspond to the field names (as defined in the
nameparameter), and values contain the participant's input or selection.
Analysis¶
Dynamic Form data is typically used for participant filtering, demographic analysis, or as covariates in your main analyses. Below are examples of how to load and work with the data.
Load and inspect form responses¶
import pandas as pd
# read "table" data as CSV
file_path = 'my_data/Meadows_myExperiment_v1_table.csv'
df = pd.read_csv(file_path)
# set participant id column as index
df = df.set_index('pid')
# view first few rows
print(df.head())
# summary statistics for categorical fields
print(df['gender'].value_counts())
print(df['country'].value_counts())
# filter participants by criteria
filtered = df[df['age'] >= 18]
import json
# read "tree" data for multiple participants
file_path = 'my_data/Meadows_myExperiment_v1_tree.json'
with open(file_path) as fhandle:
data = json.load(fhandle)
# extract form data from first participant
participant_id = list(data.keys())[0]
form_data = data[participant_id]['tasks'][0]
print(form_data)
# Output example: {'age': 28, 'gender': 'female', 'country': 'GB', ...}