Register response with continuous trial
in OpenSesame
For a study I am compiling a CCPT task. However, it is not possible to register a response while the trial continues. Can anyone help with this?
Comments
Hi @guusG ,
I ran your script and don't encounter any problems. If participants press the space bar, the variable 'response' gets the value "space". If participants withdraw from responding, the 'response' gets the value 'None'. (Note the capital, in your block_loop you wrote "none" instead of "None".)
What issue are you referring to exactly?
Cheers,
Lotje
Did you like my answer? Feel free to

Hi lvanderlinden , Lotje,
I want stimuli with an interstimulus interval and in that fixed interstimulus interval it must be possible to register a response without disturbing the response length of the interval. In other words: How can I register a response without the trial actually stopping and the interval therefore remaining long?
Note that it concerns an online study where inline coding cannot be used.
Hopefully you can help me further!
Thanks in advance.
Hi Guus,
the solution would be to have following construction:
Importantly, sketchpad 2 and sketchpad 1 should be identical visually. Then what you want to do is:
Does that make sense? Let us know if you need help implementing this.
Eduard
Hi @eduard ,
Thank you for taking the time to help me!
I still can't manage it .. I have made your changes (see file). Would you like to see where I'm going wrong?
Are you sure it is possible to make this adjustment for the OSweb version / online use?
Kind regards, Guus
P.S. I have little experience with the program so it may well be that I overlooked something simple... ;)
Hi @guusG ,
With a little bit of JavaScript inline code you can calculate the duration of the second sketchpad:
inline_javascriptitem after yourkeyboard_responseitemRuntabsquare-bracketsyntax to use the new duration for the second displayfeedbackitem (instead of a normalsketchpad) for the second display, becausefeedbackitems allow using variables that are defined only in theRunphase (instead of thePreparephase) of your experiment, as is the case for response variables such as response timeAfter doing so, your experimental overview should look something like this:
I attached the modified experiment.
For more information about using JavaScript in OSWeb, see:
For more information about the difference between
sketchpadandfeedbackitems, see:Hope this helps!
Cheers,
Lotje
Did you like my answer? Feel free to

Hi @lvanderlinden ,
This really helps!
Most times it works well, however he sometimes interrupts the task with the message "values should not be negative". How can I fix this? (It often occurs when I run the whole 'experimental cycle')
Thanks in advance!
Hi,
That's just because the response time is larger than the ISI. So either prevent that from happening (set a timeout for the keyboard response to the ISI, or accept that situation, but adapt the duration of the second sketchpad to be 0.
vars.duration_sketchpad2 = vars.ISI - vars.response_time if (vars.duration_sketchpad2 < 0){ vars.duration_sketchpad2 = 0 }Eduard
Hi @eduard ,
Awesome thanks! It works in the OpenSesame environment now. On OSWeb I only get to see the text displays. Not the rest of the experiment. Any idea how I can fix this? Then everything would be resolved! :)
Hi @guusG ,
I can't reproduce this issue with the version of your experiment that was posted here most recently. Could you upload the most recent version?
Cheers,
Lotje
Did you like my answer? Feel free to

Hi Lotje,
This is the latest version:
Thanks!
Hi @guusG ,
For me the experiment works fine, both when I do a test run in the browser and when I import it on JATOS. What do you mean exactly when you say
On OSWeb I only get to see the text displays
What displays do you see exactly, and which ones are skipped? There used to be an issue with an older version of OpenSesame where all
loopswith only one iteration were skipped. Could you make sure you are running OSWeb 1.3.13?Cheers,
Lotje
Did you like my answer? Feel free to

Hi @lvanderlinden ,
Thank you very much for this tip! Looks like it works now. The version was not up to date.
Thanks!
Great! Thanks for reporting back! :)
Did you like my answer? Feel free to
