Howdy, Stranger!

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

Supported by

Using multiple keyboards

Hi,

I'm building a group task (random dot motion) where I want to collect 3 individual responses per trial. Searching through the forum, I understood that using Chronos response boxes isn't an option when working with OpenSesame (at least not one easy one). Therefore, next best thing I could think of, is using 3 different keyboards with different key mapping for each participant to tackle this.

To be a bit more practical -

1) Each participant would have 2 response keys (6 keys in total).

2) Each participant could only make one, unchangable, decision each trial (first correct/incorrect response will be collected for each participant.

3) Trial should last untill 3 responses collected (+1 second delay) or 10 seconds have passed, whichever met first.

Should I expect any problems using 3 keyboards (e.g. fetching few responses at the same~ time)?

Also, say this is possible, if anyone has any ideas towards dealing with the programming side I'd be happy to consult with you (I've attached the working single participant experiment. It's just a matter of converting this to a group experiment).

Thank you,

Omer


Comments

  • O.K. so I pretty much got it doing what I wanted (1 and 2 for now). I tested it using 1 keyboard for now and it seems to be working.

    Still, if anyone know whether I should expect any technical issues using 3 different keyboards I'll be glad to hear.

    Thanks,

    Omer

  • Hi Omer,

    I wouldn't expect any problems with 3 keyboards, but still it would make sense to extensively test the procedure.


    Implementing point 3 shouldn't be very hard. Put an inline_script with the line: `var.start_time = clock.time()`before the keyboard_response item and then in the duration field of each keyboard response item `11000-[start_time]` and maybe another inline_script after the last keyboard_response item, in which you sleep for another second (using the clock.sleep function)


    I hope this helps,

    Eduard

    Buy Me A Coffee

  • ...
    var.allkeys = ['q', 'p', 's', 'l', 'z', 'm']
    
    timer = core.CountdownTimer(10.0)
    
    while var.allkeys != [] and timer.getTime() > 0: 	
    	for i in range(500):
    		ds.draw() # prepares the stimulus
    		win.flip() # makes stimulus visible on window
    		var.keys = event.getKeys(keyList=var.allkeys) # begins with all mapped keys eligible
    		
    		if var.keys != []:
    			# participant 1
    			if any(c in var.keys for c in ('q', 'p')): # if this part. responded then -
    				t1 = self.time() # take time
    				response1 = var.keys[0] # save response
    				response_time1 = t1 - t0 # caculates response time
    				exp.set('response1', response1) # log response
    				exp.set('response_time1', response_time1) # log RT
    				if self.get('response1')==self.get('correct_response1'):
    					exp.set('correct1',1) # log accuracy
    				else:
    					exp.set('correct1',0)
    				var.allkeys = [item for item in var.allkeys if item not in ['q', 'p']]
    				if var.allkeys == []: # if this part. was last to respond - finish trial
    					time.sleep(1.0)
    					break
    				continue
    				
    			# participant 2	
    			elif any(c in var.keys for c in ('s', 'l')):
    				t2 = self.time()
    				response2 = var.keys[0]
    				response_time2 = t2 - t0 # caculates response time
    				exp.set('response2', response2)
    				exp.set('response_time2', response_time2)
    				if self.get('response2')==self.get('correct_response2'):
    					exp.set('correct2',1)
    				else:
    					exp.set('correct2',0)
    				var.allkeys = [item for item in var.allkeys if item not in ['s', 'l']]
    				if var.allkeys == []:
    					time.sleep(1.0)
    					break
    				continue
    				
    			# participant 3	
    			elif any(c in var.keys for c in ('z', 'm')):
    				t3 = self.time()
    				response3 = var.keys[0]
    				response_time3 = t3 - t0 # caculates response time
    				exp.set('response3', response3)
    				exp.set('response_time3', response_time3)
    				if self.get('response3')==self.get('correct_response3'):
    					exp.set('correct3',1)
    				else:
    					exp.set('correct3',0)
    				var.allkeys = [item for item in var.allkeys if item not in ['z', 'm']]
    				if var.allkeys == []:
    					time.sleep(1.0)
    					break
    				continue
    

    First - thanks for your reply Eduard.

    This is where I'm at at the moment. It's not neat, my python knowledge is limited, but it is still the closest working version of the idea I'm trying to implement.

    As mentioned before, this covers points 1) and 2) and some of 3) (trial ends if all paricipants answered or after some time had passed) BUT:

    a) Countdown doesn't really count 10 sec, it stops the trial after aprox. 16.6 sec. It seems like I've implented it wrong in some way.

    b) Since my stimulus isn't static, using time.sleep (I've also tried core.wait) results in the stimulus freezing for the sleep/wait duration. I want to stimulus to keep 'running' for a shortwhile after last participant's key press.

    Would appreciate your input once again,

    Omer

  • Hi Omer,

    I usually don't use pygame functions directly, so I'd need a little more time to read through your code and find out what went awry. Do you still need help on that issue?

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games