How to use

This is the main source code for the experiment. If you want to use it, you should copy the actual zip file to your own PsyToolkit account, because often there are other files included for stimuli.

The source code for negative_priming

options
  bitmapdir stimuli

## in the stroop stimuli, the filename is WORD+font color
## thus: yellowred is the work "yellow" in red color

bitmaps
  titlepage
  instruction1
  instruction2
  instruction3  
  start_block1
  start_block2
  start_block3  
  correct
  mistake
  fixpoint
  yellowgreen  
  yellowblue   
  yellowred    
  redyellow    
  redgreen     
  redblue      
  greenyellow  
  greenblue    
  greenred     
  blueyellow   
  bluegreen    
  bluered      

fonts
  arial 18

# table: write condition,stimulus,response

table training
  "red square    " 255 0 0 1
  "yellow square " 255 255 0 4
  "blue square   " 30 144 255 3
  "green square  " 0 255 0 2
  
table neutral
  "red blue    " redblue      3
  "yellow green" yellowgreen  2
  "green blue  " greenblue    3
  "red yellow  " redyellow    4
  "blue green  " bluegreen    2
  "yellow red  " yellowred    1
  "yellow blue " yellowblue   3
  "green red   " greenred     1  
  "blue yellow " blueyellow   4
  "red green   " redgreen     2  
  "green yellow" greenyellow  4
  "blue red    " bluered      1

table negative
  "yellow green" yellowgreen  2
  "green yellow" greenyellow  4
  "red green   " redgreen     2
  "blue red    " bluered      1
  "yellow blue " yellowblue   3
  "red yellow  " redyellow    4  
  "green red   " greenred     1
  "blue green  " bluegreen    2
  "red blue    " redblue      3
  "yellow red  " yellowred    1
  "blue yellow " blueyellow   4
  "green blue  " greenblue    3

task neutralpriming
  table neutral
  part rest_of_task

task negativepriming
  table negative
  part rest_of_task

part rest_of_task
  keys r g b y
  delay 500
  show bitmap fixpoint # stimulus 1
  delay 200
  clear 1 # remove fixpoint 
  delay 100
  show bitmap @2 # stimulus 2
  readkey @3 2000
  clear 2 # remove stimulus 2
  if STATUS == CORRECT
    show bitmap correct # stimulus 3 (feedback)
  fi
  if STATUS != CORRECT  # stimulus 3 (feedback)
    show bitmap mistake
  fi
  delay 500
  clear 3 # remove feedback stimulus
  save BLOCKNAME BLOCKNUMBER @1 TABLEROW KEY STATUS RT

task colortraining
  table training
  keys r g b y
  delay 500
  show bitmap fixpoint # stimulus 1
  delay 200
  clear 1 # remove fixpoint 
  delay 100
  show rectangle 0 0 100 50   @2 @3 @4
  readkey @5 2000
  clear 2 # remove stimulus 2
  if STATUS == CORRECT
    show bitmap correct # stimulus 3 (feedback)
  fi
  if STATUS != CORRECT  # stimulus 3 (feedback)
    show bitmap mistake
  fi
  delay 500
  clear 3 # remove feedback stimulus
  save BLOCKNAME BLOCKNUMBER @1 TABLEROW KEY STATUS RT

block training
  message titlepage
  message instruction1
  message instruction2
  message instruction3  
  message start_block1
  tasklist
    colortraining 20
  end

block neutral
  message start_block2
  tasklist
    neutralpriming 12 fixed  # run the neutral stimuli
  end

block negative
  message start_block3
  tasklist
    negativepriming 12 fixed  # run the neutral stimuli
  end
  feedback
    set &Training mean c8 ; select c2 == 1 && c7 == 1
    set &Neutral  mean c8 ; select c2 == 2 && c7 == 1
    set &Negative mean c8 ; select c2 == 3 && c7 == 1    
    set &Difference expression &Negative - &Neutral
    text 0 -225 "Your speed..."
    text 0 -125 &Training ;  prefix "in training block (block 1): "
    text 0 -25  &Neutral ;  prefix "in neutral condition (block 2): "
    text 0 75    &Negative ;  prefix "in negative priming condition (block 3): "
    text 0 175  &Difference ; prefix "Difference is: "
    text 0 275 "Press space key to end"
  end