Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[Rush hour] how to log responses

Hi All,

during the experiment i need to record the response(s) from the patient. They are arriving at the same serial interface as the sync pulses from MRI scanner, so it's impossible to use keyboard_response.
The MRI trigger is blocking condition of the experiment.

What i've tried is (inputchar is arriving from the response grip):
item.responses.add(response=inputchar, response_time=self.experiment.time(), item=item.name )
or
base_response_item.process_response(self, (inputchar, self.experiment.time()) )
deep in the library. Apparently, it's nor working.
I don't need to validate it right now. The postprocessing will be done in some other software.

Sorry for the rush, i need to run this in a couple of hours :disappointed:

Comments

  • Hi,

    To register a response, you can use the responses.add() function (no need to do item.responses.add()) as described here:

    You have the response (inputchar), but not the response time:the time difference between the onset of response collection, and the time at which the response was collected. The item keyword is optional (as are all other keywords, actually): it's just to disambiguate responses in case you have multiple response-collection items.

    So basically, you need to do something like:

    rt = clock.time() - t0 # where t0 is the onset of response collection
    responses.add(response=inputchar, response_time=rt)
    

    So t0 is the moment at which response collection started. But how you can determine that is unclear from your description.

    Cheers,
    Sebastiaan

  • Hi Sebastiaan,
    the response comes on the serial interface and i need to process it there. Therefore,

    File "X:\Install\OpenSesame\3.1.4-py3.5-win64\lib\site-packages\share\opensesame_plugins\syncbox\libsyncbox.py", line 231, in get_button_press
    responses.add(response=inputchar, response_time=self.experiment.time())
    NameError: name 'responses' is not defined

    Ok, this seems to work:

    if len(inputchar) > 0:
                    self.experiment.responses.add(response=inputchar, response_time=self.experiment.time())
                    print("[{}]: expected '{}', got '{}'".format(self.experiment.time(), self._syncboxResponse, inputchar))
    

    At least the debug shows:

    [14214.0]: expected 's', got 's'
    [17539.0]: expected 's', got 'd'
    [18544.0]: expected 's', got 'd'
    [18778.0]: expected 's', got 's'
    [21640.0]: expected 's', got 'a'
    [23424.0]: expected 's', got 's'

    's' is a sync trigger from the scanner, while 'a', 'b', 'c' and 'd' are responses from the hand grips.

    Just 's' is visible in the log file right now, but this will be a different story.

    I prefer to log the absolute timing of the response, where t0 is the start of the experiment. I can check the Nordic Actia logs in the lab, while right now I think the are also logging time from the beginning of the experiment.

Sign In or Register to comment.