Howdy, Stranger!

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

Supported by

[open] Does a variable have to be defined in loop table to be called as [' '] in sketchpad?

edited May 2015 in OpenSesame

HI there,

i am trying to set sketchpad duration as the value of a variable that will be given a value half way through a sequence. I am creating a delay which will add a bit of time after a participant responds. I want to do this to make sure all my trials are the same length.

resp_time= exp.get('response_time_gamepad_response')
exp.set('delay', 2000 -int(resp_time))

in my sketchpad i have put [delay]. If i do not include a variable called delay in the loop variable table, then it gets confused and cannot locate a variable 'delay'. If i do include it, and just fill it with dummy values e.g. zeros, then change the value of 'delay' to the script above, it keeps with the original value (zero) and does not change the value of delay depending on how fast a participant responded. Please help!

Many thanks,

Josh

Comments

  • edited May 2015

    Hi Josh,

    I think the problem here lies in the internal order, in which the elements of a sequence are called. A sketchpad is set up in the prepare phase, that means, that every variable that you want use in that particular sketchpad has to be defined before. Response time sampling occurs in the run_phase and won't have any influence on sketchpads of that sequence. Do you see, what I mean?

    As a solution, you can try a small "trick". Instead of adjusting the duration of the current sketchpad, you can add a new sequence with a single sketchpad inside, that runs only once for a duration you can use your variable [delay] for.

    Let me know if you need more help.

    Good luck,

    Eduard

    Edit: I adjusted the title of this discussion, because it would be too long otherwise

    Buy Me A Coffee

Sign In or Register to comment.