[open] Need help collecting the time a key was pressed.
Hello,
I'm currently trying to make an experiment where the participant has to rate a set of eyes on a scale of 1-5. This part of the experiment I've found very easy to set up.
Unfortunately I also want to test the prospective memory of the participants at the same time, so need to record their keyboard press of the letter 'Q' when they have perceived 2 minutes to have passed. I'm new to open sesame and haven't the faintest idea how to have a participant rate eyes whilst also having a response to a totally different task at the same time, which I'd need a time stamp with to know how close the response was to 2 minutes actually passing.
Any help would be much appreciated.
Thank you very much,
Mark.
Comments
Hi Mark,
Welcome to the forum!
If I understand correctly your trial sequence is as follows:
Like you said, you will need the time stamps of the stimulus and the keyboard response for this. Luckily, these are very easy to obtain: The time stamp of any given item is contained by an existing variable called "time_" followed by the name of the item. So, for example, the variable "time_my_sketchpad" contains the time stamp of the last time the item "my_sketchpad" was called.
When applying this to your situation, I would suggest the following procedure:
The overview of your experiment should now look something like this:

The following script should give you an idea of how to determine the interval of interest per trial. Simply put this Python inline code to the Run phase tab of your inline_script item. See the comments for a more detailed explanation.
[pastebin:4TLKWwxY]
The complete example experiment can be downloaded here. Simply 'save as' with the extension ".opensesame".
Finally, note that can have a look at the list of existing variables simply by clicking the "show variable inspector" button in the main toolbar, like so:
I hope this helps! Please let us know if you have any further questions!
Best wishes,
Lotje
Did you like my answer? Feel free to
