from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'MyFirstSurvey' 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=18, max=70) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female']], label='What is your gender?', widget=widgets.RadioSelect, ) height = models.IntegerField( label='How tall are you?' ) weight = models.IntegerField( label='How much do you weigh?' ) BMI = models.IntegerField( label='Could you compute your Body Mass Index (BMI) for me me please? BMI = Weight (in KG) divided by the square of height (in metres)' ) AB1 = models.StringField( choices=[['A', '10% chance of $100 AND 90% chance of $80'], ['B', '10% chance of $190 AND 90% chance of $5']], label='_________________________A_____________________________________________________B________________________', widget=widgets.RadioSelectHorizontal, ) AB2 = models.StringField( choices=[['A', '20% chance of $100 AND 80% chance of $80'], ['B', '20% chance of $190 AND 80% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB3 = models.StringField( choices=[['A', '30% chance of $100 AND 70% chance of $80'], ['B', '30% chance of $190 AND 70% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB4 = models.StringField( choices=[['A', '40% chance of $100 AND 60% chance of $80'], ['B', '40% chance of $190 AND 60% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB5 = models.StringField( choices=[['A', '50% chance of $100 AND 50% chance of $80'], ['B', '50% chance of $190 AND 50% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB6 = models.StringField( choices=[['A', '60% chance of $100 AND 40% chance of $80'], ['B', '60% chance of $190 AND 40% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB7 = models.StringField( choices=[['A', '70% chance of $100 AND 30% chance of $80'], ['B', '70% chance of $190 AND 30% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB8 = models.StringField( choices=[['A', '80% chance of $100 AND 20% chance of $80'], ['B', '80% chance of $190 AND 20% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB9 = models.StringField( choices=[['A', '90% chance of $100 AND 10% chance of $80'], ['B', '90% chance of $190 AND 10% chance of $5']], widget=widgets.RadioSelectHorizontal, ) AB10 = models.StringField( choices=[['A', '100% chance of $100 AND 90% chance of $80'], ['B', '100% chance of $190 AND 90% chance of $5']], widget=widgets.RadioSelectHorizontal ) ##PAGES class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender'] pass class PoliticallyIncorrectQuestions(Page): form_model = 'player' form_fields = ['height', 'weight', 'BMI'] pass class Gambling(Page): form_model = 'player' form_fields = ['AB1', 'AB2', 'AB3', 'AB4', 'AB5', 'AB6', 'AB7', 'AB8', 'AB9', 'AB10'] pass class Results(Page): pass page_sequence = [Demographics, PoliticallyIncorrectQuestions, Gambling]