Skip to content

Timed Key Response Task

Try the Demo

In this task, stimuli are presented one at a time or as a small set, and the participant responds with a keyboard press. Their reaction time is recorded.

The task can be configured for various experimental designs;

  • with or without time limits
  • for single, pairs or triplets of stimuli
  • free key choice or a limited set of valid options.

Alternative tasks

Parameters

Customize the task by changing these on the Parameters tab of the task.

General Interface settings

Customize the instruction at the top of the page, as well as toolbar buttons. These apply to most task types on Meadows.

Instruction hint

Text that you can display during the task at the top of the page.

Extended instruction

A longer instruction that only appears if the participant hovers their mouse cursor over the hint.

Hint size

Whether to display the instruction, or hide it, and what font size to use.

Fullscreen button

Whether to display a button in the bottom toolbar that participants can use to switch fullscreen mode on and off.

Response Configuration

Configure which keyboard responses are accepted and how they are processed.

Responses

Which keyboard keys are accepted as valid responses. You can select multiple keys. Common configurations include:

  • Single key (e.g., Spacebar) for simple reaction time
  • Two keys (e.g., F and J) for two-choice reaction time
  • Multiple keys for choice reaction time with several alternatives

Stimulus Timing

Control the temporal parameters of stimulus presentation and response windows.

Stimulus duration

How long each stimulus is displayed, in milliseconds. Default: 1000 ms. Valid range: 4 to 3,600,000 ms.

Note

Be mindful of your display's refresh rate when setting very short durations. For example, a 60 Hz monitor refreshes every ~16.7 ms.

Post stimulus response window

Additional time after the stimulus disappears during which the participant can still respond, in milliseconds. Default: 0 ms. Valid range: 0 to 60,000 ms.

Note

Set this to 0 if you want responses to be accepted only while the stimulus is visible. Set it to a positive value to allow responses after stimulus offset (useful for brief stimulus presentations).

End stimulus presentation on response

If checked (default), a valid response during stimulus presentation will immediately remove the stimulus and proceed to the break interval, skipping any remaining stimulus duration and the post-stimulus response window.

End response window on response

If checked (default), a valid response during the post-stimulus response window will immediately end that window and proceed to the break interval.

Trial Structure

Inter-stimulus interval

Break duration between trials in milliseconds, during which no response is allowed. Default: 0 ms. Valid range: 0 to 60,000 ms. This provides a clear separation between trials and can help prevent anticipatory responses.

Stimuli per trial

How many stimuli to show on each trial. Options:

  • 1: Single stimulus (standard design)
  • 2: Pair of stimuli (for comparison tasks)
  • 3: Triplet (for multiple-item tasks)

Default: 1.

Record trials without response

By default, trials where the participant did not respond in time do not appear in the data. Check this box to include these trials in your data with label 'none'. Default: unchecked.

Trial Generation

Control how trials are generated from your stimulus set.

Randomize order

If checked (default), stimuli appear in randomized order. Uncheck this if stimuli should appear in a fixed order.

Maximum number of trials

The number of trials will equal the total number of unique combinations of stimuli, or this parameter, whichever is smaller. Default: 2000. Valid range: 1 to 10,000.

Proportion of trials with double

How many of the total number of trials should be "catch trials" with the same stimulus shown twice (only relevant when stimuli per trial > 1). Default: 0.0. Valid range: 0.0 to 0.9.

Trial repetitions

How often to repeat each stimulus combination. Default: 1. Valid range: 1 to 1,000.

Task Flow

Start delay

How long to wait in seconds before the task starts. Default: 0. Valid range: 0 to 60 seconds.

Start delay instruction

Text to display to participant before task starts (during start delay). Max 50 characters.

Maximum total duration

After this many seconds, the task will stop automatically. Default: 86,400 seconds (24 hours). Valid range: 1 to 86,400 seconds.

Trials between breaks

A break will be shown and data stored every time the participant has finished this many trials. Default: 5000. Valid range: 1 to 5,000.

