User Manual: Inquisit Change Detection Task


___________________________________________________________________________________________________________________	

											*Change Detection Task*
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 11-25-2020
last updated:  09-30-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright ©  09-30-2024 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	

This script implements a Change Detection Task, a measure of Visual Working Memory.
The implemented procedure is based on Harris et al (2020).

Reference:
Harris, A.M et al (2020). Behavioral and electrophysiological evidence for a dissociation between 
working memory capacity and feature-based attention. Cortex, 129, 158-174.
(Change Task Description: p.160-161)

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________	

Participants view short displays of 4/6/8 colorful squares that are followed by a single probe square
located in one of the display square's positions. Participants have to decide if the color of the probe
is the same or different than the color of the square that previously sat in the probe's location.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 12 minutes to complete
___________________________________________________________________________________________________________________	
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________		
The fields in the data files are:

(1) Raw data file: 'changedetectiontask_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

###Design Parameters
runFixedDesign: true				true (1) = the fixed design (with default trial lists -> default square positionscolors) will be run
									false (0) = the script will generate new lists (new square positioncolors) during runtime at the start of the script

useOnlyArrayColorsForProbe:			true (1) = the color of the different probe is only sampled from the colors used in the preceding array
									false (0) = the color of the different probe is sampled from all 6 colors (that are not used for the target square)

presentationSquareHeight:			the proportional size of the 'invisible' gray presentation square relative to canvas height
									Note: the default squares are presented in an 'invisible' gray square of size 80%
									
squareHeight:						the proportional size of the array squares relative to canvas height
									Note: the default square locations were generated with 'squareHeight' = 15%	
									
squareHeightMM:					the absolute size (in mm) of the presented array squares on the current monitor		

																		
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. 
										
n:									the current number of squares presented (array size)
index:								helper variable to select square positionscolors; default setting is by sequential selection

trialType:							1 = same (probe color is the same as the color of the square that was presented in the same location)
									2 = different (probe color is different from the color of the square that was presented in the same location)

response:							scancode of response button
									31 = S; 32 = D
									
responseCategory:					'same' or 'different' 

correct:							1 = response was correct; 0 = response was incorrect 
latency:							response time in ms; measured from onset of probe

###the proportional square positions (horizontal: 0%(left)-100%(right); vertical: 0%(top) to 100%(bottom))
x1, y1, 
x2, y2,
x3, y3,
x4, y4,
x5, y5,
x6, y6,
x7, y7,
x8, y8,

###square colors
color1, color2, color3, color4,
color5, color6, color7, color8,

###probe:
probe:								the square location that the probe occupies (for level4; 1-4; for level6: 1-6; for level8: 1-8)
probeX:							the horizontal coordinate of the probe (should match with coordinates of the square location that the probe occupies)
probeY:							the vertical coordinate of the probe (should match with coordinates of the square location that the probe occupies)
probeColor:							the color of the probe


###Square Distance Check Variables: store the distances btw. the individual array squares
bufferPX:						the square distance buffer in pixels 
bufferMM:						the square distance buffer converted into mm

