from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = '' class Constants(BaseConstants): name_in_url = 'eng' 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) conditional_0 = models.CurrencyField(label='Average group contribution = 0, My contribution=', max=Constants.endowment, min=0) conditional_5 = models.CurrencyField(label='Average group contribution = 5, My contribution=', max=Constants.endowment, min=0) conditional_10 = models.CurrencyField(label='Average group contribution = 10, My contribution=', max=Constants.endowment, min=0) conditional_15 = models.CurrencyField(label='Average group contribution = 15, My contribution=', max=Constants.endowment, min=0) conditional_20 = models.CurrencyField(label='Average group contribution = 20, My contribution=', max=Constants.endowment, min=0) followup_question1 = models.CurrencyField(label='1. A person, who only cares about their own earnings and believes that the others put 0 in the common pool on the average, will choose to put … points in the common pool.', max=Constants.endowment, min=0) followup_question2 = models.CurrencyField(label='2. A person, who only cares about their own earnings and believes that the others gave 10 to the group on average, will choose to put … points in the common pool.', max=Constants.endowment, min=0) followup_question3 = models.CurrencyField(label='3. A person, who only cares about their own earnings and believes that the others gave 20 to the group on average, will choose to put … points in the common pool.', max=Constants.endowment, min=0) followup_question4 = models.CurrencyField(label='4. A person, who only cares about other’s earnings and believes that the others gave 0 to the group on average, will choose to put … points in the common pool.', max=Constants.endowment, min=0) followup_question5 = models.CurrencyField(label='5. A person, who only cares about other’s earnings and believes that the others gave 10 to the group on average, will choose to put … points in the common pool.', max=Constants.endowment, min=0) followup_question6 = models.CurrencyField(label='6. A person, who only cares about other’s earnings and believes that the others gave 20 to the group on average, will choose to put … points in the common pool.', max=Constants.endowment, min=0) finnish_skill = models.IntegerField(label='Finnish', max=10, min=0) english_skill = models.IntegerField(label='English', max=10, 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!"