from otree.api import * author= "Nathaniel Lawrence, LEMMA, Université Panthéon-Assas" doc = """ Berlin Numeracy Test From: Cokely, E. T., Galesic, M., Schulz, E., Ghazal, S., & Garcia-Retamero, R. (2012). Measuring risk literacy: The berlin numeracy test. Judgment and Decision Making, 7(1), 25–47. """ ### Define constants here, in all-caps class C(BaseConstants): NAME_IN_URL = 'bnt' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass ### define the questions a player must answer here class Player(BasePlayer): ### Numeracy num_1 = models.IntegerField( label = 'Out of 1,000 people in a small town 500 are members of a choir. Out of these 500 members in the choir 100 are men. Out of the 500 inhabitants that are not in the choir 300 are men. What is the probability that a randomly drawn man is a member of the choir? Please indicate the probability in percent (%).', min=0 ) num_2a = models.IntegerField( label = 'Imagine we are throwing a five-sided die 50 times. On average, out of these 50 throws how many times would this five-sided die show an odd number (1, 3 or 5)? ______ out of 50 throws.', min=0 ) num_2b = models.IntegerField( label = 'Imagine we are throwing a loaded die (6 sides). The probability that the die shows a 6 is twice as high as the probability of each of the other numbers. On average, out of these 70 throws how many times would the die show the number 6? ________out of 70 throws.', min=0 ) num_3 = models.IntegerField( label = 'In a forest 20% of mushrooms are red, 50% brown and 30% white. A red mushroom is poisonous with a probability of 20%. A mushroom that is not red is poisonous with a probability of 5%. What is the probability that a poisonous mushroom in the forest is red? ________', min=0 ) ### Numeracy Attitude numatt_1 = models.StringField( choices = [['1','1 - Not confident at all'],['2','2'],['3','3'],['4','4'],['5','5 - Absolutely confident']], label='On a scale of 1 to 5, how confident are you in your mathematical abilities?', widget=widgets.RadioSelect ) numatt_2 = models.StringField( choices = [['1','1 - Not confident at all'],['2','2'],['3','3'],['4','4'],['5','5 - Absolutely confident']], label='On a scale of 1 to 5, how confident are you in your financial decision-making abilities?', widget=widgets.RadioSelect ) numatt_3 = models.StringField( choices = [['1','1 - Not confident at all'],['2','2'],['3','3'],['4','4'],['5','5 - Absolutely confident']], label='On a scale of 1 to 5, how confident are you in your understanding of mathematics? ', widget=widgets.RadioSelect ) numatt_4 = models.StringField( choices = [['1','1 - Not confident at all'],['2','2'],['3','3'],['4','4'],['5','5 - Absolutely confident']], label='On a scale of 1 to 5, how confident are you in your understanding of probability?', widget=widgets.RadioSelect ) numatt_5 = models.StringField( choices = [['1','1 - Not confident at all'],['2','2'],['3','3'],['4','4'],['5','5 - Absolutely confident']], label='On a scale of 1 to 5, how confident are you in your understanding of economics?', widget=widgets.RadioSelect ) # PAGES class BNT_1(Page): form_model = 'player' form_fields = ['num_1'] class BNT_2a(Page): form_model = 'player' form_fields = ['num_2a'] @staticmethod def is_displayed(player): return player.num_1 != 25 class BNT_2b(Page): form_model = 'player' form_fields = ['num_2b'] @staticmethod def is_displayed(player): return player.num_1 == 25 class BNT_3(Page): form_model = 'player' form_fields = ['num_3'] @staticmethod def is_displayed(player): if player.field_maybe_none('num_2a') is None: if player.num_2b != 20: return True class NumeracyAttitude(Page): form_model = 'player' form_fields = ['numatt_1','numatt_2','numatt_3','numatt_4','numatt_5'] class Results(Page): pass page_sequence = [BNT_1, BNT_2a, BNT_2b, BNT_3, NumeracyAttitude]