Пример #1
0
feedbackscreens[1].draw_text(text='correct', colour=(0,255,0))
feedbackscreens[0] = libscreen.Screen()
feedbackscreens[0].draw_text(text='incorrect', colour=(255,0,0))

# # # # #
# run the experiment

# run 20 trials
for trialnr in range(1,21):
	# prepare trial
	trialtype = random.choice(['left','right'])
	
	# present fixation
	disp.fill(screen=fixscreen)
	disp.show()
	libtime.pause(random.randint(750, 1250))
	
	# present target
	disp.fill(targetscreens[trialtype])
	t0 = disp.show()
	
	# wait for input
	response, t1 = kb.get_key()

	# end the experiment when 'escape' is pressed
	if response == 'escape':
		break
	
	# process input
	if response == trialtype:
		correct = 1
Пример #2
0
    tracker.status_msg("trial %d/%d" % (trialnr + 1, ntrials))

    # perform a drift check
    tracker.drift_correction()

    # wait for the other player

    # RUN TRIAL

    # present image
    disp.fill(scr)
    t0 = disp.show()
    tracker.log("image online at %d" % t0)

    # wait for a bit
    timer.pause(TRIALTIME)

    # reset screen
    disp.fill()
    t1 = disp.show()
    tracker.log("image offline at %d" % t1)

    # stop recording
    tracker.log("TRIALEND %d" % trialnr)
    tracker.stop_recording()

    # TRIAL AFTERMATH
    # bookkeeping
    log.write([trialnr, images[trialnr], t1 - t0])

    # inter trial interval