from otree.api import * from .choices import * from shared.helpers import PROLIFIC_URL, COMPLETION_FEE doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = "survey" PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 PROLIFIC_URL = PROLIFIC_URL class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): gender_identity = models.StringField(choices=gender_identity_cs, label="What is your gender identity?", blank=True) employment_status = models.StringField( label="What is your employment status?", choices=employment_status_cs, blank=True ) is_student = models.BooleanField(label="Are you a student?", blank=True) political_affiliation = models.StringField( choices=political_affiliation_cs, label="Where would you place yourself along the political spectrum?", blank=True, ) household_income = models.StringField( label="What is your total household income per year, including all earners in your household (after tax) in USD?", choices=household_income_cs, blank=True, ) # PAGES class Survey1(Page): form_model = "player" form_fields = [ "gender_identity", "employment_status", "is_student", "political_affiliation", "household_income", ] @staticmethod def before_next_page(player: Player, timeout_happened): player.payoff = COMPLETION_FEE class End(Page): pass page_sequence = [Survey1, End]