from typing import List
from otree.api import *
c = cu
doc = 'financial_literacy'
class C(BaseConstants):
NAME_IN_URL = 'survey_2'
PLAYERS_PER_GROUP = None
NUM_ROUNDS = 1
class Subsession(BaseSubsession):
pass
class Group(BaseGroup):
pass
class Player(BasePlayer):
numeracy_1 = models.StringField(
label='Suppose you have a close friend who has a lump in her breast and must have a mammogram. Of 100 women like her, 10 of them actually have a malignant tumor and 90 of them do not. Of the 10 women who actually have a tumor, the mammogram indicates correctly that 9 of them have a tumor and indicates incorrectly that 1 of them does not. Of the 90 women who do not have a tumor, the mammogram indicates correctly that 81 of them do not have a tumor and indicates incorrectly that 9 of them do have a tumor. Imagine that your friend tests positive (as if she had a tumor), what is the likelihood that she actually has a tumor, in percent (%)? (Please enter a number)'
)
numeracy_2 = models.StringField(
label='If Gabriel can drink one barrel of water in 6 days, and Marie can drink one barrel of water in 12 days, how long would it take them to drink one barrel of water together, in days? (Please enter a number)')
numeracy_3 = models.StringField(
label='A man buys a cow for €600, sells it for €700, buys it back for €800, and sells it finally for €900. How much has he made, in Euros? (Please enter a number)')
numeracy_4 = models.StringField(
label='In a lottery, the chance of winning a car is 1 in 1000. What percent of lottery tickets win a car? (Please enter a number)')
numeracy_5 = models.StringField(
label='In a lottery, the chances of winning a €10000 prize are 1%. What is your best guess about how many people would win a €10000 prize if 1000 people each buy a single lottery ticket? (Please enter a number)')
numeracy_6 = models.StringField(
label='Imagine that we roll a fair, six-sided die 1000 times. Out of 1000 rolls, how many times do you think the die would come up as an even number? (Please enter a number)')
numeracy_7 = models.StringField(
label='If the chance of getting a disease is 20 out of 100, this would be the same as having a ______ chance of getting the disease, in percent (%). (Please enter a number)')
numeracy_8 = models.StringField(
label='If the chance of getting a disease is 10%, how many people would be expected to get the disease out of 1000? (Please enter a number)')
#num_errors_numeracy = models.IntegerField(initial=0)
literacy_1 = models.StringField(choices=['The stock market helps to predict stock earnings',
'The stock market results in an increase in the price of stocks',
'The stock market brings people who want to buy stocks together with those who want to sell stocks',
'None of the above',
'Do not know',
'I refuse to answer'],
label='Which of the following statements describes the main function of the stock market?',
widget=widgets.RadioSelect
)
literacy_2 = models.StringField(choices=['He owns a part of firm B',
'He has lent money to firm B',
'He is liable for firm B’s debts',
'None of the above',
'Do not know',
'I refuse to answer'],
label='Which of the following statements is correct? If somebody buys the stock of firm B in the stock market:',
widget=widgets.RadioSelect
)
literacy_3 = models.StringField(
choices=['Once one invests in a mutual fund, one cannot withdraw the money in the first year',
'Mutual funds can invest in several assets, for example invest in both stocks and bonds',
'Mutual funds pay a guaranteed rate of return which depends on their past performance',
'None of the above',
'Do not know',
'I refuse to answer'],
label='Which of the following statements is correct?',
widget=widgets.RadioSelect
)
literacy_4 = models.StringField(choices=['He owns a part of firm B',
'He has lent money to firm B',
'He is liable for firm B’s debts',
'None of the above',
'Do not know',
'I refuse to answer'],
label='Which of the following statements is correct? If somebody buys a bond of firm B:',
widget=widgets.RadioSelect
)
literacy_5 = models.StringField(choices=['Savings accounts',
'Bonds',
'Stocks',
'Do not know',
'I refuse to answer'],
label='Considering a long time period (for example 10 or 20 years), which asset normally gives the highest return?',
widget=widgets.RadioSelect
)
literacy_6 = models.StringField(choices=['Savings accounts',
'Bonds',
'Stocks',
'Do not know',
'I refuse to answer'],
label='Normally, which asset displays the highest fluctuations over time?',
widget=widgets.RadioSelect
)
literacy_7 = models.StringField(choices=['Increase',
'Decrease',
'Stay the same',
'Do not know',
'I refuse to answer'],
label='When an investor spreads his money among different assets, does the risk of losing money:',
widget=widgets.RadioSelect
)
literacy_8 = models.StringField(choices=['True',
'False',
'Do not know',
'I refuse to answer'],
label='If you buy a 10-year bond, it means you cannot sell it after 5 years without incurring a major penalty. True or false?',
widget=widgets.RadioSelect
)
literacy_9 = models.StringField(choices=['True',
'False',
'Do not know',
'I refuse to answer'],
label='Bonds are normally riskier than stocks. True or false?',
widget=widgets.RadioSelect
)
literacy_10 = models.StringField(choices=['True',
'False',
'Do not know',
'I refuse to answer'],
label='Buying a stock mutual fund usually provides a safer return than a company stock. True or false?',
widget=widgets.RadioSelect
)
literacy_11 = models.StringField(choices=['Rise',
'Fall',
'Stay the same',
'Do not know',
'I refuse to answer'],
label='If the interest rate rises, what should happen to bond prices?',
widget=widgets.RadioSelect
)
#num_errors_literacy = models.IntegerField(initial=0)
class Start(Page):
form_model = 'player'
class Numeracy_test(Page):
timeout_seconds = 10 #240
form_model = 'player'
@staticmethod
def get_form_fields(player: Player):
import random
form_fields = ['numeracy_1', 'numeracy_2', 'numeracy_3', 'numeracy_4', 'numeracy_5', 'numeracy_6', 'numeracy_7',
'numeracy_8']
random.shuffle(form_fields)
return form_fields
#def error_message(player: Player, values):
#if values["numeracy_1"] != 50 or values["numeracy_2"] != 4 or values["numeracy_3"] != 200 or values["numeracy_4"] != 0.1 or values["numeracy_5"] != 10 or values["numeracy_6"] != 500 or values["numeracy_7"] != 20 or values["numeracy_8"] != 100:
#player.num_errors_numeracy += 1
class Start_literacy(Page):
form_model = 'player'
class Financial_literacy(Page):
timeout_seconds = 10 #330
form_model = 'player'
@staticmethod
def get_form_fields(player: Player):
import random
form_fields = ['literacy_1', 'literacy_2', 'literacy_3', 'literacy_4', 'literacy_5', 'literacy_6', 'literacy_7',
'literacy_8', 'literacy_9', 'literacy_10', 'literacy_11']
random.shuffle(form_fields)
return form_fields
#def error_message(player: Player, values):
#if values["literacy_1"] != 'The stock market brings people who want to buy stocks together with those who want to sell stocks' or values["literacy_2"] != 'He owns a part of firm B' or values["literacy_3"] != 'Mutual funds can invest in several assets, for example invest in both stocks and bonds' or values["literacy_4"] != 'He has lent money to firm B' or values["literacy_5"] != 'Stocks' or values["literacy_6"] != 'Stocks' or values["literacy_7"] != 'Decrease' or values["literacy_8"] != 'False' or values["literacy_9"] != 'False' or values["literacy_10"] != 'True' or values["literacy_11"] != 'Fall':
#player.num_errors_literacy += 1
page_sequence = [Start, Numeracy_test, Start_literacy, Financial_literacy]