[open] Quit by keypress
Hi all! First post here. We started using Opensesame for our Psychology course to build experiments, and now I've quite gotten to like it. So I was now trying to program an experiment of my own, but as it turns out that is harder than expected. So far I've done all the easy stuff (setting up a boring experiment), however what I can't seem to figure out is how to do the following.
I want the user to be able to quit by pressing a key. So right now the setup is I ask for some data, give an instruction, then the loop happens which is a simple and boring task, and the experiment is how long the users continue doing this loop.
For this I need the user to be able to quit the experiment and for it to still be logged. As far as I know it is only possible to quit by pressing esc, but when escape is pressed no logging happens.
It appears I can log the time by logging time_fixatie (my first sketchpad in the loop sequence), so I think I've figured that part out. It's just the having users be able to quit the experiment at any time they want by pressing a button that I can't seem to get right.
Any help would be very much appreciated!
Comments
Hi,
There are many ways to abort an experiment, but in your case it seems like you simply want to stop a
loopwhenever the participant has pressed a specific key. Is that right?You can do this using the break-if statement, which you'll find under 'Show advanced options' of the
loopitem. Say that you enter the following break-if statement:This means that the
loopwill end (or rather, no new cycle will start) when the variableresponsehas the valueq. Combined with akeyboard_responsethis will allow the participant to abort the loop by pressing 'q'.Does that make sense?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi sebastiaan,
I have been trying your solution for my experiment but it doesn't work.
Basically I want them to quit the experiment after they make a keypress to reject the consent form. But I keep getting an error of variable not present even when I try correct_response. Is there any other solution I could try?
Best,
H
Hi @hulya ,
What exactly do you mean? How do you present the consent form, and how is the response collected? And do you want to be able to run the experiment online with OSWeb (which has some restrictions) or on the desktop?
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!