cursor_roi variable in JATOS/OSWeb
Hello,
I am designing a simple number comparison task in which a child sees two numbers and needs to select the bigger number. We are planning to collect data using iPads by uploading our study to JATOS. I designed the task using a sketchpad and mouse response (so a child can click the number). My problem is that I am using the variable 'cursor_roi' to keep track of children's responses and whether or not they got the answer correct. However, I noticed that my inline script using cursor_roi does not work on JATOS/OSWeb. Is there a way to fix this/different way to keep track of children's responses and create a 'correct' variable that shows whether or not they got the problem correct?
Thank you all for your help!
Comments
Hi @choql,
I am assuminh that you are using Open Sesame 4 and OSWeb 2.0, since mouse response are not supported in OSWeb 1.4. Can you confirm?
Can you also confirm whether your task is running when you run it locally in the browser?
Best,
Fabrice.
Hi Fabrice,
Thank you for your response. Yes, I am using OpenSesame 4/OSWeb 2.0 for my study. When I try to run it locally in the browser, I get an 'OSWebCompatibilityError.' I think my python inline_script using cursor_roi is the issue. Is there a different way to record the subject's responses and create a 'correct' variable? I attached a screenshot of the inline_script as a reference.
Hi @choql ,
Python
inline_scriptis in not supported by OSWeb. The solution would be to write aninline_javascriptitem that does the same thing:if (cursor_roi === answer) { correct = 1 } else { correct = 0For more information about using JavaScript in OpenSesame, see:
And for an overview of supported functionality in OSWeb, see:
— Sebastiaan
PS. You can update relevant packages by clicking on the green update icon in the toolbar!
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thank you so much! I have a quick question. I'm also trying to log cursor_roi to see which answer the child selected, but even after entering 'cursor_roi' variable in the logger, the excel output from OSWeb does not seem to include the variable. Could you help me with this issue?
Hi choql,
did you manage to fix your logging problem, I seem to have exactly the same issue with my mouse reponses using the repeat cycle item which does not seem to collect and display the clicks I give and does not write them to the console.
Here is the code :
vars.cursor_x<vars.end_x_consonant_roi &vars.cursor_y>vars.start_y_consonant_roi &
vars.cursor_y<vars.end_y_consonant_roi
)
{ vars.consonant_clicked = "yes"
}
else
{ vars.consonant_clicked = "no"
}
console.log(vars.consonant_clicked)
the code in repeat cylce
__condition__let [vars.vocal_clicked]="no" & [vars.consonant_clicked]="no"
__end__
and I used this video https://www.youtube.com/watch?v=-L9pzw4tpx8 to code the mouse responses in open sesame (version 4.024). Working with the video I manage fine to get it working and I see the variables in the variable creator but those do not seem to filled accordingly.
Thanks for any suggestions.
Update: when I placed the logger in the trial sequence item and not after the trial sequence item, I at least got one variable filled, yet no printout to the console - maybe a new installation might fix the problem, I will keep you posted
Dear all, I realised that when I use the mouse as response and define rois for two response options those coordinates do not align with the programming surface (where 0,0 ist center of the screen) and the displayed screen (where 0,0 seems to be the upper left corner of the screen). I came across the suggestion to set coordinates to uniform to have the 0,0 centered (as is the default when programming sketchpads) but I have so far not found where to place the code in the osweb version when using mouse responses and rois. Thanks for any suggestions, best miriam
here are my coordinates of the response boxes to be approximately centered when the screen has 0,0 at the top left corner
width height x_vocal y_vocal x_consonant y_consonant
100 100 400 400 650 400
100 100 400 400 650 400
and here are coordinates of the csv response file:
It is a Windows 11 OS with the latest Version of open sesame, but the behavior was already observed with former open sesame versions.
Hi @mgade ,
The
cursor_roihas been added to OSWeb since this discussion was started. So I think there's some confusion about how this is supposed to work. I attached a simple demonstration experiment that shows how you can retrieve the coordinates and ROI (i.e. the name of asketchpadelement that was clicked). This works with all backends, including OSWeb.Also, make sure that you're running the latest version of OpenSesame 4.1 with all updates applied!
If this doesn't answer your question, can you clarify exactly what goes wrong?
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Dear Sebastian,
thanks for bringing this to my attention, thus the video when using osweb and mouse responses requiring definitions of rois using java script is outdated? I will try to re-program my experiment using the cursor_roi and open a new inquiry with my code in case I do not manage getting it to work.
p.s. I realized you did not add a logger file and logged only cooordinates but not "meaningful" responses, i.e. blue or bunny/target (to refer to Lottes example), but this is the stage in which my problems arise.
@mgade
thus the video when using osweb and mouse responses requiring definitions of rois using java script is outdated?
Indeed!
p.s. I realized you did not add a logger file and logged only cooordinates but not "meaningful" responses, i.e. blue or bunny/target (to refer to Lottes example), but this is the stage in which my problems arise.
You should always add a
loggeritem to the end of your trial sequence! The reason I did not do that here is simply because it's not a full experiment, just a demo of how to use regions of interest.Check out SigmundAI.eu for our OpenSesame AI assistant!