Neuropsydia.py icon indicating copy to clipboard operation
Neuropsydia.py copied to clipboard

Abort experiment

Open cMadan opened this issue 7 years ago • 3 comments

Is there any way to abort an experiment? (E.g., pressing certain keys.)

cMadan avatar Jul 21 '17 18:07 cMadan

@cMadan there are currently no generic way to abort an experiment other than alt+tab and console quit. However, this can be easily added within the experiment code whenever a key press is required.

For instance:

....
n.refresh()  # Diplay stimulus on screen
response, RT = n.response()  # Collect the response and its time

# Categorize the response
if response == "SPACE" and stimulus == "green":
    response_type = "HIT"  # Hit
if response != "SPACE" and stimulus == "green":
    response_type = "MISS"  # Miss
if response == "ESCAPE":
    quit()

DominiqueMakowski avatar Aug 07 '17 09:08 DominiqueMakowski

Thanks! Maybe this can be added to the documentation somewhere?

I don't think alt-tab worked for me, but that may have been related to other video issues (see #21). In my case I had to ssh into my mac machine and kill the python process.

cMadan avatar Aug 07 '17 19:08 cMadan

@cMadan I'm back from holidays 😄, I added an example of how to enable quitting in the stroop tutorial in docs.

DominiqueMakowski avatar Aug 22 '17 07:08 DominiqueMakowski