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 abba

# based on the paradigm of Stoet & Hommel 1999

options
  set &delay1     750  # how long the first stimulus is being shown
  set &delay2     3000 # how long the delay between stimulus 1 and 2 is
  set &errordelay 2000 # how long the error message is displayed for
  bitmapdir stimuli

fonts
  arial 18

bitmaps
  planleft1
  planright1
  planleft2
  planright2
  pressleft
  pressright
  cue
  instruction1
  instruction2
  instruction3
  instruction4
  fix1
  fix2
  fix3
  errormsg
  welldone
  tooslow
  wrongkeys
  readyrealblock
  readytrainingblock

# @1: planned response A, immedeate response B (as letter L,R),
# immedeate response as number (1,2), number of responses in response
# A

table abba_table
  "L L 1 1" planleft1  3 1 pressleft   1
  "L L 1 2" planleft2  3 2 pressleft   1
  "L R 2 1" planleft1  3 1 pressright  2
  "L R 2 2" planleft2  3 2 pressright  2
  "R L 2 1" planright1 4 1 pressleft   1
  "R L 2 2" planright2 4 2 pressleft   1
  "R R 1 1" planright1 4 1 pressright  2
  "R R 1 2" planright2 4 2 pressright  2

task abba
  table abba_table
  keys a l s k
  delay 1000 # intertrial interval
  set $tmpcheck 0 # a help variable for checking the memorized response later on
  set $trialcorrect 0 # if 1, then all responses in trial were correct
  ### animated fixpoint
  show bitmap fix1
  delay 150
  show bitmap fix2
  delay 150
  show bitmap fix3
  delay 150
  clear 3
  delay 150
  clear 2
  delay 150
  clear 1
  delay 150
  ###
  show bitmap @2
  delay &delay1
  clear -1
  delay &delay2
  show bitmap @5
  readkey @6 1000
  set $rt1     RT
  set $status1 STATUS
  clear -1
  if $status1 == WRONG ## response 1
    show bitmap errormsg
    show bitmap wrongkeys 0 -200
    delay &errordelay
    clear -1 -2
  fi
  if $status1 == TIMEOUT ## response 1
    show bitmap errormsg
    show bitmap tooslow  0 -200
    delay &errordelay
    clear -1 -2
  fi
  ## now, only if the first was correct contininue with getting further responses
  if $status1 == CORRECT
    ###
    show bitmap cue
    ### ---------------> now wait for one or two key presses
    readkey @3 1000
    set $rt2 RT
    set $status2 STATUS
    readkey @3 400 ## should actually result in timeout if only 1 button press needed
    set $rt3 RT
    set $status3 STATUS
    ### ---------------> now process correctness
    if @4 == 2 && $status3 == CORRECT #
      set $tmpcheck 1 ## this means, 2nd button required and correct
    fi
    if @4 == 1 && $status3 == TIMEOUT #
      set $tmpcheck 1 ## this means, subject pressed twice, but should only have memorized once
    fi
    if $status2 != CORRECT || $tmpcheck == 0
      clear -1 # remove cue from screen
      show bitmap errormsg
      delay &errordelay
      clear -1
    fi
    if $status2 == CORRECT && $tmpcheck == 1 # positive feedback
      show bitmap welldone
      delay &errordelay
      set $trialcorrect 1
    fi
  fi
  save @1 $rt1 $rt2 $rt3 $status1 $status2 $status3 &delay1 &delay2 $trialcorrect

block training
  pager instruction1 instruction2 instruction3 instruction4
  message readytrainingblock
  clear screen
  tasklist
    abba 10
  end

block for_real
  message readyrealblock
  clear screen
  tasklist
    abba 100
  end
  feedback
    text align left
    set &MyMean mean c5       ; select c13 == 1
    set &Compatible mean c5   ; select c13 == 1 && c3 == 1
    set &Incompatible mean c5 ; select c13 == 1 && c3 == 2
    set &EffectSize expression &Incompatible - &Compatible
    text -380 -50 &MyMean       ; prefix "Average response speed of first response                       : " ; postfix " ms"
    text -380 -10 &Compatible   ; prefix "Average response speed of first response in compatible trials  : " ; postfix " ms"
    text -380  30 &Incompatible ; prefix "Average response speed of first response in incompatible trials: " ; postfix " ms"
    text -380 100 &EffectSize   ; prefix "Incompatible - Compatible response speed: " ; postfix " ms"
    text    0 200 "Press space bar to continue"
  end