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 stroop_de
options
background color grey
# table columns:
# 1) The word as shown on screen. You can change this to different languages
# 2) We use a number for colors, 1=red, 2=green, 3=blue, 4=white
# 3) 1=congruent (word meaning matches color). 2=incongruent (no match)
#
# NOTE: the textcolor (column 2) is the same as the required key
table stroop
"ROT" 1 1 ## red
"ROT" 1 2 ## red
"GRÜN" 2 1 ## green
"GRÜN" 2 2 ## green
"BLAU" 3 1 ## blue
"BLAU" 3 2 ## blue
"WEISS" 4 1 ## white
"WEISS" 4 2 ## white
fonts
normal arial 20
big arial 80
part what_should_be_pressed
font normal
if &textcolor == 1
show text "Du solltest die R Taste gedrückt haben" 0 100
show text "weil die Zeichenfarbe ROT war" 0 150
fi
if &textcolor == 2
show text "Du solltest die G Taste gedrückt haben" 0 100
show text "weil die Zeichenfarbe GRÜN war" 0 150
fi
if &textcolor == 3
show text "Du solltest die B Taste gedrückt haben" 0 100
show text "weil die Zeichenfarbe BLAU war" 0 150
fi
if &textcolor == 4
show text "Du solltest die W Taste gedrückt haben" 0 100
show text "weil die Zeichenfarbe WEIẞ war" 0 150
fi
task stroop
keys r g b w ## you can change this to different buttons depending on language
delay 500
show rectangle 0 0 10 30
show rectangle 0 0 30 10
delay 200
clear 1 2
# ------------------------------------------------------
# if it is congruent, textcolor is same as textname
if @3 == 1
set &textcolor @2
fi
# if it is incongruent, textcolor is different
# choose a random textcolor other than @2 (its own color)
if @3 == 2
set &&colorrange 1 2 3 4
set &&colorrange remove position @2
set &textcolor &&colorrange use random
fi
#
font big
if &textcolor == 1
show text @1 0 0 red
fi
if &textcolor == 2
show text @1 0 0 green
fi
if &textcolor == 3
show text @1 0 0 blue
fi
if &textcolor == 4
show text @1 0 0 white
fi
## the 5000 is the maximum time
readkey &textcolor 5000
clear -1
if STATUS == CORRECT
show text "Korrect"
delay 500
clear -1
fi
if STATUS == WRONG
show text "Falsch"
part what_should_be_pressed
delay 5000
clear screen
fi
if STATUS == TIMEOUT
show text "Zu langsam"
part what_should_be_pressed
delay 5000
clear screen
fi
delay 500
save RT STATUS @1 @2 @3 &textcolor
task instruction
keys space
font normal
text align left
show text "In dieser Auggabe, mache folgendes:" -300 -250
show text "Reagiere mit den Tasten R, G, B, oder W" -300 -200
show text "auf die Farbe in der die Wörter geschrieben sind." -300 -150
show text "Reagiere auf Wörter in Farbe ROT mit Taste R" -300 -100
show text "Reagiere auf Wörter in Farbe GRÜN, mit Taste G" -300 -50
show text "Reagiere auf Wörter in Farbe BLAU, mit Taste B" -300 0
show text "Reagiere auf Wörter in Farbe WEISS, mit Taste W" -300 50
show text "Drücke die Leertaste um weiter zu gehen" -300 150 yellow
readkey 1 99999
clear screen
show text "Also:" -300 -250
show text "Falls Du dieses Wort siehst" -300 -200
show text "ROT" -300 -150 green
show text "drückst Du die G Taste" -300 -100
show text "denn die Farbe der Buchstaben ist GRÜN." -300 -50
show text "Auch falls die Bedeutung des Wortes etwas anderes sagt," -300 0
show text "sollst Du trotzdem auf die Farbe der Buchstaben reagieren." -300 50
show text "Drücke die Leertaste um es auszuprobieren" -300 200 yellow
readkey 1 99999
block instruction
message "STROOP Aufgabe, drücke die Leertaste zum Anfangen"
tasklist
instruction 1
end
block training
message "Jetzt kannst Du es ausprobieren. Drücke die Leertaste."
tasklist
stroop 8
end
block real
message "Drücke die Leertaste um es jetzt noch besser zu machen"
tasklist
stroop 40 ## 8 * 5
end
message "Vielen Dank. Drücke die Leertaste."
