from otree.api import * doc = """ sasha diplomka """ class C(BaseConstants): NAME_IN_URL = 'advisor_survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Group(BaseGroup): pass class Subsession(BaseSubsession): pass class Player(BasePlayer): computer_number = models.IntegerField(label='What number were you assigned (PC number/Token number)?', min=1, max=24) age = models.IntegerField(label='What is your age?', min=13, max=125) gender = models.StringField( choices=['Male', 'Female', 'Other','Prefer not to answer'], label='What gender do you identify as?', widget=widgets.RadioSelect, ) education = models.StringField( choices=['Primary school','High school', 'Bachelors degree', 'Masters degree','Ph.D. or higher'], label='What is your highest achieved education?', widget=widgets.RadioSelect, ) employment = models.StringField( choices= ["Student", "Employed/Self employed", "Unemployed", "Student and employed/self employed"], label = 'What is your current status?', widget = widgets.RadioSelect, ) work_finance = models.StringField( choices=["Yes","No"], label='Have you ever worked in finance or insurance market?', widget=widgets.RadioSelect, ) advisor_motivation = models.StringField(label='In 2-3 sentences, describe how you were making your decisions regarding ' 'recommendations (proposals).', ) client_motivation = models.StringField(label='In 2-3 sentences, describe how were you making decisions regarding ' 'accepting or rejecting proposal.', ) class MainPage(Page): form_model = 'player' # celkom dobre si na to isla # dobre no malo by to ist si myslim @staticmethod def get_form_fields(player): if player.participant.vars.get("is_advisor", False): return ['computer_number','age', 'gender', 'education','employment','work_finance','advisor_motivation'] else: return ['computer_number','age', 'gender', 'education','employment','work_finance','client_motivation'] class FinalPage(Page): pass page_sequence = [MainPage, FinalPage]