User Manual: Inquisit Nasa Tracing Task


___________________________________________________________________________________________________________________	

								*Tracing Task*
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 04-06-2022
last updated:  11-05-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 11-05-2024 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements Millisecond Software's version of the NASA developed 'Tracing Task',
a measure of manual dexterity.

Note the script runs with proportional sizing by default. 
Researchers can select to run the task with an absolute screen size to ensure that distances
stay the same across devices. See section Defaults for more info.


References:
										
Bettina L. Beard (2020).
The Cognition and Fine Motor Skills Test Batteries: Normative Data and Interdependencies
Technical Memorandum (TM) 20205008023.
https://ntrs.nasa.gov/citations/20205008023	
Public Access

ipad App ('Fine Motor Skills'); free App from Apple App Store 
Note: the ipad App data/implementation may differ from the one collected by the Inquisit script

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________

description from Beard (2020):

"The Trace test also measures manual dexterity. The participant follows the outline of a
geometric figure starting at the location of a small circle labelled “Start.” They trace along the
outline in the direction indicated by an arrow. Feedback was provided on the path traced. Each
block contained 5 trials. Each participant ran in twelve blocks of trials (2 directions x 2
repetitions x finger/stylus) for the long version and (2 repetitions x finger/stylus) for the short
version of the test."

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of this script takes appr. 7-8 minutes to complete

___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'tracingtask_raw*.iqdat' (a separate file for each participant)

build:								The specific Inquisit version used (the 'build') that was run
computer.platform:					the platform the script was run on (win/mac/ios/android)
date, time: 						date and time script was run 
subject, group: 					with the current subject/groupnumber
session:							with the current session id

/*Parameter Settings*/																				
tracingMechanism:					"finger" vs. "stylus" 
tracingHand:						"dominant" vs. "nondominant" vs. "left" vs. "right"
runTracingCircle, 					true (1) or false (0)
runTracingSquare:					true (1) or false (0)
runClockwise: 						true (1) of false (0)
runCounterClockwise: 				true (1) of false (0)					 
repetitionsPerCondition:			number of repetitions per condition 

playAreaHeightMM:					the width of the play area in mm 
playAreaWidthMM:					the height of the play area in mm 										
																				
tracingCircleDiameterMM:			the diameter of the tracing circle in mm
tracingSquareHeightMM:				the diameter of the tracing square in mm
trackWidthMM:						the width of the tracks around the stimulus in mm (the area that is considered 'on track')

//raw data: trial by trial
blockCode, blockNum:				the name and number of the current block (built-in Inquisit variable)
trialCode, trialNum: 				the name and number of the currently recorded trial (built-in Inquisit variable)
										Note: trialNum is a built-in Inquisit variable; it counts all trials run; even those
										that do not store data to the data file.
									
conditionCounter:					counts the number of conditions run 
blockCounter:						counts the number of blocks run per condition									
																				
currentCondition:					1 = diameter1, clockwise; 2 = diameter1, counterClockwise;
									3 = diameter2, clockwise; 4 = diameter2, counterClockwise
									
conditionRepetition:				number of times the current condition has been presented									
																														
direction:							1 = clockwise; 2 = counterClockwise 
tracingStimCondition:				1 = circle; 2 = square 
trialCounter:						trial counter per block


respStatus:							"down":		the finger/stylus touched the target/start circle
									"move":		finger/stylus is moving on screen 
									"up-miss":	finger/stylus was lifted off screen but has not reached the target circle
									"up-good":	finger/stylus was correctly lifted of the target circle

onTrack:							1 = the current mouse coordinates are on the track around the circle/square

errorPX:							for coordinates 'onTrack' -> 0
									if not on track: the number of pixels that finger/stylus is currently away from track
									negative values: the finger/stylus went inside the tracing stimulus ('inside error')
									positive values: the finger/stylus went outside the tracing stimulus ('outside error')
									
									CIRCLE condition:
									'inside error': the (negative) pixel difference btw. inner track radius (in px) and distance from mouse coordinates to circle center
									'outside error': the (positive) pixel difference btw. outer track radius (in px) and distance from mouse coordinates to circle center
									=> see expressions.TracingCircleErrorPX

									Square condition:
									'inside error': script returns the minimum of 4 possible distances to the inner track (Note: 'benefit of a doubt' coding)
									1. vertical distance to top inner track
									2. vertical distance to bottom inner track
									3. horizontal distance to left inner track
									4. horizontal distance to right inner track
									'outside error': script determines in which of 8 possible locations (relative to the tracing square) the coordinates fall into
									1. directly above: returns the difference in y coordinates of the outer track and the mouse coordinates
									2. directly below: returns the difference in y coordinates of the outer track and the mouse coordinates
									3. directly left: returns the difference in x coordinates of the outer track and the mouse coordinates
									4. directly left: returns the difference in x coordinates of the outer track and the mouse coordinates
									the remaining locations return the distance of the mouse coordinates to the nearest corner of the outer track
									=> see expressions.TracingSquareErrorPX
									
