from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Supergame' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Supergame_id_1 = models.StringField(label='Please fill in your participant ID for Game 1:') Supergame_id_2 = models.StringField(label='Please fill in your participant ID for Game 2:') Supergame_id_3 = models.StringField(label='Please fill in your participant ID for Game 3:') Points_supergame_1 = models.IntegerField(label='Please indicate the points you earned in Game 1:') Points_supergame_2 = models.IntegerField(label='Please indicate the points you earned in Game 2:') Points_supergame_3 = models.IntegerField(label='Please indicate the points you earned in Game 3:') class Transition_SCG(Page): form_model = 'player' class Results(Page): form_model = 'player' form_fields = ['Supergame_id_1', 'Points_supergame_1', 'Supergame_id_2', 'Points_supergame_2', 'Supergame_id_3', 'Points_supergame_3'] @staticmethod def before_next_page(player: Player, timeout_happened): player.payoff = (player.Points_supergame_1+player.Points_supergame_2+player.Points_supergame_3) * 0.25 class Payoff(Page): form_model = 'player' page_sequence = [Transition_SCG, Results, Payoff]