Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Alternately show canvases and record keypresses,
- # until a key has been pressed.
- self.set('flag',0)
- for i in range(N):
- t1 = self.time()
- canvas_list[i].show()
- key, t2 = my_keyboard.get_key()
- # wait for
- # the first keypress post the position in the loop that is marked by the variable 'critops'...
- if key is not None and i > self.get('critpos') and self.get('flag' ) == 0:
- if key == self.get("correct_response"): # if it's the correct key ...
- correct_sound.play()
- self.sleep(SOA-(t2-t1)) # wait for the next canvas for SOA minus RT
- self.set('flag',1) # a button has been pressed, stop checking
- else: # otherwise ...
- incorrect_sound.play()
- self.sleep(SOA-(t2-t1)) # wait for the next canvas for SOA minus RT
- self.set('flag',1) # a button has been pressed, stop checking
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement