+x+x+xHi everyone,
for my stroop-like task I display sentences word-by-word where the last word of a sentence always has a certain color (1 of 4). In the next window I ask the participants for a certain color. (E.g. "was the textcolor of the last word green?".) At the end of the task, the right answer should be 50% "yes" and 50% "no", that's why I can't just ask for a random color undependent of the actual textcolor that was shown. I tried to solve this with /onprepare to select a certain item ("blue?", "violet?", "red?", "green?") depending on what actual color the last word had. For the right distribution of textcolor and the following question-items I made up lists that specify textcolor and the following question for each item and wrote expressions for each color, to connect these. Displaying the right textcolor is working, but the question afterwards is still chosen randomly.
Has anyone an idea how to manage this?
Thank you very much in advance!
Here is the relevant part of my code and the whole file if needed (which is pretty messy I think, sorry for that)
<text q>
/ items = ("Blau?","Violet?","Rot?","Grün?")
/ position = (50%, 30%)
/ erase = false
/ fontstyle = ("Arial", 5.00%, false, false, false)
/ onprepare = [
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="1") text.q.selectedindex=="1";
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="2") text.q.selectedindex=="2";
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="3") text.q.selectedindex=="3";
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="4") text.q.selectedindex=="4";
]
</text>
<item RFstroop>
/ 1 = " 1 "
/ 2 = " 2 "
/ 3 = " 3 "
/ 4 = " 4 "
/ 5 = " 1 "
/ 6 = " 2 "
/ 7 = " 3 "
/ 8 = " 4 "
/ 9 = " 1 "
/ 10 = " 2 "
/ 11 = " 3 "
/ 12 = " 4 "
/ 13 = " 1 "
/ 14 = " 2 "
/ 15 = " 3 "
/ 16 = " 4 "
/ 17 = " 1 "
/ 18 = " 2 "
/ 19 = " 3 "
/ 20 = " 4 "
...
<item qcolorstroop>
/ 1 = " 1 "
/ 2 = " 1 "
/ 3 = " 3 "
/ 4 = " 3 "
/ 5 = " 2 "
/ 6 = " 2 "
/ 7 = " 4 "
/ 8 = " 4 "
/ 9 = " 1 "
/ 10 = " 1 "
/ 11 = " 3 "
/ 12 = " 3 "
/ 13 = " 2 "
/ 14 = " 2 "
/ 15 = " 4 "
/ 16 = " 4 "
/ 17 = " 1 "
/ 18 = " 1 "
/ 19 = " 3 "
/ 20 = " 3 "
...
<expressions>
/ bluestroop = if (values.winend==expressions.inputend && item.RFstroop.item(list.stroop.currentvalue) == "1") text.mywindow.textcolor=blue else if (values.winend!=expressions.inputend) text.mywindow.textcolor=black
</expressions>
I honestly have no idea what
/ onprepare = [
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="1") text.q.selectedindex=="1";
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="2") text.q.selectedindex=="2";
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="3") text.q.selectedindex=="3";
if (item.qcolorstroop.item(list.RFstroop.currentvalue)=="4") text.q.selectedindex=="4";
]
is supposed to do or how you came up with this. Please explain what you think this does and then maybe I can tell you how to actually do that.
This idea came up when I searched in the inquisit programmer's manual for a possibility to select a certain item from text.q dependend on the displayed textcolor in the previous window, but it seems like this isn't the right way to do it.
In other words: If Item 1 from list.stroop is displayed, then Item 1 from text.q (which is "Blau?") should be displayed. (please ignore that I originally wrote down list.RFstroop.currentvalue, I corrected it already)
The rules, which item from text.q should be displayed depending on each item from list.stroop is shown in list.qcolorstroop.
I apologize for my bad explanations and I hope this makes it clearer now!
So why don't you simply do
<values>
...
/ qcoloritem = 0
</values>
with
<text q>
/ items = ("Blau?","Violet?","Rot?","Grün?")
/ position = (50%, 30%)
/ erase = false
/ fontstyle = ("Arial", 5.00%, false, false, false)
/ select = values.qcoloritem
</text>
where
<item qcolorstroop>
/ 1 = "1"
/ 2 = "1"
/ 3 = "3"
/ 4 = "3"
/ 5 = "2"
/ 6 = "2"
/ 7 = "4"
/ 8 = "4"
/ 9 = "1"
/ 10 = "1"
/ 11 = "3"
/ 12 = "3"
/ 13 = "2"
/ 14 = "2"
/ 15 = "4"
/ 16 = "4"
/ 17 = "1"
/ 18 = "1"
/ 19 = "3"
/ 20 = "3"
/ 21 = "2"
/ 22 = "2"
/ 23 = "4"
/ 24 = "4"
/ 25 = "1"
/ 26 = "1"
/ 27 = "3"
/ 28 = "3"
/ 29 = "2"
/ 30 = "2"
/ 31 = "4"
/ 32 = "4"
/ 33 = "1"
/ 34 = "1"
/ 35 = "3"
/ 36 = "3"
/ 37 = "2"
/ 38 = "2"
/ 39 = "4"
/ 40 = "4"
/ 41 = "1"
/ 42 = "1"
/ 43 = "3"
/ 44 = "3"
/ 45 = "2"
/ 46 = "2"
/ 47 = "4"
/ 48 = "4"
/ 49 = "1"
/ 50 = "1"
/ 51 = "3"
/ 52 = "3"
/ 53 = "2"
/ 54 = "2"
/ 55 = "4"
/ 56 = "4"
/ 57 = "1"
/ 58 = "1"
/ 59 = "3"
/ 60 = "3"
/ 61 = "2"
/ 62 = "2"
/ 63 = "4"
/ 64 = "4"
/ 65 = "1"
/ 66 = "1"
/ 67 = "3"
/ 68 = "3"
/ 69 = "2"
/ 70 = "2"
/ 71 = "4"
/ 72 = "4"
/ 73 = "1"
/ 74 = "1"
/ 75 = "3"
/ 76 = "3"
/ 77 = "2"
/ 78 = "2"
/ 79 = "4"
/ 80 = "4"
/ 81 = "1"
/ 82 = "1"
/ 83 = "3"
/ 84 = "3"
/ 85 = "2"
/ 86 = "2"
/ 87 = "4"
/ 88 = "4"
/ 89 = "1"
/ 90 = "1"
/ 91 = "3"
/ 92 = "3"
/ 93 = "2"
/ 94 = "2"
/ 95 = "4"
/ 96 = "4"
/ 97 = "1"
/ 98 = "1"
/ 99 = "3"
/ 100 = "3"
/ 101 = "2"
/ 102 = "2"
/ 103 = "4"
/ 104 = "4"
/ 105 = "1"
/ 106 = "1"
/ 107 = "3"
/ 108 = "3"
/ 109 = "2"
/ 110 = "2"
/ 111 = "4"
/ 112 = "4"
</item>
holds the item number and
<trial Qtrialstroop>
/ ontrialbegin = [
expressions.qcolor;
values.correctanswer = item.RFstroop.item(list.stroop.currentvalue);
if (text.q.currentitemnumber==values.color) {
values.correctkey="k";
} else {
values.correctkey="d";
};
values.qcoloritem = item.qcolorstroop.item(list.stroop.currentvalue); // set item for the color question
]
/ stimulusframes = [1=clearscreen, background, q, D, K]
/ validresponse = (32,37)
/ correctresponse = (values.correctanswer)
...
</trial>
pulls up and sets the applicable item number.
The script already does the exact same thing in numerous places, so I'm confused why you would try and go about it in a different way.