from otree.api import * import random doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'testfirechance' PLAYERS_PER_GROUP = None NUM_ROUNDS = 3 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 MyPage(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 return player.Fire_Started class ResultsWaitPage(WaitPage): pass class Results(Page): pass page_sequence = [MyPage, ResultsWaitPage, Results]