Howdy, Stranger!

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

Supported by

Reaction time greater then less then

Hi All,
I have an inline scrip in my program but I'm having a little bit of trouble. I want participants to get a point only if their reaction time is between 5000 & 7000ms. My scrip is below please have a look and let me know if you might have a suggestion.
Thanks,
Steve

if 'response_time' > 5000 and 'response_time'< 7000:
var.counter += 1

Comments

  • Hi boraste,

    Maybe you get an 'indentation error'?
    In python it is important to mind the spaces/tabs of the beginning in each line.
    In your code you need a tab at the beginning of the second line. Just go at the end of the first line and press 'enter'. You will see it makes the indentation automatically.

    Hope this helps
    Stephan

  • Hi Boraste,

    If you don't provide more info, we can only guess what the issue could be. So, please help us helping you and share a little more information, i.e. preceding code, maybe even the experiment.

    Eduard

  • Hi All,
    I'm not getting an error from Python. The issue is that the counter should only increase if the participant is within +-1000ms from the target of 6000ms. I have attached the program the issue comes up in the UpdateCounter in the inline script. Also, thanks for all the help.
    Steve

  • Without having checked all your code, the main issue is that 'response_time' isn't a variable, but only a string. To access the variable you have to either use response_time or var.response_time (Probably the second one). Note that there are no quotation marks around variables, but around strings.

    Eduard

Sign In or Register to comment.