Millisecond Forums

Adding error messages to trials in Approach/Avoidance script

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

By inquisituser22 - 9/9/2019

Hello,

I am working on adding in errors into the experimental trials of the AAT script, in addition to the error messages that participants already see during the practice trials, as exist in the template. I have added the following to the trials but it does not appear to be sufficient as I do not see error messages, my guess was that I need to add something additional to the "zoom" decrease and increase instructions, but I have not been able to figure out the content exactly?

/ errormessage = true(error,0)

Thank you for any assistance!





By inquisituser22 - 9/9/2019

inquisituser22 - 9/9/2019
Hello,

I am working on adding in errors into the experimental trials of the AAT script, in addition to the error messages that participants already see during the practice trials, as exist in the template. I have added the following to the trials but it does not appear to be sufficient as I do not see error messages, my guess was that I need to add something additional to the "zoom" decrease and increase instructions, but I have not been able to figure out the content exactly?

/ errormessage = true(error,0)

Thank you for any assistance!






One other question I have is that during practice trials, I have added "response = correct" so that participants have to correctly pull or push the joystick to advance. However, I am now not able to run monkeymode when an error is encountered - the screen stays as is with "ERROR" on screen and does not advance. Thank you!

By Dave - 9/9/2019

I've attached an AAT script with error messages in the test trials, so you can take a look at that. I don't understand your second question.
By inquisituser22 - 9/10/2019

Dave - 9/9/2019
I've attached an AAT script with error messages in the test trials, so you can take a look at that. I don't understand your second question.

Thank you very much! This was helpful. I'll rephrase my second question - I would like participants to correct their errors by moving the joystick in the correct direction once told it is an error. I am able to do this no problem because I have added "/response = correct" which requires participants to correct their prior erroneous response. However, when I try to test out my script in monkeymode, it gets stuck on the screen saying "error" and does not correct the response, and will not finish running the script. I am not sure how to code a new response for monkeymode. Thank you!


/ errormessage = true(error,0)
/ response = correct
By Dave - 9/10/2019

inquisituser22 - 9/10/2019
Dave - 9/9/2019
I've attached an AAT script with error messages in the test trials, so you can take a look at that. I don't understand your second question.

Thank you very much! This was helpful. I'll rephrase my second question - I would like participants to correct their errors by moving the joystick in the correct direction once told it is an error. I am able to do this no problem because I have added "/response = correct" which requires participants to correct their prior erroneous response. However, when I try to test out my script in monkeymode, it gets stuck on the screen saying "error" and does not correct the response, and will not finish running the script. I am not sure how to code a new response for monkeymode. Thank you!


/ errormessage = true(error,0)
/ response = correct

The only thing you can do is force the monkey to always respond correctly per /monkeyresponse:

<trial practicetrial_A>
/ ontrialbegin = [
values.targetformat = "l";
values.selectpracticepicture = 1;
values.starttime = script.elapsedtime;
values.endtime = 0;
picture.practicetarget.height = values.startheight_A;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = practicetarget]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.practicetrial_A.response == "forward") ||
(values.expcondition == 2 && trial.practicetrial_A.response == "back")]
/ errormessage = true(error,0)
/ response = correct
/ monkeyresponse = [
if (values.expcondition == 1) "forward" else "back"
]

/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "practicetrial_A";
values.RT = trial.practicetrial_A.latency;
values.correct = trial.practicetrial_A.correct;
values.stimulus = picture.practicetarget.currentitem;
if (trial.practicetrial_A.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
]
/ branch = [
if (trial.practicetrial_A.response == "forward")
trial.practicedecrease
else
trial.practiceincrease;
]
/ recorddata = false
</trial>


NOTE:
trial.practicetrial_B displays the stimulus of format B (here: portrait) by setting
values.selectpracticepicture = 2
*if a forward movement (=push) is detected -> decrease picture
*if a back movement (=pull) is detected -> increase picture


<trial practicetrial_B>
/ ontrialbegin = [
values.targetformat = "p";
values.starttime = script.elapsedtime;
values.endtime = 0;
values.repeat = 0;
values.selectpracticepicture = 2;
picture.practicetarget.height = values.startheight_B;
values.completeRT = 0;
values.changedirection = 0;
values.finalresponse="";
]
/ stimulusframes = [1 = practicetarget]
/ validresponse = (back, forward)
/ iscorrectresponse = [(values.expcondition == 1 && trial.practicetrial_B.response == "back") ||
(values.expcondition == 2 && trial.practicetrial_B.response == "forward")]
/ errormessage = true(error,0)
/ response = correct
/ monkeyresponse = [
if (values.expcondition == 1) "back" else "forward"
]

/ ontrialend = [
values.joystick_y = joystick.y;
values.joystick_change = abs(values.joystick_y);
values.trialcode = "practicetrial_B";
values.RT = trial.practicetrial_B.latency;
values.correct = trial.practicetrial_B.correct;
values.stimulus = picture.practicetarget.currentitem;
if (trial.practicetrial_B.response == "forward")
values.initialresponse = "PUSH"
else
values.initialresponse = "PULL";
]
/ branch = [
if (trial.practicetrial_B.response == "forward")
trial.practicedecrease
else
trial.practiceincrease;
]
/ recorddata = false
</trial>

*********ZOOM FEATURE: trial increase/decrease the size of the rectangles depending on participant's response*********

<trial practicedecrease>
/ ontrialbegin = [
if (values.expcondition == 1 && values.targetformat == "p"){
trial.practicedecrease.insertstimulustime(text.error, 0);
}else if (values.expcondition == 2 && values.targetformat == "l"){
trial.practicedecrease.insertstimulustime(text.error, 0);
};
picture.practicetarget.height = picture.practicetarget.height - values.joystick_change/1000 * expressions.maxheightchange_px;
]
/ stimulusframes = [1 = clearscreen, practicetarget]
/ validresponse = (change)
/ monkeyresponse = ("back", "forward")
/ ontrialend = [
values.joystick_change = abs(values.joystick_y - joystick.y);
trial.practicedecrease.resetstimulusframes();
]
/ branch = [
if (monkey.monkeymode == 1) {
values.endtime = script.elapsedtime;
values.finalresponse = "PUSH";
trial.intertrialinterval;
} else if (joystick.y <= -1000) {
values.joystick_y = joystick.y;
values.endtime = script.elapsedtime;
values.finalresponse = "PUSH";
trial.enddecrease_practice;
} else if (joystick.y <= values.joystick_y) {
values.joystick_y = joystick.y;
trial.practicedecrease;
} else if (joystick.y > values.joystick_y) {
values.joystick_y = joystick.y;
values.changedirection += 1;
trial.practiceincrease;
};
]
/ recorddata = false
</trial>
By inquisituser22 - 9/11/2019

Thank you!