from otree.api import * import random doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'wfg_v1' #need to change PLAYERS_PER_GROUP = 1 #need to change NUM_ROUNDS = 2 Prescribed_Burn_Cost = -400 Defensive_Space_Cost = -300 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # determines if a fire starts for each player on their land Fire_Started = models.BooleanField() Fire_Chance = models.IntegerField() # PAGES class ChoicePage(Page): form_model = "player" @staticmethod def fire_determination(player: Player): player.Fire_Chance = random.random() if player.Fire_Chance <= 1/9: player.Fire_Started = True else: player.Fire_Started = False class ResultsWaitPage(WaitPage): pass class Results(Page): pass page_sequence = [ChoicePage, ResultsWaitPage, Results]