+x+xHi,

I am new to Inquisit, and creating a new task that requires participants to determine whether the current item matches with the previous (like playing the game of dominoes, where a domino containing one and two would match to three, one, but not with four, five). I am looking for syntax to store the correct response based on whether the current stimulus matches with the previous. Is there a way to do this?

Additionally, is there a way to counterbalance my blocks so that half of the trials in the block are "match" trials, and half of the trials are "mismatch" trials. A match trial would mean that the next stimulus contains one of the same numbers as the previous, and mismatch would mean that both of the numbers are different.

Thank you very much in advance for any help! Let me know if you need additional clarification.

What you're describing is basically similar a 1-back task. You can look at the n-back scripts available in the library for elaborate examples on how to implement something like this. I could give you a more concrete example / some skeleton code, but you would have to spell out the exact matching rules you wish to implement first.

Here's a simple example with two different digits between 1 and 9 sampled randomly in each trial. In match trials, one of the previous digits will be kept, the other will be replaced with a different one. In mismatch trials, both previous digits will be replaced with different ones.

<trial start>

/ ontrialbegin = [

values.n1 = list.numbers.nextvalue;

values.n2 = list.numbers.nextvalue;

]

/ stimulusframes = [1=number_one, number_two]

/ validresponse = ("y", "n")

/ correctresponse = ("n")

</trial>

<trial match>

/ ontrialbegin = [

list.numbers.reset();

values.matchposition = replace(1,2);

if (values.matchposition == 1) {

values.not1 = values.n1;

values.not2 = values.n2;

values.n2 = list.numbers.nextvalue;

} else if (values.matchposition == 2) {

values.not1 = values.n1;

values.not2 = values.n2;

values.n1 = list.numbers.nextvalue;

}

]

/ stimulusframes = [1=number_one, number_two]

/ validresponse = ("y", "n")

/ correctresponse = ("y")

</trial>

<trial mismatch>

/ ontrialbegin = [

list.numbers.reset();

values.not1 = values.n1;

values.not2 = values.n2;

values.matchposition = 0;

values.n1 = list.numbers.nextvalue;

values.n2 = list.numbers.nextvalue;

]

/ stimulusframes = [1=number_one, number_two]

/ validresponse = ("y", "n")

/ correctresponse = ("n")

</trial>

<block example>

/ trials = [1= start; 2-21 = noreplace(match, mismatch)]

</block>

<text number_one>

/ items = ("<%values.n1%>")

/ position = (48%, 50%)

</text>

<text number_two>

/ items = ("<%values.n2%>")

/ position = (52%, 50%)

</text>

<values>

/ n1 = 0

/ n2 = 0

/ matchposition = 0

/ not1 = 0

/ not2 = 0

</values>

<list numbers>

/ items = (1,2,3,4,5,6,7,8,9)

/ replace = false

/ selectionrate = always

/ not = (values.not1)

/ not = (values.not2)

</list>

<data>

/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency correct values.n1 values.n2 values.matchposition)

/ separatefiles = true

</data>