[solved] Recording multiple responses in one trial
On GitHub, Trombonechamp points out that multiple responses in one trial will overwrite each other. This makes it problematic to record, for example, the duration that has elapsed between two key presses.
Proposed solution
Add a prefix or suffix to all response variables, so that responses from multiple items won't overwrite each other. For example, a keyboard_response item named "resp", would record responses as [response_resp]. This is in addition to the old [response] variable, which is kept for backward compatibility.
Current workaround
To solve this issue for now, an inline_script item is required that renames the variables after they have been collected. For example:
Proposed solution
Add a prefix or suffix to all response variables, so that responses from multiple items won't overwrite each other. For example, a keyboard_response item named "resp", would record responses as [response_resp]. This is in addition to the old [response] variable, which is kept for backward compatibility.
Current workaround
To solve this issue for now, an inline_script item is required that renames the variables after they have been collected. For example:
self.experiment.set("response_a", self.get("response"))
self.experiment.set("response_time_a", self.get("response_time"))
self.experiment.set("correct_a", self.get("correct"))
Comments
Added as a feature request on GitHub #28.
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
How do you collect multiple responses using the Parallel Plugin? The above code does not seem to work using this method.
Thanks
Anthony McGuffie
Hi Anthony,
The problem described in this post is that there used to be only a single
response
variable, which made it impossible to distinguish responses collected in multiple response items. For example when you had twokeyboard_response
items in a trial sequence. But the solution proposed above has been implemented already way back. (The post is from 2011.) See also:But this is unrelated to the
parallel
plug-in. Could you describe in more detail what you're trying to do, and what problems you run into?Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
I am trying to create an Implicit Memory task that I have previously used in E-Prime.
It is a dual task where participants are shown a word for 0-2000ms and at the same time (0-1000ms) there is a 3 digit number (num1) displayed above. At 1000ms-2000ms a second 3 digit number is displayed (num2) and (num1) disappears.
The user responds with an 'x' if the word is living and also an 'm' if num1 and/or num2 is an odd number.
This means there is a possible number of 3 individual responses within the 2000ms stimulus presentation. I have created 2 sketchpads (stim1) and (stim2) each duration being 1000ms and used the Parallel Plugin to record the responses.
The problem I have is when using the Parallel Plugin, where to insert the inline code following the keyboard_response to collect all 3 responses. Has this method been tried in the past?
I have supplied a link for you to get an idea of what i am trying to achieve.
https://www.dropbox.com/s/it4yafta9huun9a/ImplicitMemory.opensesame?dl=0
Thanks
Anthony McGuffie
Hi Anthony,
Right, I see. So if I understand correctly, you want to show three
sketchpad
s (num1, num2, and blank) and collect three responses at the same time. Is that correct?You can do this by adding two
sequence
s to yourparallel
item. The firstsequence
contains threekeyboard_response
item, thus collecting three responses. The secondsequence
contains threesketchpad
s for the stimulus presentation. Like so:So I don't think you will need any scripting at all for this. For a simple example, see this gist:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
I have been working on open sesame for making a time series experiment for Necker cube perceptual switches. So how can I collect more than 250 key press responses on every perceptual switch which showing the same Necker cube target for around 5-6 minutes as a free viewing task. considering the fact that target should remain consistently in the screen without creating any visible changes.
Thanx
Shradha
Hi Shradha,
There are two ways:
1) A little crude, but you can make a simple
loop
with asketchpad
(for the cube with a duration of0
), akeyboard_response
(durationkeypress
) and alogger
. The trick is to set the number of repetitions of the loop to a very high value, so that it basically runs forever (sort of). Additionally, you check in theloop
how much time has passed since you entered it, and break it as soon as 5-6 minutes have passed.2) Move everything into an
inline_script
. Something like that:Quite simple, you see?
Good lcuk,
Eduard