from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random class Constants(BaseConstants): name_in_url = 'survey_test' 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 starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[1]), 'A starting budget of ' + str(choices()[1]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[1]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect ) choice2 = models.StringField( choices=[ [str(choices()[0]), 'A starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[2]), 'A starting budget of ' + str(choices()[2]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[2]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect ) choice3 = models.StringField( choices=[ [str(choices()[0]), 'A starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[3]), 'A starting budget of ' + str(choices()[3]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[3]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect ) choice4 = models.StringField( choices=[ [str(choices()[0]), 'A starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[4]), 'A starting budget of ' + str(choices()[4]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[4]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect ) choice5 = models.StringField( choices=[ [str(choices()[0]), 'A starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[5]), 'A starting budget of ' + str(choices()[5]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[5]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect ) choice6 = models.StringField( choices=[ [str(choices()[0]), 'A starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[6]), 'A starting budget of ' + str(choices()[6]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[6]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect ) choice7 = models.StringField( choices=[ [str(choices()[0]), 'A starting budget of 4 Pounds with 0 deduction after every 10 seconds'], [str(choices()[7]), 'A starting budget of ' + str(choices()[7]) + ' Pounds with 1 Pound deduction after ' 'every 10 seconds'], ], #label="Which game do you prefer? A starting budget of 4 Pounds with 0 deduction after every 10 seconds " # "or a starting budget of " + str(choices()[7]) + " Pounds with 1 Pound deduction after every 10 seconds?", widget=widgets.RadioSelect )