from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random class Constants(BaseConstants): name_in_url = 'survey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def choices(): choice00000 = (0, 4, 5, 6, 7, 8, 9, 10) return choice00000 class Player(BasePlayer): choice1 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[1]), 'A budget of \N{pound sign} ' + str(choices()[1]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal ) choice2 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[2]), 'A budget of \N{pound sign} ' + str(choices()[2]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal ) choice3 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[3]), 'A budget of \N{pound sign} ' + str(choices()[3]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal ) choice4 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[4]), 'A budget of \N{pound sign} ' + str(choices()[4]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal ) choice5 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[5]), 'A budget of \N{pound sign} ' + str(choices()[5]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal ) choice6 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[6]), 'A budget of \N{pound sign} ' + str(choices()[6]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal ) choice7 = models.StringField( choices=[ [str(choices()[0]), 'A budget of \N{pound sign} 4 with no deduction after every 10 seconds'], [str(choices()[7]), 'A budget of \N{pound sign} ' + str(choices()[7]) + ' with a \N{pound sign} 1 deduction after every 10 seconds'], ], label="", widget=widgets.RadioSelectHorizontal )