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=1) 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 vbrohkmvgurtxdxdliun(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # # # return self.player.treatment == 'ten' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'ten' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "USD" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 dikntzfnkzosqxdhoqqv(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # return self.player.treatment == 'eleven' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'eleven' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "USD" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 fjbjpalcouffpknoaxid(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # return self.player.treatment == 'twelve' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twelve' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "USD" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 vbrohkmvgurtxdxdliun2(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # return self.player.treatment == 'ten' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'ten' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "EUR" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 dikntzfnkzosqxdhoqqv2(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # # return self.player.treatment == 'eleven' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'eleven' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "EUR" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 fjbjpalcouffpknoaxid2(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # # return self.player.treatment == 'twelve' def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'twelve' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "EUR" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 tussenpage(Page): form_model = "player" def before_next_page(self): self.player.set_payoff() def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'ten' or self.participant.vars['treatment_assignment'] == 'eleven' or self.participant.vars['treatment_assignment'] == 'twelve' class pqxlzokhnietlwsrohkp(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # return self.player.treatment == 'twelve' # 6% markup sequential def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'fifteen' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "USD" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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 pqxlzokhnietlwsrohkp2(Page): form_model = "player" form_fields = ['DCC', 'my_hidden_input', 'confirm'] # def is_displayed(self): # return self.player.treatment == 'ten' # 6% markup sequential def is_displayed(self): return self.participant.vars['treatment_assignment'] == 'fifteen' def app_after_this_page(self, upcoming_apps): if self.player.DCC == "EUR" and self.player.confirm == "confirm": return upcoming_apps[0] def error_message(self, values): print('values is', values) if values["DCC"] == None and values["confirm"] == "confirm": return 'Please select the payment option or view the other payment option' 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() page_sequence = [ vbrohkmvgurtxdxdliun2, vbrohkmvgurtxdxdliun, dikntzfnkzosqxdhoqqv2, dikntzfnkzosqxdhoqqv, fjbjpalcouffpknoaxid2, fjbjpalcouffpknoaxid, pqxlzokhnietlwsrohkp2, pqxlzokhnietlwsrohkp ]