from otree.api import * author = "Henrik Orzen" doc = """ Guesstimations - Welcome and Instructions """ class C(BaseConstants): NAME_IN_URL = 'Start' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 SHOW_UP_FEE = 5 PRIZE = 10 TIME_LIMIT = 8 * 60 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): ProlificID = models.StringField( label="Please enter your Prolific ID:" ) TestBot = models.BooleanField(initial=False) Prl_IdCode = models.StringField(initial="") # PAGES class P00Startup1(Page): form_model = 'player' form_fields = ['ProlificID'] @staticmethod def before_next_page(player, timeout_happened): participant = player.participant participant.vars['ShowUpFee'] = C.SHOW_UP_FEE participant.vars['Prize'] = C.PRIZE participant.vars['TimeLimit'] = C.TIME_LIMIT participant.TestBot = False player.Prl_IdCode = participant.label class P00Startup2(Page): form_model = 'player' form_fields = ['TestBot'] @staticmethod def before_next_page(player, timeout_happened): player.participant.TestBot = player.TestBot page_sequence = [P00Startup1]