from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Lotte Wit' doc = """ Master's thesis experiment. """ class Constants(BaseConstants): name_in_url = 'studylotted' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): b1 = models.IntegerField(choices=[0, 1]) b2 = models.IntegerField(choices=[0, 1]) b3 = models.IntegerField(choices=[0, 1]) b4 = models.IntegerField(choices=[0, 1]) b5 = models.IntegerField(choices=[0, 1]) c1 = models.IntegerField(choices=[0, 1]) c2 = models.IntegerField(choices=[0, 1]) c3 = models.IntegerField(choices=[0, 1]) c4 = models.IntegerField(choices=[0, 1]) c5 = models.IntegerField(choices=[0, 1]) def man(x): return models.IntegerField( choices=[[0, 'True'], [1, 'False']], label=x, widget=widgets.RadioSelect, blank=False) mancheck = man('The amount of participants preferring the plant-based option in the experiment was growing over time') def meat(x): return models.IntegerField( choices=[[1, '0-3'], [2, '4-7'], [3, '8-11'], [4, '12-15'], [5, '16-19'], [6, '20 or more']], label=x, widget=widgets.RadioSelect, blank=False) eat = meat('how many meals that included meat have you eaten in the last week (including breakfast, lunch, dinner and snacks)') def mpref(x): return models.IntegerField( choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], label=x, widget=widgets.RadioSelect, blank=False) pref = mpref('I prefer meals that contain meat over vegetarian meals') def rel (x): return models.IntegerField( choices=[[1,'None'], [2, 'Vegetarian'], [3, 'Vegan'], [4, 'I dont eat beef for other reasons'], [5, 'I dont eat chicken for other reasons' ], [6, 'I dont eat beef and chicken for other reasons' ]], label=x, widget=widgets.RadioSelect, blank=False) diet = rel('Do you have any dietary preferences, or do not eat certain meats')