Return to the Monetary Incentive Delay Task (GO/NO GO) page
___________________________________________________________________________________________________________________	

								MONETARY INCENTIVE DELAY GONOGO TASK
___________________________________________________________________________________________________________________	

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 09-15-2016
last updated:  03-10-2020 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 03-10-2020 Millisecond Software

Millisecond Software thanks Ricardo Wilhelm for his collaboration on this script!

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements the Monetary Incentive Delay GoNogo Task; a task to induce anticipation of reward and 
punishment within the inhibition and control framework of a go/nogo task. 

The implemented procedure is based on:

Behan, B., Stone, A., and Garavan, H. (2015). Right Prefrontal and Ventral Striatum Interactions
Underlying Impulsive Choice and Impulsive Responding. Human Brain Mapping, 36, 187–198.

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________	
Participants work through a cued gongo task with certain (= always followed by a go target) and uncertain 
(= half followed by a go and half are followed by a nogo target) go cues.
Half the go cues (e.g. all green go cues) result in the possibility of a monetary reward,
half the nogo cues (e.g. all green nogo cues) result in the possibility of a monetary loss.
In a typical trial, participants see a fixation cross followed by a cue (either a square or a circle in 
either blue or green) for a variable time. The target (either a star = go or a stop sign = nogo) follows the cue.
When participants see the star, they have to press the Spacebar as fast as possible. If the color of the cue
was green, they will earn money for a hit response.
When participants see the stop sign, they have to withold the response. If the color of the cue was green,
they will lose money for a false alarm response but gain money for a correct rejection.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 40 minutes to complete

Intro+ Practice: ~ 5min
1 Testblock: ~ 7min (x5)
___________________________
Total: ~40min

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

(1) Raw data file: 'monetaryincentivedelay_gonogo_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
script.sessionid:					with the current session id

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 such as feedback trials. Thus, trialnum 
										may not reflect the number of main trials run per block.
									
										
values.certainGoShape:				the shape of the certain Go shape
values.uncertainGoShape:			the shape of the uncertain Go shape
expressions.rewardColor:			the color of the shapes that get reinforced
expressions.neutralColor:			the color of the reinforcement neutral shapes

values.trialtype:					"MID" (certain cue), "MIDgo" (uncertain cue->go), "MIDnogo" (uncertain cue-> nogo)
values.fixationDuration:			the duration (in ms) of the fixation cross

values.cue:							1 = green square; 
									2 = blue square; 
									3 = green circle; 
									4 = blue circle
									
values.cueShape:					stores the shape of the cue
expressions.cueColor:				stores the color of the cue
values.cueDuration:					the duration (in ms) of the cue
values.reinforcement:				"reward" vs. "neutral"

values.target:						1 = star (go); 
									2 = stop (nogo)
									
values.targetStim:					stores the target image presented
values.GOresponseWindow:			the current response window (in ms) for go trials
response:							the participant's response
correct:							the correctness of the response (1 = correct; 0 = incorrect)
latency: 							the response latency (in ms)

values.feedback:					1 = gain; 
									2 = loss; 
									3 = happy; 
									4 = sad
									
values.feedbackDuration:			the current duration (in ms) of feedback stimulus
values.total:						the total earned


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

computer.platform:					the platform the script was run on (win/mac/ios/android)
script.startdate:					date script was run
script.starttime:					time script was started
script.subjectid:					assigned subject id number
script.groupid:						assigned group id number
script.sessionid:					assigned session id number
script.elapsedtime:					time it took to run script (in ms); measured from onset to offset of script
script.completed:					0 = script was not completed (prematurely aborted); 
									1 = script was completed (all conditions run)

values.certainGoShape:				the shape of the certain Go shape
values.uncertainGoShape:			the shape of the uncertain Go shape
expressions.rewardColor:			the color of the shapes that get reinforced
expressions.neutralColor:			the color of the reinforcement neutral shapes

expressions.propCorrect:			proportion correct response across all go and nogo trials
expressions.meanRT:					mean hit latency (in ms) across all go trials
expressions.SD:						standard deviation of all hit latencies (across all go trials)

"MID" (certain cue), "MIDgo" (uncertain cue->go), "MIDnogo" (uncertain cue-> nogo)

