Howdy, Stranger!

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

Supported by

Dual Task / BCE simultaneous keyboard response collection

Beautiful, helpful people!

I am working on a dual task backward crosstalk effect (BCE) experiment. The basic setup is simple, and I think this works well enough via the block loop table.

I present a fixation dot, to the left of the fixation dot appears a number, and after a given SOA (one of three possible SOAs), a second number appears to the left of the fixation dot.

The participant's task is to decide for both numbers whether they're odd or even.

They react to the first number with their left hand: press the y key for even numbers, and the x key for odd numbers (German keyboard layout).

They then react to the second number with their right hand: press the n key for even, the m key for odd numbers.

So far, so simple. Troublesome is the response collection. The response collection for Task 1 (the left number) has to start as soon as the first number is presented, and has to go on when the second numer (Task 2) is added. I have to be able to collect two responses to two tasks at the same time and I have no idea where to start with this. The only idea I have so far is that it could have something to do with coroutines, but otherwise, I'm at a blank.

I have Task 1 on a sketchpad, for the duration of [soa], then paint a second sketchpad with Task 1 and Task 2 on it. But when I put the keyboard_response between the two sketchpads, Task 2 won't appear until the keyboard response time window is over, which is much too late.

Plus, it has to be ensured that subjects respond to Task 1 first. If they press a key with their right hand first, and then with their left hand, the trial has to be marked as incorrect.

Any input is greatly appreciated. Thank you so much for your time.

Love, Vincent


  • edited April 24

    I started toying with the (extremely handy, thank you for implementing!) coroutine tool, and this is what I've come up with so far, which doesn't look too shabby, I think.

    However, I have more questions :)

    • how do I make it so, that the coutine is ended after BOTH responses are given? If participants answer to T2 first, it'll be ended right now (which in theory is fine, as it's gonna be a wrong trial anyway, but it can be irritating if you're trying to answer both tasks and get cut off)
    • I need a number of different feedback screens, how do I implement that they are called according to their proper preconditions?
    • 1) correct: shown if both responses T1 and T2 were correct AND in the correct order
    • 2) wrong order: shown if T2 was answered before T1
    • 3) incorrect: shown if either T1 or T2 or both were answered wrong
    • 4) too slow: shown if after 2500 ms after showing T1 either T1 or T2 or both weren't answered

    And how do I make it so that in the logfile only trials are marked correct where both T1 and T2 were answered correctly and in the right order?

  • Ever so slowly, I'm getting somewhere. At least it starts now, and I can get a "correct" feedback. All other feedbacks are "wrong" though, plus the thing crashes after the first trial with this:

    Unexpected error
    item-stack: experiment[run].practice_loop[run].block_sequence[run].block_loop[run].trial_sequence[run]
    exception type: TypeError
    exception message: unsupported operand type(s) for +: 'int' and 'str'

    My trial_sequence looks like this by now, with my dilettante attempt at implementing the four feedbacks.

    If anyone fancies having a look at the thing, I would be a) forever grateful and b) I have attached it.

    Big love and good night



  • I'm just keeping this thread updated, for two reasons. A) when someone looks into this, I want them to know where I stand so they don't comment on stuff I already figured out, and B) I thought it might be educational for people struggling with the same stuff.

    Please let me know if this is unwelcome spamming :)

    I found some of the errors in my trial_sequence feedback run if statements, it now looks like this:

    Naturally, I ran into new problems. In wrong order trials, I now get both feedbacks "Wrong" and "Wrong order", and I never get a "too slow" message, even when I don't answer at all, I get both "Wrong" and "Wrong order" feedback, one after the other.

    I also figured out I had an error in my loop table with the correct answers which I fixed, but what's really weirding me out is that I now never get the correct screen anymore.

    Here's an updated version of the experiment.

  • Hi Vincent,

    Sorry for not getting back to you earlier. How is it going? Could you solve your issue(s)?


Sign In or Register to comment.