from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) doc = '' class C(BaseConstants): NAME_IN_URL = 'profile' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def double_list(l): return [[i,i] for i in l ] choices_list={'court_decision':['1-Generally to the left','2-Generally to the right','3-Case by case basis' ], 'political_ide':['1-Very left wing', '2-Left of center','3-neutral', '4-Right of center', '5-Very right wing','99-Don’t know'], 'political_aff': ['1-Voted for a party not in the coalition','2-Voted for a party in the coalition', '3-Didn''t vote','4-Not israeli voter'], 'political_gov_sup':['1-Strongly Oppose', '2-Somewhat Oppose', '3-Neutral (Neither Oppose or Support)', '4-Somewhat Support', '5-Strongly Support '], 'status':['1-Foreign', '2-New Immigrant', '3-Israeli born'], 'sex':['1-Male', '2-Female', '3-Other'], 'educ':['1-Did not finish high school', '2-High school graduate', '3-Some college', '4-College graduate', '5-Post graduate degree'], 'court_knowledge':['1-Very knowledgeable', '2-Somewhat knowledgeable', '3-Average knowledge', '4-Not very knowledgeable', '5-I don’t know anything about the Court '], 'court_interest':['1-Not at all interested', '2-Somewhat interested', '3-Very interested'], 'court_interst_since':['1-I’ve always been interested in the Court', '2-My interest in the Court is more recent', '3-I am not interested in the court'], 'religion':['1-Religious jew','2-Secular jew','3-Religious muslim','4-Secular muslim', '5-Religious christian','6-Secular christian', '7-Atheist','99-Other' ] , 'next_election':['1-The current coalition ','2-The opposition','3-other']} choice_support_list = ['1—strongly support', '2—somewhat support', '3—slightly support', '4—slightly oppose', '5—somewhat oppose','6—strongly oppose'] class Player(BasePlayer): political_ide = models.StringField(choices=double_list(choices_list['political_ide']), label='What is your political ideology?', widget=widgets.RadioSelect) political_aff = models.StringField(choices=double_list(choices_list['political_aff']), label='Did you vote for he coalition at the last election?', widget=widgets.RadioSelect) political_gov_sup = models.StringField(choices=double_list(choices_list['political_gov_sup']), label='Please indicate your level of support or opposition to the current Israeli government', widget=widgets.RadioSelect) age = models.IntegerField( label='What is your age') status = models.StringField(choices=double_list(choices_list['status']), label='What is your status', widget=widgets.RadioSelect) religion = models.StringField(choices=double_list(choices_list['religion']), label='How would you describe yourself', widget=widgets.RadioSelect) sex = models.StringField(choices=double_list(choices_list['sex']) , label='What is your sex', widget=widgets.RadioSelect) educ = models.StringField(choices=double_list(choices_list['educ']), label='Level of education', widget=widgets.RadioSelect) next_election = models.StringField(choices=double_list(choices_list['next_election']), label='Who do you think will win next election?', widget=widgets.RadioSelect) def my_function(player: Player): pass