User Manual: Inquisit Nasa Dragging Task


___________________________________________________________________________________________________________________	

								*Dragging Task*
								(optimized for the ipad)
___________________________________________________________________________________________________________________	


Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 01-07-2022
last updated:  05-24-2022 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 05-24-2022 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements Millisecond Software's version of the NASA developed 'Dragging Task',
which measures manual dexterity, or the speed of arm movements.

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 Drag test measures manual dexterity, or the speed of arm movements. The task is to push
(i.e., place finger or stylus on a square and drag) a white square back and forth or up and down
from one designated area on the screen to another. Each block contained 16 trials."
___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 10 minutes to complete (~5min per horizontal/vertical orientation)

___________________________________________________________________________________________________________________	
DATA FILE INFORMATION 
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw data file: 'draggingtask_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 (winmaciosandroid)
date, time: 					date and time script was run 
subject, group: 				with the current subject/groupnumber
session:						with the current session id

parameters- DraggingMechanism:	"finger" vs. "stylus" 
parameters- DraggingHand:		"dominant" vs. "nondominant" vs. "left" vs. "right"

//Play Setup:
(parameter) runAbsoluteSizes:	true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm)
								false (0) = should use proportionally sized canvas (uses width = 43*screenHeight)
								
canvasAdjustments:				NA: not applicable => parameters- runAbsoluteSize was set to 'false'
								0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough
								1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and 
								adjustments had to be made

playareaHeight_inmm:			the width of the play area in mm 
playareaWidth_inmm:				the height of the play area in mm 
squareHeight_inmm:				the size of the square in mm 
distance_wallToWall_inmm:		the distance between left (top) and right (bottom) wall (from center of wall to center of wall) in mm
wall_width_inmm:				the length of the short side of the wall in mm
wall_height_inmm:				the length of the long side of the wall in mm

display.canvasHeight:			the height of the active canvas ('playarea') in pixels
display.canvasWidth:			the width of the active canvas ('playarea') in pixels

px_per_mm:						the conversion factor to convert pixel data into mm-results for the current monitor
								(Note: the higher resolution of the current monitor 
								the more pixels cover the same absolute screen distance)
								This factor is needed if you want to convert pixel data into absolute mm data								

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 in the current condition
DraggingDirection: 				"horizontal" vs. "vertical"
conditionRepetition:			counts the number of times the current condition has run									
																		
trialCounter:					counts the number of trials in a block
								one trial: one right to left AND left to right swipe (same for vertical movement)

stimulusitem:					presented stimuli
response:						the response of participant (the valid drop-off response area)

latency:						response latency (in ms); measured from: onset of trial until the lift-off response 
								on the currently valid response area is registered.
								Note: if the drop-off happens not in the valid response area, the wall does NOT
								change colors

//break down of latency:											
RT_movementInitiation:			the time in ms from beginning of trial until the square was grabbed
rt_dragtime:					the time in ms that the square was dragged until a valid drop was achieved											
																																											
mouse.x:						the horizontal mousefinger coordinate at square drop-off (in valid drop-off)												
mouse.y:						the vertical mousefinger coordinate at square drop-off	(in valid drop-off)	

//HO = horizontal orientation
HO_optimalline_y_inpx:			the optimal y-coordinate in the Horizontal Orientation Condition (= y-coordinate of the white square at start of each trial)
								(= if participant does not diverge from this coordinate, they use the fastest way from A to B)
								Note: this optimal line depends on where the square is dropped off. In this script it is NOT
								automatically the center line but is reset to the drop-off coordinates

HO_optimalLine_divergence_dropoffonly_inpx:  calculates the absolute pixel difference btw. 
											(HO_optimalline_y_inpx - mouse.y) at drop-off only									
(also conversion to mm)											
											
																					
//VO = vertical orientation											
VO_optimalline_x_inpx:			the optimal x-coordinate in the Vertical Orientation Condition (= x-coordinate of the white square at start of each trial)
								(= if participant does not diverge from this coordinate, they use the fastest way from A to B)

VO_optimalLine_divergence_dropoffonly_inpx:  calculates the absolute pixel difference btw. (VO_optimalline_x_inpx - mouse.x)
											 at drop-off only

										
//based on streaming data (these measures might give a more detailed picture of the dragging performance):

//HO = horizontal orientation	
median_HO_optimalLineDivergence_pertrial_inpx:	the median vertical distance (in canvas pixels) of the finger from the 
												'optimal' y-coordinate from pick-up to drop-off
												
mean_HO_optimalLineDivergence_pertrial_inpx:	the mean vertical distance (in canvas pixels) of the finger from the 
												'optimal' y-coordinate from pick-up to drop-off
																						
sd_HO_optimalLineDivergence_pertrial_inpx:		the mean standard deviation of the vertical distance (in canvas pixels) 
												btw. the finger and 'optimal' y-coordinate from pick-up to drop-off
																						
												Note: 'optimal' in this sense means the y-coordinate of the square at
												the start of the trial. Moving the square along this y-coordinate
												is the shortest (thus fastest) way btw. the walls.
											
//VO = vertical orientation	
same for vertical orientation											