errorXPX:							the horizontal x mouse/finger coordinate at time of error									
errorYPX:							the vertical y mouse/finger coordinate at time of error

meanTrialErrorPX:					the mean of all 'errorPX' values across the trial (measure only is based on absolute values => of interest is the absolute distance) in the current trial
									calculated at the end of each trial

onTargetZone:						1 = mouse/finger coordinates are currently on the Target Zone; 0 = otherwise 
leftTargetZone:						1 = mouse/finger coordinates have moved on from initial touchdown on Target Zone; 0 = otherwise
reachedTargetZone:					1 = mouse/finger coordinates have reached Target Zone again after once leaving it; 0 = otherwise 

success:							1 = the mouse/finger coordinates have left Target Zone and have reached Target Zone during the trial
									at time of finger lift-off
									0 = otherwise
									
//Latency:
tracingRT:							the time (in ms) it took from down response to up response (successful or not)

//Coordinate Measures
mouse.x:							the x coordinate of the finger at the time of the currently measured response
mouse.y:							the y coordinate of the finger at the time of the currently measured response 

targetZoneCenterXPX:			the horizontal x-pixel position of the target/start circle
targetZoneCenterYPX:			the vertical y-pixel position of the target/start circle
targetZoneDiameterPX:			the pixel diameter of the target/start circle


//Inquisit built-in variables
response:							the response of participant
									Example:
									'mousemove' => mouse coordinate change was noted
									'lButtonUp' => lift-up response
									or the name of the stimulus that was touched

correct:							correctness of response
									Example: trial.tracingCircleTracingEnd
									1 = participant lifts finger off the screen when values.success = 1
									0 = any other response

latency:							continuous trial latency (in ms); measured from: onset trial
									until lift-off response
									

(2) Summary data file: 'tracingtaskSummary*.iqdat' (a separate file for each participant)

inquisit.version:					Inquisit version run
computer.platform:					the platform the script was run on (win/mac/ios/android)
startDate:							date script was run
startTime:							time script was started
subjectId:							assigned subject id number
groupId:							assigned group id number
sessionId:							assigned session id number
elapsedTime:						time it took to run script (in ms); measured from onset to offset of script
completed:							0 = script was not completed (prematurely aborted); 
									1 = script was completed (all conditions run)

/*Parameter Settings*/										
tracingMechanism:					"finger" vs. "stylus" 
tracingHand:						"dominant" vs. "nondominant" vs. "left" vs. "right"
runTracingCircle, 					true (1) or false (0)
runTracingSquare:					true (1) or false (0)
runClockwise: 						true (1) of false (0)
runCounterClockwise: 				true (1) of false (0)					 
repetitionsPerCondition:			number of repetitions per condition 


/playAreaHeightMM:					the width of the play area in mm 
/playAreaWidthMM:					the height of the play area in mm 

tracingCircleDiameterMM:			the diameter of the tracing circle in mm
tracingSquareHeightMM:				the diameter of the tracing square in mm
trackWidthMM:						the width of the tracks around the stimulus in mm (the area that is considered 'on track')
										
																				
//Latency Data//

//across clockwise and counterClockwise direction, by circle and square
medianRTCircle: 		median tracing RT (in ms) for circle condition trials

zRTCircle: 			z-score of medianRTCircle using norming data from Beard (2020, p.22) for finger/stylus (depends on parameters.TracingMechanism)
						Notes: see Beard (2020, Appendix F, p.67/68) for a complete overview of their results
						Norming sample described in Beard (2020, p.8)
						Keep in mind: The norming sample may not be the appropriate comparison group for your participants 
						and/or study design

pRTCircle:			percentile of zRTCircle
						!The norming sample may not be the appropriate comparison group for your participants 
						and/or study design!

medianRTSquare: 		median RT (in ms) for square condition trials

zRTSquare: 			z-score of medianRTSquare using norming data from Beard (2020, p.22) for finger/stylus (depends on parameters.TracingMechanism)
						Notes: see Beard (2020, Appendix F, p.67/68) for a complete overview of their results
						Norming sample described in Beard (2020, p.8)
						Keep in mind: The norming sample may not be the appropriate comparison group for your participants 
						and/or study design
						
