Howdy, Stranger!

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

Supported by

[solved] mouse_responses

edited January 2014 in OpenSesame

Hi Sebastian,
i have designed my experiment by opensesame as following:

fixation_dot (Duration: 750ms)
picture_prime (Duration: 750ms)
pause_1 (Duration: 500ms)
question_mark (Duration: 0) (start of response interval)
sound_target (Duration: 0) (start of response interval)
mouse_response (timeout: 2000ms)
pause_2 (Duration: 1000ms)

After a mouseclick the response time should be collected and the next item should be appeared. Now my problem:
the experiment runs trouble-free, while i click the mouse, the response time is collected, but if i don't click the mouse (as i don't know the correct response), give opensesame the following error message after the timeout (2000ms):
An unexpected error occurred, which was not caught by OpenSesame. This should not happen! Message:
'NoneType' object is unsubscriptable
best regards
Madjid

Comments

  • edited 10:55PM

    Hi Madjid,

    I see. Could you perhaps post the full error message (stracktrace) so I can see where there error occurs? You will find this in the debug window (Control+D).

    Cheers,
    Sebastiaan

  • edited January 2014

    thx sebastian,

    here the error message:

    Python 2.6.6
    Type "help()", "copyright()", "credits()" or "license()" for more information.
    Type "modules()" for details about installed modules and version information.
    Use the "print [msg]" statement in inline_script items to print to this debug window.
    >>> 
    openexp.sampler._legacy.init_sound(): sampling freq = 44100, buffer size = 1024
    openexp._canvas.legacy.init_display(): enabling hardware surface
    openexp._canvas.legacy.init_display(): enabling double buffering
    openexp._canvas.legacy.init_display(): video mode ok
    experiment.init_log(): using 'H:/Desktop/subject-0.csv' as logfile (ascii)
    experiment.run(): experiment started at Thu May 03 12:34:38 2012
    Traceback (most recent call last):
      File "libqtopensesame\qtopensesame.pyo", line 1647, in run_experiment
      File "libopensesame\experiment.pyo", line 258, in run
      File "libopensesame\sequence.pyo", line 59, in run
      File "libopensesame\loop.pyo", line 153, in run
      File "libopensesame\sequence.pyo", line 59, in run
      File "libopensesame\loop.pyo", line 153, in run
      File "libopensesame\sequence.pyo", line 59, in run
      File "libopensesame\mouse_response.pyo", line 98, in run
      File "libopensesame\generic_response.pyo", line 108, in process_response
      File "<string>", line 1, in <module>
      File "libopensesame\generic_response.pyo", line 90, in process_response_mouseclick
    TypeError: 'NoneType' object is unsubscriptable
    >>> 
    

    best regards
    Madjid

  • edited 10:55PM

    Hi Madjid,

    Ow, it's a bug, unfortunately. I filed it here: https://github.com/smathot/OpenSesame/issues/85. Thank you for bringing it to my attention.

    As a workaround, you could use the following inline_script instead of the mouse_response item (put the code in the run phase tab):

    from openexp.mouse import mouse
    start_time = self.time()
    my_mouse = mouse(self.experiment)
    button, position, timestamp = my_mouse.get_click(timeout=2000)
    self.experiment.set('response', button)
    self.experiment.set('response_time', timestamp-start_time)

    Hope this helps!

    Cheers,
    Sebastiaan

  • edited 10:55PM

    Hi Sebastian,

    thank you very much for the Script! Opensesame runs now perfect, but an another problem hat arisen. opensesame can no more evaluate the mean response time and accuracy as feedback for each subject at the end of each phase. It give an 'undefinde' response time and accuracy.
    best regards
    Madjid

  • edited 10:55PM

    Hi Madjid,

    Ow yes, that slipped my mind. If you record the responses manually, you also need to explicitly keep track of the feedback. There is another discussion where I posted some example code, which you should be able to use pretty much straight away: http://forum.cogsci.nl/index.php?p=/discussion/comment/361#Comment_361

    Cheers,
    Sebastiaan

Sign In or Register to comment.