Help for adaptation of Stroop script (conditional answer)


Author
Message
RemPsyc
RemPsyc
Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)
Group: Forum Members
Posts: 4, Visits: 18
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?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
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>
RemPsyc
RemPsyc
Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)Associate Member (187 reputation)
Group: Forum Members
Posts: 4, Visits: 18
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>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search