expressions.omissions_MID:			number of omission errors in MID trials
expressions.r_ommission_MID:		omission error rate in MIDgo trials
expressions.omissions_MIDgo:		number of omission errors in MIDgo trials
expressions.r_omission_MIDgo:		omission error rate in MIDgo trials
expressions.commissions_MIDnogo:	number of commission errors in MIDnogo trials
expressions.r_commission_MIDnogo:	commission error rate in MIDnogo trials

expressions.meanRT_MID:				mean hit latency (in ms) in MID trials
expressions.SD_MID:					standard deviation of all MID hit latencies
expressions.meanRT_MIDgo:			mean hit latency (in ms) in MIDgo trials
expressions.SD_MIDgo:				standard deviation of all MIDgo hit latencies

* 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 
___________________________________________________________________________________________________________________

2 cue shapes (square vs. circle):
- certain cue (here: square)
- uncertain cue (here: circle)

2 cue reward colors (green vs. blue)
- monetary reinforced (reward, here: green)
- no monetary reinforcement (neutral, here: blue)

6 trial types:
MID_reward: certain go cue, can result in a monetary gain but no monetary loss
MID_neutral: certain go cue, cannot result in a monetary gain nor in a monetary loss
MIDgo_reward: uncertain go cue with go target, can result in a monetary gain but no monetary loss
MIDgo_neutral: uncertain go cue with go target, cannot result in a monetary gain nor in a monetary loss
MIDnogo_reward: uncertain go cue with nogo target, can result in a monetary loss OR a monetary gain
MIDnogo_neutral: uncertain go cue with nogo target, cannot result in a monetary loss nor in a monetary gain

1. Practice Block: 12 trials (2 of each trialtype)
2. 5 Test Blocks of 30 trials (5 of each trialtype) = 150 test trials total 
(number of testblocks/number of trials per block are editable under section Editable Parameters)
- the order of the 6 trial types is randomized 

!!!Note: the script is set up in such a way that the following constraints can be imposed on the sampling process:
	- no repeats of the same trials
	- A MIDgo_reward and MIDnogo_reward trials are not presented one after another
	- A MIDgo_neutral and MIDnogo_neutral trials are not presented one after another
Since sampling is done on the fly - in some circumstances not all constraints might be fulfilled.
To add those constraints, go to list.MIDrunTrialOrder under section 'BLOCKS' and follow instructions.


- 6 different fixation cross durations/cue durations are used an equal number of times within each block (see section Editable Lists)
- go target duration (= variable response window): starts at 400ms and decreases by 50ms with each hit and increases by 50ms with each miss
- nogo target duration (= constant response window): stays at 600ms
- go feedback: duration + last responsewindow = 2000ms
- nogo feedback: duration + last responsewindow = 2000 (because responsewindow stays constant, feedback duration stays constant)

Trial Sequence:
fixation cross (btw. 2.2s-7.5s) -> cue (btw. 2.5s-7.5s) -> target (go target: dynamically adapted response window; nogo target: 600ms response window)-> feedback (go feedback: dynamically adapted duration ; nogo feedback; 1400ms)

___________________________________________________________________________________________________________________
STIMULI
___________________________________________________________________________________________________________________
provided by Millisecond Software, see section Editable Stimuli

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________
provided by Millisecond Software in the form of htm-files, see 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:
/goKey:							the go-response key (default: " " -> Spacebar)

/fixationSize:					proportional sizing of fixation cross (default: 5% of canvas height)
/cueSize:						proportional sizing of cue size (default: 20% of canvas height)
/targetSize:					proportional sizing of target size (default: 20% of canvas height)
/feedbackSize:					proportional sizing of feedback image size (default: 20% of canvas height)

/startGOresponseWindow:			start duration (in ms) of go response window (default: 400ms)
/NOGOresponseWindow:			constant duration (in ms) of nogo response window (default: 600ms)
/goRW_adjustment:				duration adjustment (in ms) of the go response window (default: 50ms)

/defaultFeedbackDuration:		default feedback duration (in ms) (default: 1400ms)
									Note: the feedback duration will get increased by the current response window

/monetaryGain:					the monetary gain for a go hit/nogo correction rejection in the reward condition (default: 0.2)
/monetaryLoss:					the monetary loss for a nogo false alarm in the reward condition (default: 0.4)


/numberOfTestBlocks:			sets the number of test blocks run (default: 5)

/numberOfTestTrials:			sets the number of test trials run per test block (default: 30)
									Note: needs to be a multiple of 6