Welcome! Log In Create A New Profile

Advanced

Escape to pause experiment doesn't clear subject screen

Posted by vdcosta 
Escape to pause experiment doesn't clear subject screen
February 12, 2021 02:59AM
Hi Jaewon,

We are running into an issue wherein when we hit 'ESC' to pause the experiment upon completion of the trial the displayed cues remain on the subject's screen while the Pause screen displaying the various menu items like [SPACE to restart] and [Q to quit] is displayed on the experimenter's screen. Is this a known bug that is corrected in the latest version?

The same issue occurs if we program a hot key to end the trial.

Best,
Vinny
Re: Escape to pause experiment doesn't clear subject screen
February 12, 2021 10:04AM
It is an intended feature in order to display the last scene of a trial through the inter-trial interval. If you don't turn off stimuli explicitly, they stay on the screen until the next trial begins.

To turn off all stimuli, use toggleobject (if you are using Timing Script v1).
toggleobject(1:length(TaskObject), 'status','off');

If you wrote the script in Timing Script v2, stimuli are off when a scene is finished but you still see them just because the screen is not updated until the next scene begins. To present the cleared screen, run a blank scene or call idle() at the end of a trial.
idle(50);  % run a blank scene
Re: Escape to pause experiment doesn't clear subject screen
February 12, 2021 07:40PM
Ah, that makes sense. Thanks Jaewon.
Re: Escape to pause experiment doesn't clear subject screen
January 04, 2023 01:57AM
I ran into a similar problem.
It just so happened we needed to clear our screen no matter what, so I had thought just adding

idle(0);

to the end of the timing script would be fine.

However, it was not always able to consistently guarantee a pause screen with nothing on it.
I found, that you had to explicitly add the following at the end of the script in order to guarantee a clean screen no matter when the pause hotkey is hit, assuming you used the escape_screen() function.

if 0==error_type
idle(PAUSE_TIME_CORRECT);
else
idle(PAUSE_TIME_NOT_CORRECT);
end

I am not sure why, but without including an if statement it doesn't run as expected.
Re: Escape to pause experiment doesn't clear subject screen
January 08, 2023 12:41PM
That makes no sense. Your if statement calls idle() whether the condition is true or not and therefore is equivalent to a single idle().

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.