Millisecond Forums

Color Word Stroop Script Editing

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

By clynzee - 2/5/2021

Hello!

I am interested in running 2 different versions of the Color Word Stroop with Keyboard Responding (English); one version with all congruent presentations, one version with 75% incongruent presentations/25% congruent presentations. I would also like to remove the control trials (color blocks) from both versions and increase the trial presentation amount from 84 to 256 trials.

I have tried editing the script, however I receive errors when trying to run the test.

Any guidance on this issue?

Thanks!
By Dave - 2/5/2021

clynzee - 2/6/2021
Hello!

I am interested in running 2 different versions of the Color Word Stroop with Keyboard Responding (English); one version with all congruent presentations, one version with 75% incongruent presentations/25% congruent presentations. I would also like to remove the control trials (color blocks) from both versions and increase the trial presentation amount from 84 to 256 trials.

I have tried editing the script, however I receive errors when trying to run the test.

Any guidance on this issue?

Thanks!

What edits did you make and what are the specific errors, please?
By Dave - 2/5/2021

Dave - 2/6/2021
clynzee - 2/6/2021
Hello!

I am interested in running 2 different versions of the Color Word Stroop with Keyboard Responding (English); one version with all congruent presentations, one version with 75% incongruent presentations/25% congruent presentations. I would also like to remove the control trials (color blocks) from both versions and increase the trial presentation amount from 84 to 256 trials.

I have tried editing the script, however I receive errors when trying to run the test.

Any guidance on this issue?

Thanks!

What edits did you make and what are the specific errors, please?

To make a few general points.
(1) To not run the control trials, remove them from the <block>'s /trials attribute.

<block stroop>
/ onblockbegin = [
    list.latencies.reset();
    list.latencies_congruent.reset();
    list.latencies_control.reset();
    list.latencies_incongruent.reset();
    list.responses.reset();
    list.responses_congruent.reset();
    list.responses_control.reset();
    list.responses_incongruent.reset();
]
/ trials = [
    1=getReady;
    2-85 =noreplace(redcongruent, redincongruent, redcontrol, greencongruent, greenincongruent, greencontrol, bluecongruent, blueincongruent,
    bluecontrol, blackcongruent, blackincongruent, blackcontrol);
]
</block>

(2) To increase the amount of trials from 84 to 256, change 2-85 in the /trials attribute to 2-257.

/ trials = [
  1=getReady;
  2-257=noreplace(redcongruent, redincongruent, greencongruent, greenincongruent, bluecongruent, blueincongruent, blackcongruent, blackincongruent);
]

(3a) For the version running only congruent trials, simply remove all incongruent trials.

/ trials = [
1=getReady;
2-257=noreplace(redcongruent, greencongruent, bluecongruent, blackcongruent);
]

(3b) For the version with a 3:1 incongruent to congruent ratio, adjust the ratio of the trials in the noreplace pool accordingly:

/ trials = [
1=getReady;
2-257=noreplace(redcongruent, redincongruent, redincongruent, redincongruent,
greencongruent, greenincongruent, greenincongruent, greenincongruent,
bluecongruent, blueincongruent, blueincongruent, blueincongruent,
blackcongruent, blackincongruent, blackincongruent, blackincongruent);
]

That's pretty much all there is to it.
By clynzee - 2/6/2021

Hi Dave,

Thank you so much--this is quite helpful! I actually did make those changes in making edits, however I removed additional parts of the script that I believe created the errors. I will try this to see if it will run for me.

An additional question for the 2 versions of the script that I would like to run: I would like to run one version followed by the PASAT-C for come participants, and the 2nd version followed by the PASAT-C for other participants. I will be linking them to the tests through a Qualtrics survey, and to the best of my understanding I will need to write additional script using the batch function--
 
<batch>
/ groups = (1 of 2)
/ file =“stroopwithcontrolkeyboard.iqx”
/ file =“pasatc.iqx”
</batch>

<batch>
/ groups = (2 of 2)
/ file =“stroopwithcontrolkeyboard2.iqx”
/ file =“pasatc.iqx”
</batch>