squareDistanceCheck: 				1 = all array square distances >= expressions.minDistPX
									0 = at least one distance < expressions.minDistPX 
									(should not happen but in some cases rounding errors might lead to 'false positive' alerts.
									Squares might have overlapped if: pixel distance < (minDistPX-bufferPX) 
									
overlapSuccess:						similar to expressions.squareDistanceCheck, but 
									pixel distance < (minDistPX-bufferPX)
									0 = overlap 
									1 = no overlap
																																										
minDistPX:						the minimum distance (in pixel) that squares should be apart
minDistMM:						the minimum distance (in mm) that the square should be be apart

d12-d78:							the pixel distance between each presented square
									Example: d12 = pixel distance btw. center of square1 and center of square2
									
minObservedSquareDistancePX:	minimum observed pixel distance of the squares 
maxObservedSquareDistancePX:	maximum observed pixel distance of the squares
minObservedSquareDistanceMM:	minimum observed mm-distance of the squares 
maxObservedSquareDistanceMM:	maximum observed mm-distance of the squares									


(2) Summary data file: 'changedetectiontask_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:									
runFixedDesign: true				true (1) = the fixed design (with default trial lists -> default square positionscolors) will be run
									false (0) = the script will generate new lists (new square positioncolors) during runtime at the start of the script

useOnlyArrayColorsForProbe:			true (1) = the color of the different probe is only sampled from the colors used in the preceding array
									false (0) = the color of the different probe is sampled from all 6 colors (that are not used for the target square)

presentationSquareHeight:			the proportional size of the 'invisible' gray presentation square relative to canvas height
									Note: the default squares are presented in an 'invisible' gray square of size 80%
									
squareHeight:						the proportional size of the array squares relative to canvas height
									Note: the default square locations were generated with 'squareHeight' = 15%	
									
squareHeightMM:					the absolute size (in mm) of the presented array squares on the current monitor



###Performance Data:										
									
propCorrect:						overall proportion correct (across all conditions)
meanCorrRT:							mean response time (in ms) for correct responses; across all conditions

k4:									K-score for level n trials calculated as = (n4HitRate + n4CRrate - 1)*4							 
n4HitRate:							the HitRate for level n signal (=same) trials (hit = correctly responding that color was the same ) 
n4HitRT:							the response time (in ms) for hits 
n4CRRate:							the correct rejection rate for level n noise (=different) trials (CR = correctly responding that color was different) 
n4CRRT:							the mean response time (in ms) for correct rejections

(same for level6 and level8 trials)

kOverall:							the unweighted mean of all three K-scores		
							
* separate data files: to change to one data file for all participants (on Inquisit Lab only), go to section
"DATA" and follow further instructions

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

3 array sizes (4, 6, 8) are tested in a blocked design. 
- by default, all participants work from smallest (4) to largest (8) array size
- by default all trial configurations (square locations/color, probe location/color) within an array size 
are run in a fixed sequence* (see parameters.runFixedDesign under Editable Parameters)

Each level:
- 6 practice trials (fixed sequence) - half the trials present the probe in the same color
- 60 test trials (fixed sequence) - half the trials present the probe in the same color
- all trials provide feedback
- probe Position: the position of the probe is randomly selected
- Display Square Colors: the colors of the display squares are randomly selected (without replacement)
from 7 possible colors:  "white", "black", "purple", "green", "red", "blue", yellow 
(Note: for level8 trials, one randomly selected color is repeated) - see Harris et al (2020)
- Probe Color: the probe color for 'different' trials is either 
a) selected from the remaining 6 colors 
(in which case the probe can have colors not presented during the display for level4/6 trials)
b) selected from the remaining colors of the displayed squares (DEFAULT setting in this script, see Editable Parameters)

Trial Sequence:
- array presented for 150ms (editable parameter) in an 'invisible' gray square on a gray background
- gray screen alone presented for 900ms (editable parameters) - retention interval
- probe is presented until response 
- iti (blank gray screen) with feedback is presented for 500ms (editable parameters)


*Generation of default/fixed trial configurations:
The default fixed trial configurations were generated with square sizes of size 15% canvasheight
within a presentation square of 80% canvasheight size and a 'square buffer' of 2% of canvasheight

TIP: to generate a new fixed sequence, you can run this script once with parameter.runFixedDesign = false
and copy the randomly generated position/color data from the data file into the corresponding 
position/color lists under section LISTS
If needed:
-> you can change the size of the 'invisible' gray presentationsquare under Editable Parameters 
-> you can change the size of the display squares under Editable Parameters
(Note: the max square size is 15%; this script automatically downsizes greater sizes to 15%)
___________________________________________________________________________________________________________________
STIMULI
___________________________________________________________________________________________________________________

The stimuli in this script are presented with proportional sizing relative to the active canvas.
The active canvas determined for this script is the largest possible rectangle of width:height = 4:3
that can be found on the current monitor. For square sizing check section Editable Parameters below.

If absolute sizing is needed (stimuli should have the same absolute size across monitors), 
check section DEFAULTS for more information.
___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
provided by Millisecond Software - can be edited under section Editable Instructions
___________________________________________________________________________________________________________________	
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: