[open] Logging problems/inline script issues
Hey guys,
We've enjoyed using you're open source programme, it works great!
However, we've encountered a little problem with logging our keyboard response. Our goal is by pressing a 'j' or 'n' to record if the participant does or does not see an image. We use a loop function with a sequence, wherein the image is followed by an inline script and a logger. We've first used a keyboard response function, but in this function there was no response on when somebody pressed j or n. Next, we used an inline script, found on the webpage, but here all the logging information said "NA". We used this script:
from openexp.keyboard import keyboard
my_keyboard = keyboard(exp, keylist=['j', 'n'], timeout="0")
start_time = self.time()
key, end_time = my_keyboard.get_key()
self.experiment.set('response', key)
self.experiment.set('response_time', end_time - start_time)
What we want, is for Open Sesame to record when the participant sees the image (i.e. at what time in the sequence the participant presses 'j'), and to record when the participant presses 'j' and stops recording when he stops pressing the button, so we can log for how long the participant sees the image.
Kindest regards,
Susan, Marjolein, Anouk, Tim
Comments
If all you want to do is record the timestamp of a key press, then the keyboard_response is what you want. You could use an inline_script as well, but there's really no need. If the keyboard_response didn't appear to work, the problem is presumably elsewhere in the experiment. If you have trouble finding it out, perhaps you could post a screenshot of the overview area?
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!