Millisecond Forums

Help for adaptation of Stroop script (conditional answer)

https://forums.millisecond.com/Topic29313.aspx

By RemPsyc - 6/29/2020

Hi,

Inquisit newbie here. I'm trying to adapt the Stroop task available from Millisecond (stroopwithcontrolkeyboard.iqx) to the parameters specified in a different study. I was able to adapt the code for most parameters (number of trials, practice trials, feedback, branching, stimuli, etc.).

However, there is one customization I have yet to figure out: "If the color word was presented in blue (25% of the trials), participants were asked to press the key corresponding to the meaning of the word". I bet it is very simple but I don't know where to start or what keywords to put on the forum to find relevant posts.

Any suggestions for how I should tackle this problem? Do I need to add a whole new section or just modify the existing code?
By Dave - 6/29/2020

RemPsyc - 6/29/2020
Hi,

Inquisit newbie here. I'm trying to adapt the Stroop task available from Millisecond (stroopwithcontrolkeyboard.iqx) to the parameters specified in a different study. I was able to adapt the code for most parameters (number of trials, practice trials, feedback, branching, stimuli, etc.).

However, there is one customization I have yet to figure out: "If the color word was presented in blue (25% of the trials), participants were asked to press the key corresponding to the meaning of the word". I bet it is very simple but I don't know where to start or what keywords to put on the forum to find relevant posts.

Any suggestions for how I should tackle this problem? Do I need to add a whole new section or just modify the existing code?

You need to replace (or modify) the "blueincongruent" trial with something else (nothing changes for the "bluecongruent" trial because meaning of the word and display color are identical). The modification would be something along the following lines.

<trial blueincongruent>
/ontrialbegin = [
    values.congruency = 2;
]
/ pretrialpause = 200
/ stimulustimes = [1=blueincongruent, redreminder, greenreminder, bluereminder, blackreminder]

/ iscorrectresponse = [
    trial.blueincongruent.response == list.blueincongruent_responses.nextvalue;
]


/ validresponse = ("d", "f", "j", "k")
/ errormessage = true(x, 400)
/ontrialend = [
    list.responses.insertitem(trial.blueincongruent.correct, 1);
    list.responses_incongruent.insertitem(trial.blueincongruent.correct, 1);
    
    if (trial.blueincongruent.correct) {
        list.latencies.insertitem(trial.blueincongruent.latency, 1);
        list.latencies_incongruent.insertitem(trial.blueincongruent.latency, 1);
    }
]
</trial>

with

<text blueincongruent>
/ items = ("green", "red", "black")
/ color = blue
</text>

green = f (scancode 33)
red = d (scancode 32)
black = k (scancode 37)

<list blueincongruent_responses>
/ items = (33,32,37)
/ selectionmode = text.blueincongruent.currentindex
</list>
By RemPsyc - 6/29/2020

It's working! Amazing, thank you so much. :)

For reference, from your code above, I indeed only had to change the line in bold :

/ iscorrectresponse = [
  trial.blueincongruent.response == list.blueincongruent_responses.nextvalue;
]

As well as create the blueincongruent_responses list:

<list blueincongruent_responses>
/ items = (33,32,37)
/ selectionmode = text.blueincongruent.currentindex
</list>