+xI of course meant
values.correctkey = 30 within the code that I first had and not
values.correctkey = lbuttondown, as it says now.
Sorry about that!
You need double quotes:
<values>
/ reference_odor_item = 0
/ comparison_odor_item = 0
/ odor_1_item = 0
/ odor_2_item = 0
/ is_reference = ""
/ correctmouseevent = "rbuttondown"</values>
<trial discrimination>
/ ontrialbegin = [
values.reference_odor_item = list.reference_odors.nextvalue;
values.comparison_odor_item = list.comparison_odors.nextvalue;
values.is_reference = list.is_reference_list.nextvalue;
]
/ ontrialbegin = [
if (values.is_reference == "odor_1") {
values.odor_1_item = values.reference_odor_item;
values.odor_2_item = values.comparison_odor_item;
values.correctmouseevent = "lbuttondown";} else if (values.is_reference == "odor_2") {
values.odor_1_item = values.comparison_odor_item;
values.odor_2_item = values.reference_odor_item;
values.correctmouseevent = "rbuttondown";};
]
/ stimulustimes = [0=3; 1000=2; 2000=1; 2850=reference_odor; 3000=inhale; 3000=reference_label; 5000=empty;
7000=3; 8000=2; 9000=1; 9850=odor_1; 10000=inhale; 10000=odor1_label; 12000=empty;
14000=3; 15000=2; 16000=1; 16850=odor_2; 17000=inhale; 17000=odor2_label; 19000=empty;
21000=odor1_response; 21000=odor2_response; 21000=discrim_quest]
/ validresponse = (lbuttondown, rbuttondown)
/ inputdevice = mousekey
/ beginresponsetime = 21000
/ pretrialpause = 1000
/ iscorrectresponse = [
trial.discrimination.response == values.correctmouseevent
]
</trial>