from otree.api import * class Constants(BaseConstants): name_in_url = 'survey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female']], label='What is your gender?', widget=widgets.RadioSelect, ) region = models.StringField( choices=['North', 'Central', 'South'], label='Which region of Vietnam are you from?', widget=widgets.RadioSelect, ) area = models.StringField( choices=['Urban area', 'Rural area'], label='Which type of area do you spend most of your life living in?', widget=widgets.RadioSelect, ) # FUNCTIONS # PAGES class Demographics(Page): form_model = 'player' form_fields = ['gender', 'region', 'area'] page_sequence = [Demographics]