from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = '' class Constants(BaseConstants): name_in_url = 'thesis_public_goods_english' endowment = c(20) players_per_group = None num_rounds = 1 multiplier = 1.5 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): control_question_1a = models.CurrencyField(label='1. a) At the start of a round, each group member receives 20 points. Suppose nobody (including you) contributes any points to the project. What is your payoff?') control_question_1b = models.CurrencyField(label='1. b) What is the payoff of the other group members?') control_question_2a = models.CurrencyField(label='2. a) At the start of a round, each group member receives 20 points. Suppose the other three group members contribute a total of 40 points to the group project. Now suppose you contribute 0 points to the group project. How many points will each player receive from the group contributions? ') control_question_2b = models.CurrencyField(label='2. b) How many points will you earn in total this round?') contribution = models.CurrencyField(label='I choose to contribute ____ points.', max=Constants.endowment, min=0) expectation = models.CurrencyField(label='How much do you think, on average, other participants have chosen to contribute to the group?', max=Constants.endowment, min=0) followup_question_1a = models.CurrencyField(label='1. a) At the start of a round, each group member receives 20 points. Suppose you contribute 20 points to the group project. All other group members each contribute 20 points to the group project. What is your payoff?') followup_question_1b = models.CurrencyField(label='1. b) What is the payoff of the other group members?') followup_question_2a = models.FloatField(label='2. a) At the start of a round, each group member receives 20 points. Suppose that again, the other three group members contribute a total of 40 points to the group project. Now suppose you contribute 10 points to the group project. How may points will each player receive from the group contributions? ') followup_question_2b = models.FloatField(label='2. b) How many points will you earn in total this round?') conditional_0 = models.CurrencyField(label='Average group contribution = 0, My contribution=', max=Constants.endowment, min=0) conditional_1 = models.CurrencyField(label='Average group contribution = 1, My contribution=', max=Constants.endowment, min=0) conditional_2 = models.CurrencyField(label='Average group contribution = 2, My contribution=', max=Constants.endowment, min=0) conditional_3 = models.CurrencyField(label='Average group contribution = 3, My contribution=', max=Constants.endowment, min=0) conditional_4 = models.CurrencyField(label='Average group contribution = 4, My contribution=', max=Constants.endowment, min=0) conditional_5 = models.CurrencyField(label='Average group contribution = 5, My contribution=', max=Constants.endowment, min=0) conditional_6 = models.CurrencyField(label='Average group contribution = 6, My contribution=', max=Constants.endowment, min=0) conditional_7 = models.CurrencyField(label='Average group contribution = 7, My contribution=', max=Constants.endowment, min=0) conditional_8 = models.CurrencyField(label='Average group contribution = 8, My contribution=', max=Constants.endowment, min=0) conditional_9 = models.CurrencyField(label='Average group contribution = 9, My contribution=', max=Constants.endowment, min=0) conditional_10 = models.CurrencyField(label='Average group contribution = 10, My contribution=', max=Constants.endowment, min=0) conditional_11 = models.CurrencyField(label='Average group contribution = 11, My contribution=', max=Constants.endowment, min=0) conditional_12 = models.CurrencyField(label='Average group contribution = 12, My contribution=', max=Constants.endowment, min=0) conditional_13 = models.CurrencyField(label='Average group contribution = 13, My contribution=', max=Constants.endowment, min=0) conditional_14 = models.CurrencyField(label='Average group contribution = 14, My contribution=', max=Constants.endowment, min=0) conditional_15 = models.CurrencyField(label='Average group contribution = 15, My contribution=', max=Constants.endowment, min=0) conditional_16 = models.CurrencyField(label='Average group contribution = 16, My contribution=', max=Constants.endowment, min=0) conditional_17 = models.CurrencyField(label='Average group contribution = 17, My contribution=', max=Constants.endowment, min=0) conditional_18 = models.CurrencyField(label='Average group contribution = 18, My contribution=', max=Constants.endowment, min=0) conditional_19 = models.CurrencyField(label='Average group contribution = 19, My contribution=', max=Constants.endowment, min=0) conditional_20 = models.CurrencyField(label='Average group contribution = 20, My contribution=', max=Constants.endowment, min=0) def control_question_1a_error_message(self, value): if value != 20: return "Please check your answer!" def control_question_1b_error_message(self, value): if value != 20: return "Please check your answer!" def control_question_2a_error_message(self, value): if value != 15: return "Please check your answer!" def control_question_2b_error_message(self, value): if value != 35: return "Please check your answer!"