Am I on the right track with this? Would I need to insert 2 different links into Qualtrics?

-Cathy
By clynzee - 2/7/2021

Dave - 2/6/2021
Dave - 2/6/2021
clynzee - 2/6/2021
Hello!

I am interested in running 2 different versions of the Color Word Stroop with Keyboard Responding (English); one version with all congruent presentations, one version with 75% incongruent presentations/25% congruent presentations. I would also like to remove the control trials (color blocks) from both versions and increase the trial presentation amount from 84 to 256 trials.

I have tried editing the script, however I receive errors when trying to run the test.

Any guidance on this issue?

Thanks!

What edits did you make and what are the specific errors, please?

To make a few general points.
(1) To not run the control trials, remove them from the <block>'s /trials attribute.

<block stroop>
/ onblockbegin = [
    list.latencies.reset();
    list.latencies_congruent.reset();
    list.latencies_control.reset();
    list.latencies_incongruent.reset();
    list.responses.reset();
    list.responses_congruent.reset();
    list.responses_control.reset();
    list.responses_incongruent.reset();
]
/ trials = [
    1=getReady;
    2-85 =noreplace(redcongruent, redincongruent, redcontrol, greencongruent, greenincongruent, greencontrol, bluecongruent, blueincongruent,
    bluecontrol, blackcongruent, blackincongruent, blackcontrol);
]
</block>

(2) To increase the amount of trials from 84 to 256, change 2-85 in the /trials attribute to 2-257.

/ trials = [
  1=getReady;
  2-257=noreplace(redcongruent, redincongruent, greencongruent, greenincongruent, bluecongruent, blueincongruent, blackcongruent, blackincongruent);
]

(3a) For the version running only congruent trials, simply remove all incongruent trials.

/ trials = [
1=getReady;
2-257=noreplace(redcongruent, greencongruent, bluecongruent, blackcongruent);
]

(3b) For the version with a 3:1 incongruent to congruent ratio, adjust the ratio of the trials in the noreplace pool accordingly:

/ trials = [
1=getReady;
2-257=noreplace(redcongruent, redincongruent, redincongruent, redincongruent,
greencongruent, greenincongruent, greenincongruent, greenincongruent,
bluecongruent, blueincongruent, blueincongruent, blueincongruent,
blackcongruent, blackincongruent, blackincongruent, blackincongruent);
]

That's pretty much all there is to it.
By clynzee - 2/7/2021

Hi Dave--

I have modified the script using your suggestions:

<block stroop>
/ onblockbegin = [
    list.latencies.reset();
    list.latencies_congruent.reset();
    list.latencies_control.reset();
    list.latencies_incongruent.reset();
    list.responses.reset();
    list.responses_congruent.reset();
    list.responses_control.reset();
    list.responses_incongruent.reset();
]
/ trials = [
    1=getReady;
    2-257 =noreplace(redcongruent, greencongruent, bluecongruent, blackcongruent);
]
</block>

<block finish>
/ trials = [
    1 = finish;
]
</block>

-AND-

<block stroop>
/ onblockbegin = [
    list.latencies.reset();
    list.latencies_congruent.reset();
    list.latencies_control.reset();
    list.latencies_incongruent.reset();
    list.responses.reset();
    list.responses_congruent.reset();
    list.responses_control.reset();
    list.responses_incongruent.reset();
]
/ trials = [
    1=getReady;
    2-257 =noreplace(redcongruent, redincongruent, redincongruent, redincongruent, greencongruent, greenincongruent, greenincongruent, greenincongruent, bluecongruent, blueincongruent, blueincongruent, blueincongruent, blackcongruent, blackincongruent, blackincongruent, blackincongruent);
]
</block>

<block finish>
/ trials = [
    1 = finish;
]
</block>

When I attempt to run each one, I receive the error message, 'Unable to load the html file'. Any idea of what may be going wrong?

Thanks!
By Dave - 2/8/2021

clynzee - 2/8/2021
Hi Dave--

I have modified the script using your suggestions:

<block stroop>
/ onblockbegin = [
    list.latencies.reset();
    list.latencies_congruent.reset();
    list.latencies_control.reset();
    list.latencies_incongruent.reset();
    list.responses.reset();
    list.responses_congruent.reset();
    list.responses_control.reset();
    list.responses_incongruent.reset();
]
/ trials = [
    1=getReady;
    2-257 =noreplace(redcongruent, greencongruent, bluecongruent, blackcongruent);
]
</block>

<block finish>
/ trials = [
    1 = finish;
]
</block>

-AND-

<block stroop>
/ onblockbegin = [
    list.latencies.reset();
    list.latencies_congruent.reset();
    list.latencies_control.reset();
    list.latencies_incongruent.reset();
    list.responses.reset();
    list.responses_congruent.reset();
    list.responses_control.reset();
    list.responses_incongruent.reset();
]
/ trials = [
    1=getReady;
    2-257 =noreplace(redcongruent, redincongruent, redincongruent, redincongruent, greencongruent, greenincongruent, greenincongruent, greenincongruent, bluecongruent, blueincongruent, blueincongruent, blueincongruent, blackcongruent, blackincongruent, blackincongruent, blackincongruent);
]
</block>

<block finish>
/ trials = [
    1 = finish;
]
</block>

When I attempt to run each one, I receive the error message, 'Unable to load the html file'. Any idea of what may be going wrong?

Thanks!

The *.iqzip you download from the library contains an HTML file along with the script. That HTML file needs to be kept alongside the script, it is used to display instructions.
By clynzee - 2/8/2021

Thank you Dave--the script now runs!

Did you happen to see my other reply? I hope that you are able to provide some insight--


 I would like to run one version followed by the PASAT-C for come participants, and the 2nd version followed by the PASAT-C for other participants. I will be linking them to the tests through a Qualtrics survey, and to the best of my understanding I will need to write additional script using the batch function--

<batch>
/ groups = (1 of 2)
/ file =“stroopwithcontrolkeyboard.iqx”
/ file =“pasatc.iqx”
</batch>

<batch>
/ groups = (2 of 2)
/ file =“stroopwithcontrolkeyboard2.iqx”
/ file =“pasatc.iqx”
</batch>

Am I on the right track with this? Would I need to insert 2 different links into Qualtrics?

-Cathy
By Dave - 2/8/2021

clynzee - 2/8/2021
Thank you Dave--the script now runs!

Did you happen to see my other reply? I hope that you are able to provide some insight--


 I would like to run one version followed by the PASAT-C for come participants, and the 2nd version followed by the PASAT-C for other participants. I will be linking them to the tests through a Qualtrics survey, and to the best of my understanding I will need to write additional script using the batch function--

<batch>
/ groups = (1 of 2)
/ file =“stroopwithcontrolkeyboard.iqx”
/ file =“pasatc.iqx”
</batch>

<batch>
/ groups = (2 of 2)
/ file =“stroopwithcontrolkeyboard2.iqx”
/ file =“pasatc.iqx”
</batch>

Am I on the right track with this? Would I need to insert 2 different links into Qualtrics?

-Cathy

> Am I on the right track with this?

The batch code looks fine.

> Would I need to insert 2 different links into Qualtrics?