(2) Summary data file: 'draggingtask_summary*.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)

parameters- DraggingMechanism:	"finger" vs. "stylus" 
parameters- DraggingHand:		"dominant" vs. "nondominant" vs. "left" vs. "right"

//Play Setup:
(parameter) runAbsoluteSizes:	true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm)
								false (0) = should use proportionally sized canvas (uses width = 43*screenHeight)
								
canvasAdjustments:				NA: not applicable => parameters- runAbsoluteSize was set to 'false'
								0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough
								1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and 
								adjustments had to be made
								
display.canvasHeight:			the height of the active canvas ('playarea') in pixels
display.canvasWidth:			the width of the active canvas ('playarea') in pixels

px_per_mm:						the conversion factor to convert pixel data into mm-results for the current monitor
								(Note: the higher resolution of the current monitor 
								the more pixels cover the same absolute screen distance)
								This factor is needed if you want to convert pixel data into absolute 'mm' data
								to compare data across screens

playareaHeight_inmm:			the width of the play area in mm 
playareaWidth_inmm:				the height of the play area in mm 
squareHeight_inmm:				the size of the square in mm 
distance_wallToWall_inmm:		the distance between left (top) and right (bottom) wall (from center of wall to center of wall) in mm
wall_width_inmm:				the length of the short side of the wall in mm
wall_height_inmm:				the length of the long side of the wall in mm


//Latency Performance (based on draggingRT only):
medianRT_LR:		median time (in ms) it took participant to move from left to right (and drop off square in appropriate wall space)
meanRT_LR:			mean time (in ms) it took participant to move from left to right (and drop off square in appropriate wall space)
sdRT_LR:			standard deviation of mean time (in ms) it took participant to move from left to right (and drop off square in appropriate wall space)

medianRT_RL:		median time (in ms) it took participant to move from right to left (and drop off square in appropriate wall space)
meanRT_RL:			mean time (in ms) it took participant to move from right to left (and drop off square in appropriate wall space) 
sdRT_RL:			standard deviation of mean time (in ms) it took participant to move from right to left (and drop off square in appropriate wall space)

medianRT_h:			median time (in ms) it took participant to move one side to the other in horizontal condition (and drop off square in appropriate wall space)
meanRT_h:			mean time (in ms) it took participant to move one side to the other in horizontal condition (and drop off square in appropriate wall space)
sdRT_h:				standard deviation of mean time (in ms) it took participant to move one side to the other (and drop off square in appropriate wall space)

medianRT_TB:		median time (in ms) it took participant to move from top to bottom (and drop off square in appropriate wall space)
meanRT_TB:			mean time (in ms) it took participant to move from top to bottom (and drop off square in appropriate wall space)
sdRT_TB:			standard deviation of mean time (in ms) it took participant to move from top to bottom (and drop off square in appropriate wall space)

medianRT_BT:		median time (in ms) it took participant to move from bottom to top (and drop off square in appropriate wall space) 
meanRT_BT:			mean time (in ms) it took participant to move from bottom to top (and drop off square in appropriate wall space) 
sdRT_BT:			standard deviation of mean time (in ms) it took participant to move from bottom to top (and drop off square in appropriate wall space)

medianRT_v:			median time (in ms) it took participant to move one side to the other in vertical condition (and drop off square in appropriate wall space)
meanRT_v:			mean time (in ms) it took participant to move one side to the other in vertical condition (and drop off square in appropriate wall space)
sdRT_v:				standard deviation of mean time (in ms) it took participant to move one side to the other (and drop off square in appropriate wall space)


//Movement Performance (Divergence from optimal path):
//!!!IMPORTANT: different screens differ in their resolution (pixel density)
//To convert them into absolute 'mm' units, use 'px_per_mm'
//Example:'median_HO_optimalLineDivergence_dropoff_inpx * px_per_mm = median_HO_optimalLineDivergence_dropoff_inmm'

//based on drop-off coordinates only 
(Note: each trial compares the drop-off y-coordinate to the starting y-coordinate; 
these divergence measures ignore the intermediate movements)
median_HO_optimalLineDivergence_dropoff_inpx:		median pixel distance from drop-off coordinate to optimal line
mean_HO_optimalLineDivergence_dropoff_inpx:			mean pixel distance from drop-off coordinate to optimal line
sd_HO_optimalLineDivergence_dropoff_inpx:			standarddeviation of the pixel distance from drop-off coordinate to the optimal line


//Movement Performance:
(based on streaming data, the divergence from the optimal y-coordinate is continuously monitored; not just at the end)


//Horizontal Orientation (HO):
median_HO_optimalLineDivergenceMean_inpx:	overall median distance (in canvas pixels) of the finger from the 'optimal' y-line 
											(based on all trial means)
											
mean_HO_optimalLineDivergenceMean_inpx:		overall mean distance (in canvas pixels) of the finger from the 'optimal' y-line 
											(averaged across all trial means)
																						
mean_HO_optimalLineDivergenceSD_inpx:		the overall mean (in canvas pixels) of all the 
											trial standarddeviations of the vertical distances 
											btw. the finger and the 'optimal' y-line
											
											Note: 'optimal' in this sense means the y-coordinate of the square at
											the start of the trial. Moving the square along this y-coordinate
											is the shortest (thus fastest) way btw. the walls.	
											
