Howdy, Stranger!

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

Supported by

Showing subjects responses during loop

Hey everybody!

I'm currently in the process of converting my numerical cognition experiment from Matlab to Opensesame so I'll be able to post it online, with everyone staying home at quarantine and what not.

I've encountered a difficulty in showing the subject's response during the same loop it is taken. When trying to display [response] in a sketchpad following a keyboard response, I just get the same response from before. If I try to change the variable to [response_subject_response] so it will match the keyboard response, I get an error message saying the that var doesn't exist. I guess the sketchpad is generated before the response is taken, and my question is - how to get around it?

Any help would be much appreciated :)

Comments

  • Hi Gilead,

    For online presentation of information (using variables that are response-related), use a feedback item instead of a sketchpad. They are identical except that the former is executed in the runphase while the latter is executed in the prepare phase (i.e. without the response being executed yet).

    See here for more detail: https://osdoc.cogsci.nl/3.2/manual/prepare-run/


    Eduard

    Buy Me A Coffee

  • Thank you very much! that did the trick.

    Is there any way to do the same for a keyboard_response, so that the Timeout period will be deducted from the previous keyboard response ? For example, if subjects have 8000 ms to provide a 2 digit answer, the second response timeout will be 8000-[response_time_1st_digit] ?

  • yes, but only with an inline_script. Put one after the response and write this code in the run phase:

    var.timeout = 8000-var.response

    [timeout] can then be used as the new timeout variable.

    Eduard

    Buy Me A Coffee

  • Thank you once again! for some reason, I still get the same error the variable 'timeout' does not exist.

  • Can you share the experiment? It's a little hard to debug when not knowing what exactly it is you did.

    Buy Me A Coffee

  • Sure thing. Right now still checking different things apart in the new environment.


  • Here the u[dated experiment. The same prepare-run strategy considerations hold for they keyboard response item, i.e. you can't use variables that are created in the run phase of an item in a keyboart item as it is set up in the prepare phase. Unfortunately, there is no run phase alternative to it. However, you can replace that item with an inline_script in which you poll for responses. You have to be more explicit to get the full functionality, but essentially you can do the same things (see here: https://osdoc.cogsci.nl/3.2/manual/python/keyboard/).


    Buy Me A Coffee

  • Alright, thank you very much! Guess I'll have to get more in depth with inline scripting.

Sign In or Register to comment.