Howdy, Stranger!

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

Supported by

Problem with condition assignment using _subject_parity_

Hi there

I am pretty sure this is a simple thing but, for the life of me, it's driving me crazy! I am trying to do condition assignment with the participant number (subject_parity), so one set of participants sees one sequence (blockloop1) and the other group sees a different sequence (blockloop2). It all works very well with odd numbers but not with even numbers. If I change the order, the error switches to the even numbers, so I know it has something to do with the evaluation order of the variable. Does anybody know why this would happen? any suggestions?

When I try the even numbers, it gives me the error message x should be int or float, not z but this does not make sense to me since subject_parity type is unicode. I tried defining it in an inline script, using a not(odd), and all sort of silly variations that don't work.

(I am running Opensesame 3.2.4 on a 64bit Windows 10 machine and I know next to nothing about python)


  • Hi azrael,

    From the Manual:
    subject_parity Is 'odd' if subject_nr is odd and 'even' if subject_nr is even. Useful for counterbalancing.

    Have you tried [subject_parity] == 'odd'?
    Another option: [subject_nr]%2 == 1 #divides by 2 and gives the rest, also helpful if you have 3 groups

    Maybe that helps

  • Thank you!!! Sorry for the late reply, your first suggestion worked perfectly!
    Cheers Stephan

Sign In or Register to comment.