from . import models from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants import random class consent(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class code(Page): def is_displayed(self): return self.subsession.round_number == 1 form_model = models.Player form_fields = ['subjectid'] pass class instructionpage0(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage1(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage2(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage3(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage4(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage5(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage6(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage7(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage8(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage9(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage10(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage11(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage12(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage13(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class instructionpage14(Page): def vars_for_template(self): return dict(earning1=self.player.decision1, earning2=self.player.decision2, earning3=self.player.decision3, earning4=self.player.dom1, earning5=self.player.dom2, earning6=self.player.dom3,) class transition1(Page): timeout_seconds = 5 class Comprehension0(Page): def is_displayed(self): return self.subsession.round_number == 1 form_model = models.Player form_fields = ['newcheck', 'newcheck2'] def error_message(self, values): if values["newcheck"] != 'Remove up to 60 points from any Group Member.' or values["newcheck2"] != 'Person 3': self.player.s1q1attempt += 1 return 'At least one answer is wrong, please try again.' pass class transition2(Page): timeout_seconds = 3 class transition4(Page): timeout_seconds = 3 class Contribute(Page): form_model = models.Player form_fields = ['decision1'] class Contribute2(Page): form_model = models.Player form_fields = ['decision2'] class Contribute3(Page): form_model = models.Player form_fields = ['decision3'] class Contribute4(Page): form_model = models.Player form_fields = ['dom1'] class Contribute5(Page): form_model = models.Player form_fields = ['dom2'] class Contribute6(Page): form_model = models.Player form_fields = ['dom3'] class transition2b(Page): def is_displayed(self): return self.subsession.round_number == 1 pass class transition3(Page): pass page_sequence = [ consent, code, instructionpage0, instructionpage1, instructionpage2, instructionpage3, instructionpage4, instructionpage5, instructionpage6, instructionpage7, instructionpage8, instructionpage9, instructionpage10, transition1, transition2, Contribute, transition2b, transition1, transition2, Contribute2, transition2b, transition1, transition2, Contribute3, transition2b, instructionpage11, Comprehension0, instructionpage12, transition1, transition2, instructionpage13, Contribute4, transition2b, Contribute5, transition2b, Contribute6, transition4, instructionpage14, transition3, ]