from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'wfg_v2' PLAYERS_PER_GROUP = None NUM_ROUNDS = 3 Prescribed_Burn_Cost = -400 Defensive_Space_Cost = -300 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # in game choice management_choice = models.IntegerField( choices=[ [1, 'Prescribed Burn, Cost: $400'], [2, 'Defensible Space, Cost $300'], [3, 'No Action, Cost $0'], ], widget=widgets.RadioSelect ) # game mechanics for fire # after game questions fire_on_actual_property = models.IntegerField( choices=[ [1, "Yes"], [2, 'No'], ], widget=widgets.RadioSelect ) damage_to_actual_home = models.BooleanField( blank=True, widgets=widgets.CheckboxInput ) damage_to_other_physical_structure = models.BooleanField( widgets=widgets.CheckboxInput, blank=True ) damage_to_actual_forest = models.BooleanField( blank=True, widgets=widgets.CheckboxInput ) damage_to_other = models.BooleanField( blank=True, widgets=widgets.CheckboxInput ) other_damage = models.StringField() first_name = models.StringField() last_name = models.StringField() email = models.StringField() # PAGES # Intro is good class IntroductionPage(Page): @staticmethod def is_displayed(player: Player): return player.round_number == 1 class IntroWaitPage(WaitPage): pass class ChoicePage(Page): form_model = "player" form_fields = ["management_choice"] class ResultsWaitPage(WaitPage): pass class Results(Page): pass class QuestionsWaitPage(WaitPage): pass class Questions(Page): form_model = "player" form_fields = ["fire_on_actual_property", "damage_to_actual_home", "damage_to_other_physical_structure", "damage_to_actual_forest", "damage_to_other", "other_damage", "first_name", "last_name", "email"] @staticmethod def is_displayed(player: Player): return player.round_number == C.NUM_ROUNDS page_sequence = [IntroductionPage, IntroWaitPage, ChoicePage, ResultsWaitPage, Results, QuestionsWaitPage, Questions]