Break text

The text shown during breaks. Default: "You've just finished one block.\nTake a break, and press next when ready." Supports line breaks (\n). Max 500 characters.

Wait button label

The label on the toolbar button while the task is still in progress. Default: "Not done yet..". Max 20 characters.

Advanced

Mouse tracking

Store mouse tracking data. This is a beta feature only unlocked on selected accounts. Contact us if interested.

Data

For general information about the various structures and file formats that you can download for your data see Downloads.

As stimulus-wise "annotations" (table rows), with columns:

  • trial - numerical index of the trial
  • time_trial_start - timestamp when the stimulus was displayed (seconds since 1/1/1970)
  • time_trial_response - timestamp when the participant responded (seconds since 1/1/1970)
  • stim1_id - meadows internal id of the first stimulus
  • stim1_name - filename of the first stimulus as uploaded
  • stim2_id - meadows internal id of the second stimulus (if stimuli_per_trial > 1)
  • stim2_name - filename of the second stimulus (if stimuli_per_trial > 1)
  • stim3_id - meadows internal id of the third stimulus (if stimuli_per_trial = 3)
  • stim3_name - filename of the third stimulus (if stimuli_per_trial = 3)
  • label - the key pressed by the participant, or 'none' if no response was recorded

Analysis

Calculate Reaction Times

Reaction time (RT) is calculated as the difference between time_trial_response and time_trial_start. Here's how to compute and analyze RTs:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Load the annotations data
df = pd.read_csv('Meadows_myExperiment_v1_annotations.csv')

# Calculate reaction time in milliseconds
df['rt_ms'] = (df['time_trial_response'] - df['time_trial_start']) * 1000

# Remove trials without responses (if recorded)
df_responses = df[df['label'] != 'none']

# Basic statistics
print(f"Mean RT: {df_responses['rt_ms'].mean():.2f} ms")
print(f"Median RT: {df_responses['rt_ms'].median():.2f} ms")
print(f"SD RT: {df_responses['rt_ms'].std():.2f} ms")

# Plot RT distribution
plt.figure(figsize=(10, 6))
plt.hist(df_responses['rt_ms'], bins=50, edgecolor='black')
plt.xlabel('Reaction Time (ms)')
plt.ylabel('Frequency')
plt.title('Reaction Time Distribution')
plt.show()
library(tidyverse)

# Load the annotations data
df <- read_csv('Meadows_myExperiment_v1_annotations.csv')

# Calculate reaction time in milliseconds
df <- df %>%
  mutate(rt_ms = (time_trial_response - time_trial_start) * 1000) %>%
  filter(label != 'none')

# Basic statistics
df %>%
  summarise(
    mean_rt = mean(rt_ms),
    median_rt = median(rt_ms),
    sd_rt = sd(rt_ms)
  )

# Plot RT distribution
ggplot(df, aes(x = rt_ms)) +
  geom_histogram(bins = 50, fill = 'steelblue', color = 'black') +
  labs(x = 'Reaction Time (ms)', y = 'Frequency',
       title = 'Reaction Time Distribution') +
  theme_minimal()

In Google Sheets or Microsoft Excel, you can perform similar calculations on your downloaded annotations data.

  1. Load Data: Import the Meadows_myExperiment_v1_annotations.csv file into your spreadsheet.
  2. Calculate RT: Add a new column (e.g., RT (ms)) with the formula:
    =(time_trial_response - time_trial_start) * 1000
    
  3. Filter Responses: Use a filter or conditional formatting to exclude rows where label is 'none'.
  4. Basic Statistics: Use built-in functions to calculate mean, median, and standard deviation:
  5. Mean RT: =AVERAGEIF(label_column, "<>none", rt_column)
  6. Median RT: =MEDIANIF(label_column, "<>none", rt_column)
  7. SD RT: =STDEV.S(IF(label_column<>"none", rt_column))
  8. Visualize: Create a histogram or bar chart of the RT values to visualize the distribution.