pRTSquare:			percentile of zRTSquare
						!The norming sample may not be the appropriate comparison group for your participants and/or study design!


//by direction:
medianRTCircleC:		median RT (in ms) in clockwise, circle condition
medianRTCircleCc:		median RT (in ms) in counterClockwise, circle condition
medianRTSquareC:		median RT (in ms) in clockwise, square condition
medianRTSquareCc:		median RT (in ms) in counterClockwise, square condition
*median tracing RT = median time (in ms) it took for participant to successfully complete a trial 

//Error Data//
//across clockwise and counterClockwise direction:

medianPixelErrorCircle:		median pixel errors in circle condition 
medianPixelErrorSquare:		median pixel errors in square condition
(see 'errorPX' - under raw data- for explanation of how pixel errors were computed in this script.
Because this computation might be different from Beard (2022), the error norming data on p.23 was not
used in this script)
 
//Pixel Error Data
medianPixelErrorCircleC:		median pixel errors in clockwise, circle condition
medianPixelErrorCircleCc:	median pixel errors in counterClockwise, circle condition
medianPixelErrorSquareC:		median pixel errors in clockwise, square condition
medianPixelErrorSquareCc:	median pixel errors in counterClockwise, square condition
												
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	
By default, this script runs 4 different conditions with 1 repetition per condition:
2 tracing stimuli (circle, square) x 2 directions (clockwise vs. counterClockwise) x 1 reps
The order of the resulting 4 conditions is selected at random.
Each condition runs 3 blocks of 5 trials each (12 blocks total), followed by a self-paced break.
By default, participants receive optional performance feedback at script conclusion.

Check section 'Editable Parameters' for parameters that control
- tracing stimuli (circle/square) conditions to run
- rotation (clockwise, counterClockwise) conditions to run
- block/trial/repetition numbers
- performance feedback settings
- automated task demo

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________

provided by Millisecond Software - can be edited under section 'Editable Stimuli'
___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________

provided by Millisecond Software - can be edited under section 'Editable Instructions'.
The instructions are based on Beard (2020, p.58 - Appendix D)
___________________________________________________________________________________________________________________	
EDITABLE CODE 
___________________________________________________________________________________________________________________	
check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code 
to further customize your experiment.

The parameters you can change are:

/ tracingMechanism = "finger"			//choose from: "finger" vs. "stylus"
										//Note: if "finger", the index finger is assumed
										
/ tracingHand = "dominant"				//choose from: "dominant", "non-dominant", "left", "right"

/ skipPerformanceFeedback = false		//true: participants won't receive any performance feedback at the end
										//false: participants will receive performance feedback at the end
										
/ runDemo = true							//true: the script runs an demonstration of the task
										//false: the script skips the demonstration (e.g. if task administrator wants to demonstrate themselves)
										

//design parameters: 2 tracing stims x 2 rotations = 4 conditions

/ runTracingSquare = true
/ runTracingCircle = true

/ runClockwise = true					//true = run the task with clockwise rotations
										//false = skip the clockwise rotation trials
										
/ runCounterClockwise = true				//true = run the task with counter-clockwise rotations
										//false = skip the clockwise counter-rotation trials	

																			
/ numberOfBlocksPerCondition = 3		//number of blocks per condition;  Example for a condition: 'tracingCircle, clockwise'
/ trialsPerBlock = 5						//number of trials per block

/ repetitionsPerCondition = 1			//the number of repetitions for each condition	
										//in this script: conditions repeat once they have all run
										//Example for a condition: 'tracingCircle, clockwise'

//color parameter
/ canvasColor = lightGray				//Display color of the actively used portion of the screen (the 'canvas')
										//Note: if set to a color other than the screenColor, you can distinguish the active canvas
										//from the inactive portion of the screen
									
/ screenColor = lightGray 				//Color of the screen not used by the canvas ('inactive screen')
/ defaultTextColor = black				//Default color of text items

//CANVAS SIZING PARAMETERS
//sizing Parameters in RELATIVE measurements relative to CANVAS HEIGHT
//NOTE: to run the script with ABSOLUTE screen measurements, go to 'defaults' and set 
//canvasSize to absolute measurements

/ tracingCircleDiameterPct = 65%		//the diameter of the circle in canvas height percentage

/ tracingSquareHeightPct = 65%			//the height of the TracingSquare in canvas height percentage
																				
/ trackWidthPct = 1%					//the width of the tracing track in canvas height percentage						

/ tracingLineWidthPct = 0.5%			//the width of the tracing line (drawn by participant) in canvas height percentage

/ targetZoneDiameterPct = 15%			//the diameter of the target (also start) zone in canvas height percentage