Add a variable to mesure error click
in OpenSesame
Hello,
I am benning in Opensesam. I am programming a serial reaction time task with mousetrap. In this task, a stimulus appears on the screen, you have to click on as quickly as possible with mouse. Then, the next stimulus appears. This stimulus can appear in 4 differents places. The order of localisation is not random but follows a sequence repeated several times. So the participant implicitly learns the locations and responds more and more quickly to the localisation of the stimulus.
I managed to make this program but I will want to add a variable. When the subject clicks outside the target, he must correct himself and click on the target for the next stimulus to appear. I would like to keep this rule but record the false click as a false error
If it is not clear, i can send my programm
Thanks
Elodie
Comments
Hi Elodie,
I am also using OS for SRTs. Did you check for the intertrial intervals?
If you use the items, the pictures are loaded just before they are presented. Hence, there may be a time lag between your response and the next stimulus.
If you use inline_scripts you can preload all the items of a block of stimuli (a sequence), so there is no time lag.
Just in case that you use inline_scripts, you would need a while loop that asks for a response. In case it is a correct response (break) continue with the next stimulus. In case it is not a correct response, give an error feedback, log the response, and keep on asking for a response on that stimulus. That's it :)
Best regards,
Stephan
Hi Stephan,
Thanks for your answer. I have no problem with the inter interval. I used the items for my SRTT. But now I need to use inline_scripts to create an "error" variable. This is exactly what you explain:
in case it is a correct reponse i would continue with the next stimulus. In case it is not a correct response, i want log this "error" response, and keep on asking for a response on that stimulus.
I tried this (but I don't know python at all and i'm benning in OS ...)
from openexp.mouse import mouse from openexp.canvas import canvas my_mouse = mouse(exp, visible=True) my_canvas = canvas(exp) prescount = 0 exp.set("mouseclick_count", prescount) while True : button, position, timestamp = my_mouse.get_click() button_clicked == 1 var.Error== 0 break else : var.Error= "mouseclick_count"The following message appears: canvas not found.
And i think my code is false. Have you an idea ?
Thanks
Elodie
Hi Elodie,
Maybe you want to use the cursor_roi feature? Like that, you can check whether the response of a participant was on the correct item, and set a variable if it was outside. If you wish you can share your experiment here, then I can see what the simplest way to implement that function would be.
But maybe this discussion is already a help to you:
Eduard
Hi Edouard,
This task is a Serial Reaction Time task.
I used the 'mousetrap_response' item and only one button is defined, the correct button is a click on the stimulus.
But as a consequence the variable "accuracy" is always at 100% (even when participants clicked several times next to the stimulus before correcting themselves and clicking on the stimulus).
- I would like the variable "accuracy" to take into account when the participant makes a mistake and clicks out of the stimulus.
- or create a variable to count number of click (and so know number of error).
This is my experience:
Thanks
Elodie
Hi Elodie,
Unfortunately, I have trouble installing the mousetrap plugin myself, so I can't test your experiment. Perhaps @Pascal can help out?
I am not sure whether these two features you request are implemented in the mousetrap plugin. I would expect that they would, though. If not, you would have set it up without the plugin, and a "regular" mouse response. But as I said in my previous post, the cursour_roi functionality should be all that you need. If you go for this option, I can write you a little script that demonstrates the general principles, so that you can adapt it to your experiment. However, combing regular mouse response with the mousetrap plugin isn't a good idea and won't work.
btw, sorry for the late response! If you managed to sort things out already by yourself, please let us know.
Thanks!
Eduard
Hi all,
1) Regarding the installation of the mousetrap plugin for OpenSesame 3.3.0 or later (@eduard):
When using OpenSesame 3.3.0 or later, you need to install the development version of the mousetrap plugin (as described here: https://github.com/PascalKieslich/mousetrap-os#installation). That is, you enter the following code in OpenSesame's debug window for installation:
2) Regarding the collection of multiple clicks using the mousetrap response plugin:
In the normal implementation via the graphical user interface, the mousetrap_response plugin continuously records mouse movements but only records the final click (i.e., the click on one of the response buttons). In your case, if you only define one button that is "clickable" and that this is the correct answer, you are completely correct in that this will always result in a 100 % accuracy (when using the built-in accuracy variable of OpenSesame).
One work-around similar to Elodie's second solution ("create a variable to count number of clicks") could be to switch to the Python based implementation of the mousetrap_response item via the MT_response class (see example experiment here: https://github.com/PascalKieslich/mousetrap-os/blob/master/examples/mousetrap_response_python.osexp), which allows you to set the
track_clicksargument toTruein the _exec function and treat a trial as incorrect if there was more than one click recorded (which can only be the case if the first clicks were outside the response button area). However, this is more complex to implement - in the example experiment, you would replace the lines:with:
But I completely agree with Eduard in that you can also use OpenSesame's built-in cursor_roi functionality.
Best,
Pascal