from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import numpy as np import pandas as pd import itertools import random author = 'Elisa Macchi' doc = """ Obesity and Income - Demographics and Nutritional Knowledge Post Exp Survey """ class Constants(BaseConstants): name_in_url = 'demo_nutrition_survey' players_per_group = None num_rounds = 1 sil_pic = 'black_men.png' one_tenth = 'one.png' five_tenth = 'five.png' showupfee = c(1) bonus = c(0.5) n_questions = 58 correct_answers_set2 = {'s2q1a': 1, 's2q1b': 3, 's2q1c': 1, 's2q1d': 3, 's2q1e': 3, 's2q1f': 1, 's2q1g': 1, 's2q1h': 3, 's2q1i': 1, 's2q2' : 3, 's2q3a': 2, 's2q3b': 1, 's2q3c': 1} correct_answers_set3 ={'s3q1a': 2, 's3q1b': 2, 's3q1c': 1, 's3q1d': 1, 's3q1e': 2, 's3q2a': 1, 's3q2b': 2, 's3q2c': 1, 's3q2d': 1, 's3q2e': 2, 's3q2f': 1, 's3q3a': 1, 's3q3b': 1, 's3q3c': 2, 's3q3d': 2, 's3q3e': 1, 's3q3f': 2, 's3q4a': 1, 's3q4b': 1, 's3q4c': 2, 's3q4d': 1, 's3q4e': 2, 's3q4f': 1, 's3q5': 1, 's3q6': 1, 's3q7a': 2, 's3q7b': 3, 's3q7c': 1, 's3q7d': 4, 's3q8': 3, 's3q9': 1, 's3q10a': 2, 's3q10b': 1, 's3q10c': 1, 's3q10d': 2, 's3q10e': 1} correct_answers_set4 = {'s4q1': 2, 's4q2': 3, 's4q3': 1, 's4q4': 3, 's4q5': 1, 's4q6': 3, 's4q7': 2, 's4q8': 2, 's4q9': 2} class Subsession(BaseSubsession): def creating_session(self): options = itertools.cycle([1, 2]) players = self.get_players() for p in players: p.option = next(options) class Group(BaseGroup): pass class Player(BasePlayer): primary_shopper = models.BooleanField(choices=[[0,'No'], [1, 'Yes']], label = ''' Are you the primary shopper? That is, the one household member who makes the majority of your household's grocery purchase decisions ''' ) health = models.IntegerField(choices=[[1, 'Poor '], [2, 'Fair'], [3, 'Poor'], [4, 'Good'], [5, 'Very good'] ], widget=widgets.RadioSelectHorizontal, label='''In general, you would say that your health is''' ) obese = models.IntegerField(choices=[[1, 'Underweight '], [2, 'Normal weight'], [3, 'Overweight'], [4, 'Not sure'] ], widget=widgets.RadioSelectHorizontal, label=''' If someone has a figure like Silhouette 9, what would their weight status be? Please select one. ''' ) overweight = models.IntegerField(choices=[[1, 'Underweight '], [2, 'Normal weight'], [3, 'Overweight'], [4, 'Not sure'] ], widget=widgets.RadioSelectHorizontal, label=''' If someone has a figure like Silhouette 6, what would their weight status be? Please select one ''' ) underweight = models.IntegerField(choices=[[1, 'Underweight '], [2, 'Normal weight'], [3, 'Overweight'], [4, 'Not sure'] ], widget=widgets.RadioSelectHorizontal, label='''If someone has a figure like Silhouette 2, what would their weight status be? Please select one''' ) partner = models.IntegerField(choices=[[1, 'More likely '], [2, 'Less likely'], [3, 'Does not matter'], ], widget=widgets.RadioSelectHorizontal, label='''If someone has a figure like Silhouette 5 and increases to 6, do you think he/she would be more or less likely to find a partner?''' ) job = models.IntegerField(choices=[[1, 'More likely '], [2, 'Less likely'], [3, 'Does not matter'], ], widget=widgets.RadioSelectHorizontal, label='''If someone has a figure like Silhouette 5 and increases to 6, do you think he/she would be more or less likely to find a good job?''' ) loan = models.IntegerField(choices=[[1, 'More likely '], [2, 'Less likely'], [3, 'Does not matter'], ], widget=widgets.RadioSelectHorizontal, label='''If someone has a figure like Silhouette 5 and increases to 6, do you think he/she would be more or less likely to be considered for a loan?''' ) # Nutritional Survey: # q1 _ For each of the following types of drinks, please tell # us how many 12-ounce servings you drink in an average week (A normal # bottle of soda is 12-ounces) s1q1a = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' 100% fruit juice ''', doc=''' For each of the following types of drinks, please tell us how many XX servings you drink in an average week (A normal bottle of soda is XX ounces) ''') s1q1b = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Sweetened juice drinks (for example, fruit ades, lemonade, punch, and orange drinks) ''', doc=''' For each of the following types of drinks, please tell us how many XX servings you drink in an average week (A normal bottle of soda is XX ounces) ''' ) s1q1c = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Regular soft drinks (soda pop) ''') s1q1d = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Diet soft drinks and all other artificially sweetened drinks ''', doc=''' For each of the following types of drinks, please tell us how many XX servings you drink in an average week (A normal bottle of soda is XX ounces) ''' ) s1q1e = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Pre-packaged (i.e., canned or bottled) tea or coffee (for example, iced tea, iced coffee,' and flavored tea) ''', doc=''' For each of the following types of drinks, please tell us how many XX servings you drink in an average week (A normal bottle of soda is XX ounces) ''' ) s1q1f = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Sports drinks ''', doc=''' For each of the following types of drinks, please tell us how many XX servings you drink in an average week (A normal bottle of soda is XX ounces) ''' ) s1q1g = models.IntegerField(choices=[[0, ""], [1, ""], [2, ""], [3, ""], [4, ""], [5, ""], [6, ""], [7, ""], [8, ""], [9, ""], [10, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Caffeinated energy drinks ''', doc=''' For each of the following types of drinks, please tell us how many XX servings you drink in an average week (A normal bottle of soda is XX ounces) ''' ) # Please indicate how much each of the following statements reflects how you typically are: s1q2 = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, '']], widget=widgets.RadioSelectHorizontal, label = ''' I eat sweets more than I should. ''' ) s1q3 = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, '']], widget=widgets.RadioSelectHorizontal, label=''' I often eat more than than I should at lunch or dinner. ''' ) s1q4 = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, '']], widget=widgets.RadioSelectHorizontal, label=''' I drink soda pop or other sugar-sweetened beverages more often than I should. ''' ) s1q5a = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= ''' 100% fruit juice ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 0-10, with 1 being “not at all" and 5 being “very much". ''' ) s1q5b = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Sweetened juice drinks (for example, fruit ades, lemonade, punch, and orange drinks) ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 1-5, with 1 being “not at all" and 5 being “very much". ''' ) s1q5c = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Regular soft drinks (soda pop) ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 1-5, with 1 being “not at all" and 5 being “very much". ''' ) s1q5d = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Diet soft drinks and all other artificially sweetened drinks ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 1-5, with 1 being “not at all" and 5 being “very much". ''' ) s1q5e = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Pre-packaged (i.e., canned or bottled) tea or coffee (for example, iced tea, iced coffee,' and flavored tea) ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 1-5, with 1 being “not at all" and 5 being “very much". ''' ) s1q5f = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Sports drinks ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 1-5, with 1 being “not at all" and 5 being “very much". ''' ) s1q5g = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget =widgets.RadioSelectHorizontal, label= ''' Caffeinated energy drinks ''', doc=''' Imagine for a moment that you could drink whatever beverages you want without any health or nutritional considerations. Leaving aside any health or nutrition considerations, how much would you say you like the taste and generally enjoy drinking the following? Please indicate your liking by selecting a number on a scale of 1-5, with 1 being “not at all" and 5 being “very much". ''' ) s1q6 = models.IntegerField(choices=[ [1, ""], [2, ""], [3, ""], [4, ""], [5, ""]], widget=widgets.RadioSelectHorizontal, label= '''In general, how important is it to you to stay healthy, for example by maintaining a healthy weight, avoiding diabetes and heart disease, etc?''', doc= ''' Please indicate the importance by selecting a number on a scale of 1-5, with 1 being "not at all important" and 5 being "extremely important". ''' ) s2q1a = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Fruit ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1b = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Food and drinks with added sugar. ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1c = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Vegetables ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1d = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Fatty foods ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1e = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Processed red meat ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1f = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Fish ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1g = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Whole grain rice, maize or wheat. ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1h = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Salty foods ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q1i = models.IntegerField(choices=[[1, ''], [2, ' '], [3, ' '], [4, '']], widget=widgets.RadioSelectHorizontal, label= ''' Water ''', doc=''' Do health experts recommend that people should be eating more, the same amount, or less of the following foods? Please select one response for each. ''' ) s2q2 = models.IntegerField(choices=[[1, '2'], [2, ' 3'], [3, '4 '], [4, '5 or more'], [5, 'Not sure']], widget=widgets.RadioSelect, label= ''' How many servings of fruit and vegetables per day do experts advise people to eat as a minimum? (One serving could be, for example, an apple or a handful of chopped carrots) ''' ) s2q3a = models.IntegerField(choices=[[1, ""], [2, ""], [3, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Unsaturated fats ''', doc=''' Which of these types of fats do expert recommend that people should eat less of? Please select one response for each. ''' ) s2q3b = models.IntegerField(choices=[[1, ""], [2, ""], [3, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Trans fats ''', doc=''' Which of these types of fats do expert recommend that people should eat less of? Please select one response for each. ''' ) s2q3c = models.IntegerField(choices=[[1, ""], [2, ""], [3, ""]], widget=widgets.RadioSelectHorizontal, label= ''' Saturated fats ''', doc=''' Which of these types of fats do expert recommend that people should eat less of? Please select one response for each. ''' ) # Q11 : Do you think these foods and drinks are typically high or low in added sugar? # Please select one response for each. s3q10a = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Diet cola drink ''', doc=''' Do you think these foods and drinks are typically high or low in added sugar? Please select one response for each. ''' ) s3q1b = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Plain yogurt ''', doc=''' Do you think these foods and drinks are typically high or low in added sugar? Please select one response for each. ''' ) s3q1c = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget= widgets.RadioSelectHorizontal, label=''' Ice cream ''', doc=''' Do you think these foods and drinks are typically high or low in added sugar? Please select one response for each. ''' ) s3q1d = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Tomato ketchup ''', doc=''' Do you think these foods and drinks are typically high or low in added sugar? Please select one response for each. ''' ) s3q1e = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Melon ''', doc=''' Do you think these foods and drinks are typically high or low in added sugar? Please select one response for each. ''' ) # Q12 : Do you think these foods and drinks are typically high or low in salt? # Please select one response for each. s3q2a = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Breakfast cereals ''', doc=''' Do you think these foods and drinks are typically high or low in salt? Please select one response for each. ''' ) s3q2b = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Frozen vegetables ''', doc=''' Do you think these foods and drinks are typically high or low in salt? Please select one response for each. ''' ) s3q2c = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Bread ''', doc=''' Do you think these foods and drinks are typically high or low in salt? Please select one response for each. ''' ) s3q2d = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Baked beans ''', doc=''' Do you think these foods and drinks are typically high or low in salt? Please select one response for each. ''' ) s3q2e = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label= ''' Red meat ''', doc=''' Do you think these foods and drinks are typically high or low in salt? Please select one response for each. ''' ) s3q2f = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Canned soup ''', doc=''' Do you think these foods and drinks are typically high or low in salt? Please select one response for each. ''' ) # Q13: Do you think these foods and drinks are typically high or low in fiber? # Please select one response for each. s3q3a = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Oats ''', doc=''' Do you think these foods and drinks are typically high or low in fiber? Please select one response for each. ''' ) s3q3b = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Bananas ''', doc=''' Do you think these foods and drinks are typically high or low in fiber? Please select one response for each. ''' ) s3q3c = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' White rice ''', doc=''' Do you think these foods and drinks are typically high or low in fiber? Please select one response for each. ''' ) s3q3d = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Eggs ''', doc=''' Do you think these foods and drinks are typically high or low in fiber? Please select one response for each. ''' ) s3q3e = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Potatoes with skin ''', doc=''' Do you think these foods and drinks are typically high or low in fiber? Please select one response for each. ''' ) s3q3f = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Bananas ''', doc=''' Do you think these foods and drinks are typically high or low in fiber? Please select one response for each. ''' ) # Q14: Do you think these foods are a good source of protein? Please select one response for each. s3q4a = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Poultry ''', doc=''' Do you think these foods are a good source of protein? Please select one response for each. ''' ) s3q4b = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Cheese ''', doc=''' Do you think these foods are a good source of protein? Please select one response for each. ''' ) s3q4c = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Fruit ''', doc=''' Do you think these foods are a good source of protein? Please select one response for each. ''' ) s3q4d = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Baked beans ''', doc=''' Do you think these foods are a good source of protein? Please select one response for each. ''' ) s3q4e = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Butter ''', doc=''' Do you think these foods are a good source of protein? Please select one response for each. ''' ) s3q4f = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Nuts ''', doc=''' Do you think these foods are a good source of protein? Please select one response for each. ''' ) s3q7a = models.IntegerField(choices=[[1, 'Biscuits, cakes and pastries'], [2, 'Fish'], [3, 'Rapeseed oil'], [4, 'Eggs'], [5, 'Not sure'] ], widget=widgets.RadioSelect, label=''' Which of these foods has the most fat? Please select one ''' ) s3q6 = models.IntegerField(choices=[[1, 'Sugar'], [2, 'Starchy'], [3, 'Fiber/roughage'], [4, 'Fat'], [5, 'Not sure'] ], widget=widgets.RadioSelect, label=''' Which one of the following nutrients has the most calories for the same weight of food? Please select one ''' ) s3q7a = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, ''], [6, ''], ], widget=widgets.RadioSelect, label=''' Olive Oil ''', doc = ''' Which is the main type of fat present in each of these foods? ''' ) s3q7b = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, ''], [6, ''], ], widget=widgets.RadioSelect, label=''' Butter ''', doc=''' Which is the main type of fat present in each of these foods? ''' ) s3q7c = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, ''], [6, ''], ], widget=widgets.RadioSelect, label=''' Sunflower oil ''', doc=''' Which is the main type of fat present in each of these foods? ''' ) s3q7d = models.IntegerField(choices=[[1, ''], [2, ''], [3, ''], [4, ''], [5, ''], [6, ''], ], widget=widgets.RadioSelect, label=''' Eggs ''', doc=''' Which is the main type of fat present in each of these foods? ''' ) s3q8 = models.IntegerField(choices=[[1, 'Coconut milk'], [2, 'Herbs'], [3, 'Spices'], [4, 'Not sure'] ], widget=widgets.RadioSelect, label='''One healthy way to add flavor to food without adding extra fat or salt is to add? Please select one ''' ) s3q9 = models.IntegerField(choices=[[1, 'Much higher'], [2, 'About the same'], [3, 'Much lower'], [4, 'Not sure'] ], widget=widgets.RadioSelect, label=''' The amount of calcium in a glass of whole milk compared to a glass of skimmed milk is...? Please, select one.''' ) s3q10a = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Cheese ''', doc=''' Which of the following do expert count as starchy food? Please select one response for each. ''' ) s3q10b = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Bread ''', doc=''' Which of the following do expert count as starchy food? Please select one response for each. ''' ) s3q10c = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Potatoes ''', doc=''' Which of the following do expert count as starchy food? Please select one response for each. ''' ) s3q10d = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Nuts ''', doc=''' Which of the following do expert count as starchy food? Please select one response for each. ''' ) s3q10e = models.IntegerField(choices=[[1, ''], [2, ''], [3, '']], widget=widgets.RadioSelectHorizontal, label=''' Plaintains ''', doc=''' Which of the following do expert count as starchy food? Please select one response for each. ''' ) s3q11 = models.IntegerField(choices=[[1, '0% fat cherry yogurt'], [2, 'Plain yogurt'], [3, 'Creamy fruit yogurt'], [4, 'Not sure']], widget=widgets.RadioSelect, label=''' If a person wanted to buy a yogurt at the supermarket, which one would have the least sugar? Please select one. ''' ) s4q1 = models.IntegerField(choices=[[1, 'High blood pressure'], [2, 'Tooth decay'], [3, 'Anemia'], [4, 'Not sure'] ], widget=widgets.RadioSelect, label='''Which of these diseases is related to how much sugar people eat? Please select one. ''' ) s4q2 = models.IntegerField(choices=[[1, 'Hypothyroidism'], [2, 'Diabetes'], [3, 'High blood pressure'], [4, 'Not sure'] ], widget=widgets.RadioSelect, label='''Which of these diseases is related to how much salt people eat? Please select one. ''' ) s4q3 = models.IntegerField(choices=[[1, 'Eating refined foods, such as cake '], [2, 'Drinking fruit juice'], [3, 'Eating meat'], [4, 'Eating vegetables'], ], widget=widgets.RadioSelect, label='''Which of these options do experts recommend to prevent diabetes? Please select one response for each. ''' ) s4q4 = models.IntegerField(choices=[[1, 'Eggs '], [2, 'Vegetable oils'], [3, 'Animal fat'], [4, 'Not sure'] ], widget=widgets.RadioSelect, label='''Which one of these foods is more likely to raise people's blood cholesterol? Please select one. ''' ) s4q5 = models.IntegerField(choices=[[1, 'Agree '], [2, 'Disagree'], [3, 'Not sure'] ], widget=widgets.RadioSelect, label=''' "Fiber can decrease the chances of gaining weight." Please select one ''' ) s4q6 = models.IntegerField(choices=[[1, 'Taking nutritional supplements '], [2, 'Eating less oily fish'], [3, 'Eating less trans-fats'], [4, 'Not sure'], ], widget=widgets.RadioSelect, label=''' Which of these options do experts recommend to prevent heart disease? Please select one''' ) s4q7 = models.IntegerField(choices=[[1, 'Wholegrain cereals '], [2, 'White bread'], [3, 'Fruit and vegetables'], [4, 'Not sure'] ], widget=widgets.RadioSelect, label=''' Which one of these foods is classified as having a high Glycemic Index (Glycemic Index is a measure of the impact of a food on blood sugar levels, thus a high Glycemic Index means a greater rise in blood sugar after eating)? Please select one.''' ) s4q8 = models.IntegerField(choices=[[1, 'Agree '], [2, 'Disagree '], [3, 'Not sure'] ], widget=widgets.RadioSelect, label=''' "To maintain a healthy weight people should eat a high protein diet." ''' ) s4q9 = models.IntegerField(choices=[[1, 'Agree '], [2, 'Disagree '], [3, 'Not sure'] ], widget=widgets.RadioSelect, label=''' "To maintain a healthy weight people should cut out fat completely." ''' ) # calculate the percentage of the correctly answered questions for each player: total_correct = models.IntegerField(doc=''' Records participant's total correct answers to questions ''') nk_score = models.FloatField(doc=''' Nutritional Knowledge Score ''') option = models.IntegerField() g1A = models.IntegerField(choices=[[0, ''], [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], widget=widgets.RadioSelect, label='''be overweight at age 65?;;''' ) g1B = models.IntegerField(choices=[[0, ''], [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], widget=widgets.RadioSelect, label='''have a cardiovascular disease at age 65?;;''' ) g1C = models.IntegerField(choices=[[0, ''], [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], widget=widgets.RadioSelect, label='''be alive at age 65?;;''' ) g2A = models.IntegerField(choices=[[0, ''], [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], widget=widgets.RadioSelect, label='''be overweight at age 65?;;''' ) g2B = models.IntegerField(choices=[[0, ''], [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], widget=widgets.RadioSelect, label='''have a cardiovascular disease at age 65?;;''' ) g2C = models.IntegerField(choices=[[0, ''], [1, ''], [2, ''], [3, ''], [4, ''], [5, ''], ], widget=widgets.RadioSelect, label='''be alive at age 65?;;''' ) # Payoffs def set_payoffs(self): if self.choice == 1: self.payoff = Constants.showupfee else: self.payoff = Constants.showupfee + Constants.bonus