# Path: pygaze/libscreen.py

# 
# Path: pygaze/libtime.py
# def expstart():
# def get_time():
# def pause(pausetime):
# def expend():
# 
# Path: pygaze/libinput.py

# 
# Path: pygaze/liblog.py

# 
# Path: pygaze/settings.py
# class Settings(object):
#     def __init__(self):
#     def read_module(self, mod):
#     def __getattr__(self, setting):
#     def __setattr__(self, setting, value):


import random
from pygaze import libscreen
from pygaze import libtime
from pygaze import libinput
from pygaze import liblog
from pygaze import settings

# create logfile object
log = liblog.Logfile()
log.write(["trialnr", "trialtype", "response", "RT", "correct"])

# create screens
fixscreen = libscreen.Screen()
fixscreen.draw_fixation(fixtype='cross',pw=2)
targetscreens = {}
targetscreens['left'] = libscreen.Screen()
targetscreens['left'].draw_circle(pos=(settings.DISPSIZE[0]*0.25,settings.DISPSIZE[1]/2), fill=True)
targetscreens['right'] = libscreen.Screen()
targetscreens['right'].draw_circle(pos=(settings.DISPSIZE[0]*0.75,settings.DISPSIZE[1]/2), fill=True)
feedbackscreens = {}
feedbackscreens[1] = libscreen.Screen()
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()

# Path: pygaze/libscreen.py

# 
# Path: pygaze/libtime.py
# def expstart():
# def get_time():
# def pause(pausetime):
# def expend():
# 
# Path: pygaze/libinput.py

# 
# Path: pygaze/liblog.py

# 
# Path: pygaze/settings.py
# class Settings(object):
#     def __init__(self):
#     def read_module(self, mod):
#     def __getattr__(self, setting):
#     def __setattr__(self, setting, value):


# Path: examples/simple_experiment/simple_experiment.py
import random
from pygaze import libscreen
from pygaze import libtime
from pygaze import libinput
from pygaze import liblog
from pygaze import settings


# create logfile object
log = liblog.Logfile()
log.write(["trialnr", "trialtype", "response", "RT", "correct"])

# create screens
fixscreen = libscreen.Screen()
fixscreen.draw_fixation(fixtype='cross',pw=2)
targetscreens = {}
targetscreens['left'] = libscreen.Screen()
targetscreens['left'].draw_circle(pos=(settings.DISPSIZE[0]*0.25,settings.DISPSIZE[1]/2), fill=True)
targetscreens['right'] = libscreen.Screen()
targetscreens['right'].draw_circle(pos=(settings.DISPSIZE[0]*0.75,settings.DISPSIZE[1]/2), fill=True)
feedbackscreens = {}
feedbackscreens[1] = libscreen.Screen()
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))