from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random class Constants(BaseConstants): name_in_url = 'KA' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): def make_field(label): return models.IntegerField( choices=[[1, "1    "], [2, "2‎‎‎    "], [3, "3    "], [4, "4    "], [5, "5    "], [6, "6    "], [7, "7    "]], label=label, widget=widgets.RadioSelectHorizontal, ) a1 = make_field('Only humans can experience complex emotions.') a2 = make_field('Cows can feel fear and pain.') a3 = make_field('Chickens can experience happiness.') a4 = make_field('Pigs play for fun, are inquisitive, and can solve relatively complex problems.') a5 = make_field('Fish can collaborate on week long projects in group.') a6 = make_field('Cows can recognise themselves in a mirror.') a7 = make_field('Animals are inferior to humans.') a8 = make_field('A chicken is an individual.') # f1 = make_field('I believe that it is important to support milk farmers.') # f2 = make_field('Most farmers love the animals they care for.') f3 = make_field('Animals are mostly treated well in farms in Switzerland.') f4 = make_field('It is immoral to harm animals for the production of food.') # f5 = make_field('I consider myself sympathetic to animal rights.') f6 = make_field('The way meat is produced in Switzerland is morally wrong.') # f7 = make_field('Animal agriculture is necessary for good land management.') # f8 = make_field('The needs of farmers should be prioritised over animals.') e1 = make_field('I consider myself sympathetic to environmental protection.') e2 = make_field('Living a healthy lifestyle is important to me.') e3 = make_field('Deforestation is a major concern for humanity.') e4 = make_field('Preserving jobs is more important than reducing CO2 emissions.') h1 = make_field('I prioritise tasty food over healthy food.') h2 = make_field('Eating healthy food gives me satisfaction.') h3 = make_field('I always choose food options considering if they are healthy.') h4 = make_field('Reducing human induced climate change should be a priority for governments.') pm1 = make_field('It is acceptable to eat meat because the animals killed for our consumption do not really suffer.') pm2 = make_field('It is acceptable to eat meat because the animals killed for our consumption have lower intellectual capacities than humans.') pm3 = make_field('It is acceptable to eat some animals because they are raised for this purpose.') pm4 = make_field('God created animals for us to eat.') pm5 = make_field('Eating meat is healthy.') pm6 = make_field('It’s natural to eat meat, it’s written in our genes.') pm7 = make_field('It’s normal to eat meat.') pm8 = make_field('I like meat too much to stop eating it.') pm9 = make_field('Eating meat is necessary for good health.') pm10 = make_field('Eating meat may be bad for the environment, but no more so than eating vegetables or cereals.') # KNOWLEDGE QUESTIONS k1 = models.IntegerField(widget=widgets.RadioSelect, label="One vitamin that is only found in animal derived products, and is therefore a common deficiency in vegan diets is:") k2 = models.IntegerField(widget=widgets.RadioSelect, label="In Swiss farms, what is the minimum space per pig that is legally required?") k3 = models.IntegerField(widget=widgets.RadioSelect, label="In Swiss farms, the percentage of pigs that live their whole life without having the possibility to go outside is:") k4 = models.IntegerField(widget=widgets.RadioSelect, label="What is the maximum number of chicken a 'BIO' labeled egg laying farm can have in Switzerland?") k5 = models.IntegerField(widget=widgets.RadioSelect, label="Which of the following food choices have more protein?") k6 = models.IntegerField(widget=widgets.RadioSelect, label="The production of which of the following items requires the largest land use?") k7 = models.IntegerField(widget=widgets.RadioSelect, label='''According to the Swiss Confederation’s nutrition strategy 2017-2021: on average, how much meat do the Swiss eat compared to what would be optimal for their health?''') #k8 = models.IntegerField(widget=widgets.RadioSelect, # label="Of the following athletes how many claim to have a vegan or mostly vegan diet? Serena Williams (7 time Wimbledon Tennis Champion) Michael Phelps (Most Decorated Olympian of All Time, American Swimmer) Tom Brady (Quarterback for the New England Patriots, has won more Super Bowls than any other player in NFL history)") k8 = models.IntegerField(widget=widgets.RadioSelect, label='''According to the WHO, which of these are carcinogenic (increase risk of cancer)?''') # KNOWLEDGE SHUFFLE def k1_choices(self): choices = [[2, "Vitamin E"], [1, "Vitamin B12"], [3, "Folic Acid"],[4, "Magnesium"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices def k2_choices(self): choices = [[2, "4 square meter"], [1, "0.9 square meter"], [3, "1.8 square meter"], [4, "3.2 square meter"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices def k3_choices(self): choices = [[1, "58%"], [2, "0%"], [3, "36%"], [4, "88%"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices def k4_choices(self): choices = [[2, "100"], [1, "4'000"], [3, "500"], [4, "8'000"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices def k5_choices(self): choices = [[2, "100g of almonds"], [1, "100g of chicken breast"], [3, "100g of chickpeas"], [4, "100g of beefsteak"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices def k6_choices(self): choices = [[1, "100g of protein from beef"], [2, "100g of protein from chicken"], [3, "100g of protein from lentils"], [4, "100g of protein from tofu"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices def k7_choices(self): choices = [[2, "Meat consumption is 7x too high"], [1, "Meat consumption is 3x too high"], [3, "Meat consumption is approximately at the right level"], [4, "Meat consumption is 2x too low"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices #def k8_choices(self): # choices = [[2, "0"], [3, "1"], [1, "2"],[4, "3"]] # random.shuffle(choices) # choices.append([5, "I don't know"]) # return choices def k8_choices(self): choices = [[2, "White meat and red meat"], [1, "Red meat and processed meat"], [3, "Fish and white meat"], [4, "White meat and processed meat"]] random.shuffle(choices) choices.append([5, "I don't know"]) return choices