Depends on how you want to perform the assignment to one of the two groups. If that is intended to be performed by Qualtrics, you should have Qualtrics forward an URL parameter specifying the group number (along with the URL parameter specify the participant's Qualtrics ID; see https://www.millisecond.com/support/docs/v6/html/howto/interopsurveys.htm ).

If you're fine with Inquisit performing the group assignment, simply select sequential or random (without replacement) group ID generation in the online settings and set the number of groups to 2.
By clynzee - 2/14/2021

Thank you Dave--this is helpful! I think that because I would like for the grouping to determine the Stroop task that is presented, I would like for the randomization to be done in Inquisit (just not sure how to assign to groups in Qualtrics without specifying conditions to be met).

I have now run into a couple of other issues: I am not sure if I have my scripts structured properly within my experiment. They are currently listed:

errorsound.wav
pasatc.iqx
pasatc_intro1.htm
pasatc_intro2.htm
pasatc_intro3.htm
pasatc_level3.htm
pasatc_test.htm
pasatc_teststart.htm
responsecircle.png
responsecircle_10.png
responsecircle_12.png
responsecircle_5.png
responsecircle_start.png
stroop_deplete.iqx         —>this is the 75% incongruent test
stroop_nondeplete.iqx   —>this is the 100% congruent test
stroopinstructions1.htm
thesis batch script.html    —>this is the script from above

My start script is set at stroop_deplete.iqx

The test ends after just running the start script--I am not sure if there is something that I need to re-order or specify to get this to run properly such that participants are (1) directed here through Qualtrics; (2) assigned to either group 1 or group 2; (3) presented with either stroop_deplete and pasatc, or stroop_nondeplete and pasatc (based off of their group assignment, using the batch script); (4) and then returned to Qualtrics at the point in the survey where they left off--not the beginning or end of the survey. 

Could you please advise? Thank you!
By Dave - 2/15/2021

clynzee - 2/14/2021
Thank you Dave--this is helpful! I think that because I would like for the grouping to determine the Stroop task that is presented, I would like for the randomization to be done in Inquisit (just not sure how to assign to groups in Qualtrics without specifying conditions to be met).

I have now run into a couple of other issues: I am not sure if I have my scripts structured properly within my experiment. They are currently listed:

errorsound.wav
pasatc.iqx
pasatc_intro1.htm
pasatc_intro2.htm
pasatc_intro3.htm
pasatc_level3.htm
pasatc_test.htm
pasatc_teststart.htm
responsecircle.png
responsecircle_10.png
responsecircle_12.png
responsecircle_5.png
responsecircle_start.png
stroop_deplete.iqx         —>this is the 75% incongruent test
stroop_nondeplete.iqx   —>this is the 100% congruent test
stroopinstructions1.htm
thesis batch script.html    —>this is the script from above

My start script is set at stroop_deplete.iqx

The test ends after just running the start script--I am not sure if there is something that I need to re-order or specify to get this to run properly such that participants are (1) directed here through Qualtrics; (2) assigned to either group 1 or group 2; (3) presented with either stroop_deplete and pasatc, or stroop_nondeplete and pasatc (based off of their group assignment, using the batch script); (4) and then returned to Qualtrics at the point in the survey where they left off--not the beginning or end of the survey. 

Could you please advise? Thank you!

You need to create a <batch> script with two conditions. One condition that runs the stroop_deplete and pasatc script, and the other, 2nd condition to run the stroop_nondeplete script and the pasatc. The batch script needs to be set as the study's start script.

https://www.millisecond.com/support/docs/v6/html/language/elements/batch.htm

<batch>
/ groups=(1 of 2)
/ file="stroop_deplete.iqx"
/ file="pasatc.iqx"
</batch>

<batch>
/ groups=(2 of 2)
/ file="stroop_nondeplete.iqx"
/ file="pasatc.iqx"
</batch>

By clynzee - 2/15/2021

Thank you Dave--it looks like I had just saved the script in the wrong format!

It now allows me to start with the batch script, however now the Stroop and PASAT-C do not run at all. The test immediately ends after opening the Inquisit application and automatically directs me back to the beginning of the Qualtrics survey. Could there be something that I need to add to the batch script to get the tests to run before going back to Qualtrics? And is there a way to then return participants to Qualtrics at the point in the survey where they left off--not the beginning or end of the survey? 
By Dave - 2/15/2021

clynzee - 2/15/2021
Thank you Dave--it looks like I had just saved the script in the wrong format!

It now allows me to start with the batch script, however now the Stroop and PASAT-C do not run at all. The test immediately ends after opening the Inquisit application and automatically directs me back to the beginning of the Qualtrics survey. Could there be something that I need to add to the batch script to get the tests to run before going back to Qualtrics? And is there a way to then return participants to Qualtrics at the point in the survey where they left off--not the beginning or end of the survey? 

Please provide the link to your online experiment. I cannot possibly answer questions about mistakes in the settings etc. without being able to look at the settings.