from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'gender_survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(label='What is your age?', max=100, min=18) gender = models.StringField(choices=[['Man', 'Man'], ['Woman', 'Woman']], label='Which of the following genders do you identify with most closely?', widget=widgets.RadioSelect) class SURVEY(Page): form_model = 'player' form_fields = ['age', 'gender'] @staticmethod def before_next_page(player: Player, timeout_happened): participant = player.participant player.participant.vars['gender'] = player.gender page_sequence = [SURVEY]