Trail Making Test

Technical Manual

Script Author: Sean Draine, Ph.D. (seandr@millisecond.com), Millisecond

Last Modified: January 05, 2026 by K. Borchert (katjab@millisecond.com), Millisecond

Script Copyright © Millisecond Software, LLC

Background

This script implements a computerized version of the Trail-Making Test (4 trails included). The trial making test is an executive function test of visual attention and task switching.

The script only runs on screens that are at least W:L = 118mm : 153mm (Note: ios and Android devices force a vertical layout for this script)

References

Armitages, S. G. (1946) An analysis of certain psychological rests used for the evaluation of brain injury. Psychological Monographs, 60, 1.

Reitan, R. M. (1958). Validity of the Trail Making Test as an Indicator of Organic Brain Damage. Perceptual and Motor Skills, 8, 271-276.

Duration

5 minutes

Description

Participants are asked to move the mouse in specific, predetermined sequences from nodes to nodes (Example: connect dots 1-2-3-4-5, in that sequence)

1. Trail A: presents the participant with strategically placed numbered dots from 1 to 25 that must be connected in sequence from the smallest to the largest number (1-2-3...). => processing speed measure

2. Trail B: presents the participant with strategically placed numbered dots (1-13) and letter dots (A-L) that participants must connect shifting from numbers to letters in numerical (numbers) as well as alphabetical (letters) order (from 1-A-2-B-3-C....). => processing speed + executive function (set shifting) measure

Procedure

This script runs 4 trails (sampleA, trailA, sampleB, trailB) in order without any time constraints.
By default, errors are announced by highlightening the last correct dot and forcing participants to return to it
(this is an option setting, see section parameters)

this script allows researchers to selectively run only one of the tasks if needed.
Check Editable Parameters: parameters.runA and parameters.runB
By default, this script runs both tasks

Stimuli

are provided in the included scripts

Instructions

see script: trailmakingtest_instructions_inc.iqjs (language specific)

Summary Data

File Name: trailmakingtest_summary*.iqdat

Data Fields

NameDescription
inquisit.version Inquisit version number
computer.platform Device platform: win | mac |ios | android
computer.touch 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities
computer.hasKeyboard 0 = no external keyboard detected; 1 = external keyboard detected
display.refreshRate The refreshrate (in Hz) of the current monitor/display
startDate Date the session was run
startTime Time the session was run
subjectId Participant ID
groupId Group number
sessionId Session number
elapsedTime Session duration in ms
completed 0 = Test was not completed
1 = Test was completed
Screen Performance Metrics
screenOK 0 = screen is not big enough (script should terminate); 1 = screen is big enough
display.getmmx(display.width) The width of the current screen in mm
display.getmmy(display.height) The height of the current screen in imm
Parameter Values
parameters.runA True = the script runs SampleA/Trail1
false = the script does NOT runs SampleA/Trail1
parameters.runB True = the script runs SampleB/Trail2
false = the script does NOT runs SampleB/Trail2
Summary Performance Metrics
sampleAErrors Counts the errors made on SampleA Trail
sampleATime Time (in ms) spent on SampleA Trail
sampleBErrors Counts the errors made on SampleB Trail
sampleBTime Time (in ms) spent on SampleB Trail
trail1Errors Counts the errors made on Trail1
trail1Time Time (in ms) spent on Trail1
trail2Errors Counts the errors made on Trail2
trail2Time Time (in ms) spent on Trail2
setShiftingCost Ms difference in completion time of trail2 (trail2 with set shifting requirements) and trail1 (pure processing speed)
relativeSetShiftingCost Ratio of completion time of trail 1 to trail 2
combinedErrors Adds errors made on all 4 trails
combinedTrailTime Combines the time (in ms) it took all 4 trails

Raw Data

File Name: trailmakingtest_raw*.iqdat

Data Fields

NameDescription
build Inquisit version number
computer.platform Device platform: win | mac |ios | android
computer.touch 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities
computer.hasKeyboard 0 = no external keyboard detected; 1 = external keyboard detected
display.refreshRate The refreshrate (in Hz) of the current monitor/display
date Date the session was run
time Time the session was run
subject Participant ID
group Group number
session Session number
blockcode The name the current block (built-in Inquisit variable)
blocknum The number of the current block (built-in Inquisit variable)
trialcode The name of the currently recorded trial (built-in Inquisit variable)
trialnum The number of the currently recorded trial (built-in Inquisit variable)
trialnum is a built-in Inquisit variable; it counts all trials run
even those that do not store data to the data file.
Screen Performance Metrics
screenOK 0 = screen is not big enough (script should terminate); 1 = screen is big enough
display.getmmx(display.width) The width of the current screen in mm
display.getmmy(display.height) The height of the current screen in imm
Parameter Values
parameters.runA True = the script runs SampleA/Trail1
false = the script does NOT runs SampleA/Trail1
parameters.runB True = the script runs SampleB/Trail2
false = the script does NOT runs SampleB/Trail2
blockCode Name of the current block
blockNum Number of the current block
trialCode Name of the current trial
trialNum Number of the current trial
startDotNumber Specifies the current dot that participant is on
targetDotNumber Specifies the current dot that needs to be connected next
sampleAErrors Counts the errors made on SampleA Trail
trail1Errors Counts the errors made on Trail1
sampleBErrors Counts the errors made on SampleB Trail
trail2Errors Counts the errors made on Trail2
errorTrailSampleA-
errorTrailTrail2 Saves all missed circles in the order made for each trail separately
sampleATime Time (in ms) spent on SampleA Trail
trail1Time Time (in ms) spent on Trail1
sampleBTime Time (in ms) spent on SampleB Trail
trail2Time Time (in ms) spent on Trail2

Parameters

The procedure can be adjusted by setting the following parameters.

NameDescriptionDefault
showTestErrorFeedback True = a yellow halo is presented over the correct circle
false = no extra errorfeedback is given (incorrect path is still erased however)
true
runA True = the script runs SampleA/Trail1
false = the script does NOT runs SampleA/Trail1
true
runB True = the script runs SampleB/Trail2
false = the script does NOT runs SampleB/Trail2
true