Howdy, Stranger!

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

Supported by

Dual Task Response Collection

Hi There,

I’m currently designing a dual task experiment with OS and am finding some it a bit challenging on collecting responses for both Task 1 and Task 2.

In the experiment, I would like to present Task 1 (an audio-visual stimulus is presented) followed by Task 2 (a lexical decision task). Presentation of both stimuli was quite simple (thanks to OS :) ). The problem I have is with the response collections.

I would like to collect response for Task 1, starting from the presentation of Task 1 and end until ‘keypress’. In other words, response collection should continue even when Task 2 is being presented, until an allowed response is given by the participants.
As for task2, response should be only collected after response of task 1. (See fig).

I’m wondering how I could implement this idea in OpenSesame.

Essentially, I probably need to run the following in parallel:
1. Presentation of Task 1
2. Response of Task 1
3. Presentation of Task 2

I have tried the inline script and coroutines as suggested in this post
(http://forum.cogsci.nl/index.php?p=/discussion/7/solved-recording-multiple-responses-in-one-trial, ), but I’m running two problems.
1. It seems OS is not picking up the keyboard responses when during Task 1’s presentation. It only picks up responses after both task1 and task2 are presented
2. If the Task 1 response was given after the coroutines end(in this case, after 5000ms), OS logs it as zero in the log file.

Not sure if I’m missing something here or if there’s anything I could have done differently here.

Thank you for your help in advance :)
YTLF

Comments

  • Hi YTLF,

    Sorry for the late reply. Have you sorted it out by now? Unfortunately, I'm not very experienced with coroutines, but this little script below is able to handle stimulus presentation and collection in a dual-task.

    Hope this helps.


    #init objects stim1_cv = canvas() stim2_cv = canvas() blank_cv= canvas() kb1 = keyboard(timeout = 2) kb2 = keyboard(timeout = 2) # draw stimuli stim1_cv.circle(-100,-100,50,fill=True,color='red') stim2_cv.circle(100,100,50,fill=True,color='green') # specify timing (onsets stim2 = 2000 # 1 second presentation stimulus 2 blank1 = 1000 # blank presentation for 1 secodns blank2 = 3000 # blank presentation for 1 secodns trial = 5000 # total time of a trial # run tasks var.resp1 = None var.resp2 = None var.t0= stim1.show() # start timer and show stimulus 1 while True: trialTime = clock.time()-var.t0 # take another time sample if trialTime > trial: break elif trialTime > blank2: blank_cv.show() elif trialTime > stim2: stim2_cv.show() elif trialTime > blank1: blank_cv.show() if var.resp1 != None and var.resp2 == None : var.resp2,var.respTime2 = kb2.get_key() elif var.resp1 != None and var.resp2 != None : # if both responses are given, either wait until the timeout, or break the loop pass # waits # break # breaks else: var.resp1,var.respTime1 = kb1.get_key() var.t1 = clock.time() # trial end time

    i haven't tested it, but something along these lines does the trick.

    Good luck.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.