from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants import random import os import datetime as dt from datetime import datetime,tzinfo,timedelta class Zone(tzinfo): def __init__(self,offset,isdst,name): self.offset = offset self.isdst = isdst self.name = name def utcoffset(self, dt): return timedelta(hours=self.offset) + self.dst(dt) def dst(self, dt): return timedelta(hours=-5) if self.isdst else timedelta(0) def tzname(self,dt): return self.name GMT = Zone(0,False,'GMT') EST = Zone(-5,False,'EST') CET = Zone(1, False, 'CET') class Page_1_welcome(Page): form_model="player" form_fields = ["accept"] def error_message(self, values): print('values is', values) if values["accept"] == False: return 'To start the task, please grant permission to use your anonymized data for scientific purposes' elif "msie" in self.request.META['HTTP_USER_AGENT'].lower(): return "Please use another browser such as Safari or Firefox or Chrome" elif "rv:11.0" in self.request.META['HTTP_USER_AGENT'].lower(): return "Please use another browser such as Safari or Firefox" class Page_1_instructions(Page): pass class Page_2(Page): form_model = "player" form_fields = ['destination_1'] class Wait_page_plane(Page): timeout_seconds = 1 class Page_3(Page): form_model = "player" form_fields = ["purchase_1", "exchange_rate"] def vars_for_template(self): return dict( tomorrow = dt.date.today() ) class new(Page): timeout_seconds = 5 class ulbtzsurvqpredwfubcf(Page): form_model = "player" form_fields = ["DCC", 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'one' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'one' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() # def before_next_page2(self): # if self.player.DCC == "EUR": # self.participant.vars['dcc'] = "EUR" # elif self.player.DCC == "USD": # self.participant.vars['dcc'] = "USD" class zwpxnpqocnqdltyhvoed(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # # return self.player.treatment == 'two' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'two' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' # def vars_for_template(self): # return dict( # tomorrow=dt.datetime.now(CET) # ) def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class ikemozdzqinowxacpshe(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'three' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'three' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class qxkcpylqmntznvxskdzp(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'four' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'four' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class lcycectltcfvryvkfyis(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # # return self.player.treatment == 'five' #used to be treatment five def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'sixteen' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class dyuipifbrzmyjudoccnr(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'six' #used to be treatment 6 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'seventeen' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class hpuzcxkctuxfknxznqtr(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'six' # used to be treatment 6 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'eighteen' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow=dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class psfqzrtlpjlxiaxbvbkc(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'seven' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'seven' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class zpxppgqbfqugaandldkn(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'eight' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'eight' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class jubfdmylntyrdqdpilxp(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] # def is_displayed(self): # return self.player.treatment == 'nine' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'nine' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class pdbnbfurxyxnmgbgdmsn(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #plain page, with 6% treatment # def is_displayed(self): # return self.player.treatment == 'nine' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'thirteen' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class omjmigghvlsdgmqwyohx(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #default, with 6% treatment # def is_displayed(self): # return self.player.treatment == 'nine' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'fourteen' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( # tomorrow = dt.now(CET) tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class slwgtsdfudsnhrvxmfvi(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #treatment 19 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'nineteen' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class flslzvhpljmptrcqakax(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #treatment 20 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twenty' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class shhzbehrtrcqdtujrnwo(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #treatment 21 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twentyone' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class fhgljdtpmoisbengdvbz(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #treatment 22 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twentytwo' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class seizwnshbihlzeqleopu(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #treatment 23 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twentythree' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() class fewttoouutdcqcwrevia(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input'] #treatment 24 def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twentyfour' def error_message(self, values): print('values is', values) if values["DCC"] == None: return 'Please select a payment option on the terminal' def vars_for_template(self): t = timedelta(hours=-5) return dict( tomorrow = dt.datetime.utcnow() + t ) def before_next_page(self): self.player.set_payoff() page_sequence = [ Page_1_welcome, Page_1_instructions, Page_2, Wait_page_plane, Page_3, new, ulbtzsurvqpredwfubcf, zwpxnpqocnqdltyhvoed, ikemozdzqinowxacpshe, qxkcpylqmntznvxskdzp, lcycectltcfvryvkfyis, dyuipifbrzmyjudoccnr, psfqzrtlpjlxiaxbvbkc, zpxppgqbfqugaandldkn, jubfdmylntyrdqdpilxp, pdbnbfurxyxnmgbgdmsn, omjmigghvlsdgmqwyohx, hpuzcxkctuxfknxznqtr, slwgtsdfudsnhrvxmfvi, flslzvhpljmptrcqakax, shhzbehrtrcqdtujrnwo, fhgljdtpmoisbengdvbz, seizwnshbihlzeqleopu, fewttoouutdcqcwrevia, ]