from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) from django import forms from django.utils.safestring import mark_safe 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): age = models.IntegerField(label='What is your age?', min=13, max=125) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female'], ['Transmale','Transmale' ], ['Transfemale', 'Transfemale'], ['Queer/Noncomforming', 'Queer/Noncomforming'], ['Something else', 'Something else'], ['Prefer not to say', 'Prefer not to say']], label='What is your gender identity?', widget=widgets.RadioSelectHorizontal, ) nationality = models.StringField(label='What is your nationality?') #occupation = models.StringField(label='Please describe your current occupation/profession') UG_Major = models.StringField(label='What was your undergraduate major?') G_Year = models.IntegerField(label='In which year did you start your graduate school?', min=2012, max=2019) Game = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label='Please rate your level of comfort with game theory on a scale of 1 to 7 (7 being highest)', widget=widgets.RadioSelectHorizontal ) Competition = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label=mark_safe('Please rate your level of agreement with the following statement (7 means highly agree):"Competition brings out the best in me"'), widget=widgets.RadioSelectHorizontal ) WinLove = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label=mark_safe('Please rate your level of agreement with the following statement (7 means highly agree):"I love winning competitions irrespective of the value of the prize."'), widget=widgets.RadioSelectHorizontal ) Strategy = models.StringField( choices=[['Pay', 'I was trying to maximize my total expected payoff in every round'], ['Prob', 'I was trying to maximize my probability of winning in each period'], ['Fair', 'I was trying to have 50-50 chances of winning'], ['NE', 'I was trying to coordinate on low bids'], ['Oth', 'Other']], label='What do you think was your bidding strategy?', widget=widgets.RadioSelect ) StrategyExplain = models.StringField(label='Please elaborate on whatever you chose above, especially if you chose "Other"') crt_bat = models.IntegerField( label=''' A bat and a ball cost 22 dollars in total. The bat costs 20 dollars more than the ball. How many dollars does the ball cost?''' ) crt_widget = models.IntegerField( label=''' "If it takes 5 machines 5 minutes to make 5 widgets, how many minutes would it take 100 machines to make 100 widgets?" ''' ) crt_lake = models.IntegerField( label=''' In a lake, there is a patch of lily pads. Every day, the patch doubles in size. If it takes 48 days for the patch to cover the entire lake, how many days would it take for the patch to cover half of the lake? ''' ) # Number of moves taken to solve Hanoi game; 99 indicates timed out Hanoi_moves = models.IntegerField( # initial=99, ) Hanoi_success = models.BooleanField() Hanoi_payoff = models.CurrencyField() Hanoi_time = models.FloatField()