For a discrimination task I am trying to program 12 trials in which each trial, the participant first gets a countdown, then the text INHALE together with the label "REFERENCE" on top of the page gets displayed on the screen and an odor (via a port code) is presented at the same time. This is done again twice but once with the label ODOR 1 and once with the label ODOR 2. After these three "rounds" the participant has to respond with the A key for Odor 1 or the L key for Odor 2 which of the odors (a question displayed in the center of the screen) is identical to the reference odor. So the point of the task is for the participant to decide which one of the test odors (Odor 1 and Odor 2) is identical to the reference odor. The reference odor, as well as the test odor order needs to be randomized.
The idea of the 12 trials is to have all the pairs e.g. 1 reference - 1,2 test. 1 reference - 1,3 test. 1 reference - 1,4 test. Up to odor 4.
My question is now how do I program this dependency? Is it somehow possible to program that one port is randomly selected at the time of the REFERENCE label presentation and to then have the same port selected at the Odor 1 label presentation and any but the already selected port selected at the Odor 2 label presentation (but then at the same time have it randomized whether the "correct" port, so the port that is the same as the original is Odor 1 or Odor 2)?
Any other suggestions on how this could be programmed are also very welcome!!
This what I have so far:
<text 3>
/ items = ("3")
/ fontstyle = ("Arial", 9%)
/ position = (50, 50)
</text>
<text 2>
/ items = ("2")
/ fontstyle = ("Arial", 9%)
/ position = (50, 50)
</text>
<text 1>
/ items = ("1")
/ fontstyle = ("Arial", 9%)
/ position = (50, 50)
</text>
<text inhale>
/ items = ("INHALE")
/ fontstyle = ("Arial", 9%)
/ position = (50, 50)
</text>
<text reference_label>
/ items = ("REFERENCE")
/ fontstyle = ("Arial", 25pt)
/ position = (50, 10)
</text>
<text odor1_label>
/ items = ("ODOR 1")
/ fontstyle = ("Arial", 25pt)
/ position = (50, 10)
</text>
<text odor2_label>
/ items = ("ODOR 2")
/ fontstyle = ("Arial", 25pt)
/ position = (50, 10)
</text>
<text odor1_response>
/ items = ("ODOR 1")
/ fontstyle = ("Arial", 25pt)
/ position = (20, 50)
</text>
<text odor2_response>
/ items = ("ODOR 2")
/ fontstyle = ("Arial", 25pt)
/ position = (80, 50)
</text>
<text discrim_quest>
/ items = ("Which Odor?")
/ fontstyle = ("Arial", 30pt)
/ position = (50, 50)
</text>
<shape empty>
/ shape = rectangle
/ size = (100, 100)
/ position = (50, 50)
/ color = black
/ erase = true(black)
</shape>
<trial discr_Odor1_correct>
/ stimulustimes = [0=3; 1000=2; 2000=1; 3000=inhale; 3000=reference_label; 5000=empty;
7000=3; 8000=2; 9000=1; 10000=inhale; 10000=odor1_label; 12000=empty;
14000=3; 15000=2; 16000=1; 17000=inhale; 17000=odor2_label; 19000=empty;
21000=odor1_response; 21000=odor2_response; 21000=discrim_quest]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ beginresponsetime = 21000
/ pretrialpause = 1000
</trial>
<trial discr_Odor2_correct>
/ stimulustimes = [0=3; 1000=2; 2000=1; 3000=inhale; 3000=reference_label; 5000=empty;
7000=3; 8000=2; 9000=1; 10000=inhale; 10000=odor1_label; 12000=empty;
14000=3; 15000=2; 16000=1; 17000=inhale; 17000=odor2_label; 19000=empty;
21000=odor1_response; 21000=odor2_response; 21000=discrim_quest]
/ correctresponse = ("l")
/ validresponse = ("a", "l")
/ beginresponsetime = 21000
/ pretrialpause = 1000
</trial>
<block discrimination>
/ trials = [1=discr_Odor1_correct; 2=discr_Odor2_correct]
/ preinstructions = (discr_instr)
</block>