from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Selection' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 INSTRUCTIONS_TEMPLATE = 'Selection/instructions.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): is_high_dimra = models.BooleanField(choices=[[True, '7 Dimra'], [False, '3 Dimra']], initial=False, label='What is your choice?', widget=widgets.RadioSelect) prolific_id = models.StringField(default=str(" ")) def set_payoffs (player:BasePlayer): participant = player.participant participant.is_high_dimra = player.is_high_dimra if player.is_high_dimra == True: player.round1_payoffs == 73 else: player.round1_payoffs == 77 class instructions(Page): @staticmethod def before_next_page(self, timeout_happened): self.prolific_id = self.participant.label pass class PART1Intro(Page): pass class Part1Instruction(Page): pass class Selection(Page): timeout_seconds = 45 timer_text = 'Please do not drop out of the experiment' form_model = 'player' form_fields = ['is_high_dimra'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant participant.is_high_dimra = player.is_high_dimra if timeout_happened: player.is_high_dimra = True page_sequence = [instructions,PART1Intro,Part1Instruction,Selection]