Pause experiment within one trial
Hey everyone.
I'm working on an experiment in which the participants should be able to pause the experiment. I implemented a pause button (by mouse click) on my sketchpad using
if var.correct_cursor_pause == var.cursor_roi: exp.pause()
in my inline script.
Now if I resume the experiment after the pause it skips the current trial because that's just what exp.pause() does.
Does anyone of you know a way where I could resume to the current trial and not the next one? Maybe by breaking the loop?
Thanks in advance!
Comments
Hi @IgottaPauer ,
When you resume after a pause, the experiment will simply pick up where it left off, i.e. after
exp.pause(). However, the display is not restored back to its original state, and this may give the impression that the experiment continues to the next trial, rather than picking up where it left off. Could that be it? In that case, showing aCanvasorsketchpadthat indicates that the trial has resumed is a good way to fix this. For example, say that the last visiblesketchpadwas called last_sketchpad, then you could modify your script as follows:if var.correct_cursor_pause == var.cursor_roi: exp.pause() items['last_sketchpad'].run()However, whether that will work in your case or not of course depends on the details of your experiment!
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi sebastiaan,
thanks for the response. The sequence did in fact continue with the next trial, since there was a mouse_response collected by clicking on the pause button (I guess).
However I was able to fix it slightly different than you suggested:
if self.get('cursor_roi') == 'Pause' : exp.items['sequence_2'].prepare() exp.items['sequence_2'].run()This way the current sequence just starts over after pausing the experiment.
Thanks for the help!
Charlotte
That's a clever solution! You could even simplify it a bit to:
if var.cursor_roi == 'Pause' : items['sequence_2'].prepare() items['sequence_2'].run()Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks and thanks :D