(same for VO - Vertical Orientation conditions)											
											
	
(3) Mouse Coordinates file: 'draggingtask_stream*.iqdat' (a separate file for each participant)
Note: this data file stores data every ~17ms (=> records a line of data every ~17ms)

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

parameters- DraggingMechanism:	"finger" vs. "stylus" 
parameters- DraggingHand:		"dominant" vs. "nondominant" vs. "left" vs. "right"

//Play Setup:
(parameter) runAbsoluteSizes:	true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm)
								false (0) = should use proportionally sized canvas (uses width = 43*screenHeight)
								
canvasAdjustments:				NA: not applicable => parameters- runAbsoluteSize was set to 'false'
								0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough
								1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and 
								adjustments had to be made

playareaHeight_inmm:			the width of the play area in mm 
playareaWidth_inmm:				the height of the play area in mm 
squareHeight_inmm:				the size of the square in mm 
distance_wallToWall_inmm:		the distance between left (top) and right (bottom) wall (from center of wall to center of wall) in mm
wall_width_inmm:				the length of the short side of the wall in mm
wall_height_inmm:				the length of the long side of the wall in mm

display.canvasHeight:			the height of the active canvas ('playarea') in pixels
display.canvasWidth:			the width of the active canvas ('playarea') in pixels

px_per_mm:						the conversion factor to convert pixel data into mm-results for the current monitor
								(Note: the higher resolution of the current monitor 
								the more pixels cover the same absolute screen distance)

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. 
										
										
trialCounter:					counts the number of trials in a block
								one trial: one right to left AND left to right swipe (same for vertical movement)
								
startComputing:					0 = the square has not been grabbed yet on the gray wall
								1 = the square has been grabbed (though might still be on gray wall) and performance data should be collected from this point on

//response (time) data//

rsp:							1 = a down or up response was made
								0 = no down or up response was made

respStatus:						the data file will note 'down' and 'up' responses
								down = participants moved the finger down to grab the square
								up-miss = the square was dropped somewhere on the canvas (but not on the target wall)
								up-partial-miss = the square was dropped partially on the target wall
								up-corrected = the square was correctly dropped on the target wall after previously making an a (partially) missed drop
								up = the square was correctly dropped on the target wall without any previous errors 

RespRT_ms:						the response time for the current response
								Example: 
								first 'down' response: by definition this response time is 0 as measurements start with grabbing the square for the first time on the gray wall
								all 'up' responses: RespRT_ms will store the time it took from previously grabbing the square until dropping it at the current location
								'down' (after error response): stores the time it took participant to grab the stimulus again after erroneously dropping it somewhere on the canvas
								Ideally, participants' records show one 'down' response, followed by an 'up' response.

SumRespRT_ms:					sum of all RespRT_ms in a block

//pathway data//																								
mouse.x:						the current horizontal mousefinger coordinate												
mouse.y:						the current vertical mousefinger coordinate

lastDown:						the critical down coordinate from the last down response
								horizontal dragging: the critical down coordinate is the x-coordinate
								vertical dragging: the critical down coordinate is the y-coordinate	
								
Dst_inpx:						calculates distance travelled from last 'down' response to current 'up' response
								horizontal dragging: the distance only takes into account horizontal coordinate changes
								vertical dragging: the distance only takes into account vertical coordinate changes

HO_optimalline_y_inpx:			the optimal y-coordinate (= y-coordinate of the white square at start of each trial)
								(= if participant does not diverge from this coordinate, they use the fastest way from A to B)
								Note: this optimal line depends on where the square is dropped off. In this script it is NOT
								automatically the center line but is reset to the drop-off coordinates
											
HO_optimalLine_divergence_inpx:	the current divergence (in pixels) from the optimal y-coordinate (measured roughly every 16ms or so)
(same for VO condition)
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

By default, this script runs 2 conditions (horizontal vs. vertical) with 1 repetition per condition:
The order of 2 conditions is selected at random.

Horizontal Orientation:
* 6 blocks of 16 trials per block (16 left-to-right and 16 right-to-left trials; one trial is a successful left and right movement)
* start direction: right-to-left
There is a short break inbetween each block

Vertical Orientation:
* 6 blocks of 16 trials per block (16 top-to-bottom and 16 bottom-to-top trials; one trial is a successful up and down movement)
=> start direction: bottom-to-top
There is a short break inbetween each block

By default, participants receive optional performance feedback at script conclusion.

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

You can easily customize the experimental design by changing them.

***Task***
Square needs to grabbed from the gray wall and dropped off within the blue wall otherwise 
the wall doesn't change from blue to gray and the script still waits for a valid drop-off

-The script records the time it takes participants to grap the square and
how long the dragging movement takes
-script continuously logs the divergence from the optimal dragging line in px and mm
as well as all 'down' ('grab') and 'up' ('drop') responses made
- in the streaming data file, the responses (down-up are recorded)
___________________________________________________________________________________________________________________	
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 the ones published in 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: