Return to the Effort Discount Task page
___________________________________________________________________________________________________________________	

										Effort Discounting Task
___________________________________________________________________________________________________________________

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 03-22-2018
last updated:  03-13-2020 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 03-13-2020 Millisecond Software
___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	

This script implements a procedure to study cognitive effort in relationship to 
reward. The implemented procedure was used by Botvinich et al (2009) study neural analogues of effort discounting
(the decline of reward value with increasing effort) via fMRI.

Botvinick MM, Huffstetler S, McGuire JT (2009) Effort discounting in human nucleus
accumbens. Cogn Affect Behav Neurosci 9:16–27.

___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________
Participants are presented digits (1-9, no 5) and, depending on the color of the digit, are asked to perform
parity judgments (is BLUE digit odd or even?) or magnitude judgments (is YELLOW digit greater than 5?).
Parity and magnitude judgment trials run under 2 different demand conditions:
1. Low demand condition: no switching between tasks within a block of 10 trials (parity-only, magnitude-only) 
2. High demand condition: alternating between parity and magnitude tasks within a block of 10 trials
At the end of each block, the computer randomly decides (with default constraints) if the block 
should be rewarded or not. 

Rewards are purposefully NOT tied to performance nor demand condition in this task.
Effort in this task is manipulated through different external task demands as opposed to 
performance incentives. As low demand conditions would likely result in higher pay (as they are easier and likely 
result in faster reaction times and lower error rates) performance incentive rewards would likely result in 
different expectancies for low and high demand blocks and therefore might confound 
effort for those two different conditions.

The script runs 20 blocks total (5 parity blocks, 5 magnitude blocks = low demand, 10 alternate blocks = high demand)
and concludes with an optional 'effort/fair pay' survey.

A control condition (see specifics below) can be run by choosing even groupnumbers (odd groupnumbers run the
experimental group).							  
										  
___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 18 minutes to complete

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

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

expcondition:						1 = experimental group; 2 = control group
phase:								"practice" vs. "test"
practiceSessionCount:				counts the number of practice sessions run 
									Note: one practice session runs 1 block parity, 1 block magnitude, 2 blocks alternate
										
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.									
									
count_LD:							counts the number of low demand (parity-only, magnitude-only) blocks run
count_HD:							counts the number of high demand (alternate) blocks run									
demand:								1 = low demand condition; 2 = high demand condition		
cue:								itemnumber of the condition cue (1 = bluedisc (parity); 2 = yellowdisc (magnitude); 3 = mixed disc)
paymentCue:							1 = reward cue ($) should be selected; 2 = non-reward cue (X) should be selected							
paymentDelay:						stores the randomly selected delay of the reward announcement (in ms)

Presented Stim:						for parity/magnitude trials: contains the presented digit
									(for other trials: stores first stimulus to appear)
								
response:							the participant's response (scancode of response button):
									30 = A (left); 
									38 = L (right)
									57 = spacebar
									
correct:							accuracy of response: 1 = correct response; 0 = otherwise
latency: 							the response latency (in ms); measured from: onset of digit

total:								stores the total won during the test session
countRewards_LD:					counts the number of reward blocks in the low demand condition
countRewards_HD:					counts the number of reward blocks in the high demand condition
list.accuracy_practice.mean:		the proportion correct during the practice sessions (across all four blocks of a practice session)



(2) Summary data file: 'effortdiscountingtask_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)
								
expcondition:					1 = experimental group; 2 = control group

practiceSessionCount:			counts the number of practice sessions run 
									Note: one practice session runs 1 block parity, 1 block magnitude, 2 blocks alternate	
	
list.accuracy_practice.mean:	the proportion correct during the practice sessions (across all four blocks of a practice session)
								

Practice Session Count:			counts the number of practice sessions run 
									Note: one practice session runs 1 block parity, 1 block magnitude, 2 blocks alternate
								
PropCorrect Practice:			the proportion correct across the last practice session run (across the 4 blocks)

propCorrect: 					overall proportion correct across all test blocks
meanRT:							mean correct latency (in ms) across all test blocks

propCorrect_parity:				proportion correct across all parity-only test blocks
mean_parity:					mean correct latency (in ms) of parity-only test trials

propCorrect_magnitude:			proportion correct across all magnitude-only test blocks
mean_magnitude:					mean correct latency (in ms) of magnitude-only test trials

propCorrect_LD:					proportion correct across all low demand test blocks			
meanRT_LD:						mean correct latency (in ms) of trials in low demand test blocks

propCorrect_HD:					proportion correct across all alternate (high demand) test blocks			
meanRT_HD:						mean correct latency (in ms) of trials in alternate (high demand) test blocks

optional survey responses (see settings of parameters.runEffortSurvey)

radiobuttons.blockeffort.response:   response to optional effort question (see section Editable Parameters)
										1 = more effort of low demand blocks (same color digits)
										2 = more effort of high demand blocks (different color digits)

radiobuttons.playagain.response:	"yes" vs. "no"	
	
textbox.fairpay_lowdemand.response:			response (in monetary unit) to fair pay to low demand blocks
textbox.fairpay_highdemand.response:		response (in monetary unit) to fair pay to high demand blocks

* 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 task demand conditions: low demand vs. high demand task 
2 experimental condition: experimental group (odd groupnumbers) vs. control group (even groupnumbers)

low demand: only one task is performed (no switching)
- parity: decide if the (blue) digit is odd or even
- magnitude: decide if the (yellow) digit is smaller or greater than 5

high demand: the low demand tasks alternate (the color of the digit is the cue which task to perform);
the starting condition (parity vs. magnitude) is randomly selected

Practice Session(s): 
- one practice session runs: one block parity (10 trials), one block magnitude (10 trials), and 2 blocks alternate (10 trials each)
(= 40 practice trials per session) in random order (constraint: first practice session runs the alternate blocks at the end)
- practice session is repeated if performance across all blocks < 80% correct (default, can be edited under section Editable Parameters)
- practice session ends after a maximum number of 5 repeats (default, can be edited under section Editable Parameters) 
regardless of performance and participants move on to the test
Note: This set-up differs from Botvinick et al (2009)

Test Blocks: 20* test blocks (5 parity, 5 magnitude, 10 alternate = 10 low demand blocks, 10 high demand blocks)
- each block runs 10 trials (digits are randomly chosen)
- each block has a 50/50 reward chance with the following default constraints (Note: can be turned off under section Editable Parameters):
	1. no more than 6 (out of 10) low (high) demand blocks are rewarded
	2. no fewer than 3 (out of 10) low (high) demand blocks are rewarded
	
*Note: Botvinick et al (2009) ran 18 blocks per session. For this script, a block number was selected
that was divisible by 4 to ensure that the same number of parity and magnitude blocks would be run
in the same session.


Block Sequence:
Reminder -> Get Ready (2000-8000ms, randomly sampled from list.delays) 
-> cue trial (2000ms) 
-> 10 Trials (digit stays on for max. 1500 (max responsetime) with an interstimulus interval of 500ms) -> 
Payment Delay (2000-8000ms, randomly sampled from list.delays) -> Reward Notice (2000ms) 
-> interblock interval (2000-8000ms, randomly sampled from list.delays)


Optional 'Effort' Survey:
2 questions: 
(1) effort (order of answer choices is randomly decided)
(2) fair pay for (a)low demand and (b) high demand blocks (position of a/b is randomly determined)


Experimental vs. Control Group: Differences
- experimental group is told that the computer randomly selects at the end of each block
whether the block would be rewarded with pay by announcing "deciding your pay" and then 
presenting an "$" (pay) vs. "X" (no pay).
The control group is told that their participation would be rewarded with $20 at the end of
the task. Instead of the message "deciding your pay" they see "calculating, please wait"
followed "S" and "K". They are told these letters are irrelevant but they should pay
attention nonetheless to not miss the next block.

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

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________
The instructions are provided by by Millisecond Software and are not original to Botvinick et al (2009).
They are presented as text stimuli which can be edited under section Editable Instructions
or as htm-files. The htm-instructions can be edited directly in the htm-files.

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

/runEffortSurvey:			true (1): at the end of the task the participants received questions in regard to 'effort' and 'fair pay' (default)
							false (0): no survey is added to the end of the tas
						
/ digitSize:				the proportional sizing (relative to canvas height) of the digits (default: 15%)
/taskCueSize:				the proportional sizing (relative to canvas height) of the task cue (default: 30%)
/paymentCueSize:			the proportional sizing (relative to canvas height) of the payment cue (default: 20%)

/min_practiceACC:			the minimum proportion correct that needs to be hit before participants can move from
							practice to test session (default: 0.8)
						
/maxPracticeBlockRepeats:	the maximum number practice sessions run before participants moves on to the 
							test regardless of performance (default: 8)						

/reward:					the offered reward (in $) (default: 1)

/paymentConstraints:		false: script randomly decides for each block whether it's a reward or a non-reward block with p(reward) = 0.5
							true (default): script randomly decides for each block whether it's a reward or a non-reward block with p(reward) = 0.5
							with the added constraints that:
							1. no more than 6 (out of 10) low (high) demand blocks are rewarded
							2. no fewer than 3 (out of 10) low (high) demand blocks are rewarded
							(see Botvinick et al, 2009, p.16 for the description of constraints implemented on 18 test blocks)
						
/ctrlPayment:				payment for control condition, paid at the end of the task (default: $20)					

/reminderDuration:			the duration of the task reminders (in ms) that	are presented without key instructions at the beginning of
							each block (default: 2000)
						
/cueDuration:				the duration (in ms) of the cue (default: 2000)
/digitDuration:				the duration (in ms) of the digit (default: 1500); Note: participants have the entire duration to respond
/iti:						the duration (in ms) of the intertrial interval (default: 500)
/paymentCueDuration:		the duration (in ms) of the payment cue (default: 2000)

/parityColor:				stores the color of the parity cue (default: blue)

/magnitudeColor:			stores the color of the magnitude cue (default: gold)
							Note: if the colors are changed, instructions as well as cues need to be updated accordingly

/ leftResponsekey:			the left response key (default: "A")
/ rightResponsekey:			the right response key (default: "L")