class Player(otree.models.BasePlayer): # <built-in> subsession = models.ForeignKey(Subsession) group = models.ForeignKey(Group, null=True) # </built-in> q_doctor = models.PositiveIntegerField(default=None, verbose_name=''' A doctor gives you 3 pills, and tells you to take 1 pill every 30 minutes starting right away. After how many minutes will you run out of pills?''', correct_answer=60, correct_answer_explanation=''' You take the first pill right now, the second pill after 30 minutes, and the third pill after 60 minutes, so after 60 minutes you will have run out of pills. ''') q_meal = models.MoneyField(default=None, verbose_name=''' A meal, including a beverage, costs {} in total. The food costs 5 times as much as the beverage. How much does the food cost?' '''.format(Money(1.20)), correct_answer=Money(1.00), correct_answer_explanation=''' The beverage costs {} and the food costs {} '''.format(Money(0.20), Money(1.00)))
class Constants: #"""Payoff for each player if at least one volunteers""" general_benefit = Money(1.00)\ # """Cost incurred by volunteering player""" volunteer_cost = Money(0.40)
def variables_for_template(self): if self.player.private_value is None: self.player.private_value = self.player.generate_private_value() return {'private_value': self.player.private_value, 'min_bid': Money(self.subsession.min_allowable_bid), 'max_bid': Money(self.subsession.max_allowable_bid)}
def variables_for_template(self): if self.player.item_value_estimate is None: self.player.item_value_estimate = self.subsession.generate_value_estimate() return {'item_value_estimate': self.player.item_value_estimate, 'error_margin': Constants.estimate_error_margin, 'min_bid': Money(Constants.min_allowable_bid), 'max_bid': Money(Constants.max_allowable_bid)}
class Constants: common_gain = Money(0.10) common_loss = Money(0.00) individual_gain = Money(2.00) defect_costs = Money(0.20)
class Constants: self_A_other_A = Money(0.10) # How much I make if I choose A and the other player chooses B self_A_other_B = Money(0.00) self_B_other_A = Money(0.30) self_B_other_B = Money(0.40)
class Constants: max_fixed_payment = Money(7.00) #Maxmimum absolute value for agent's fixed pay""" # """Amount principal gets if contract is rejected""" reject_principal_pay = Money(0) reject_agent_pay = Money(1.00) # """Total return for single unit of agent's work effort""" agent_work_effort_base_return = Money(0.7) agent_return_share_choices = [[percent/100, '{}%'.format(percent)] for percent in range(10, 100+1, 10)]
class Constants: # """Amount rewarded to husband if football is chosen""" football_husband_amount = Money(0.30) # Amount rewarded to wife if football is chosen football_wife_amount = Money(0.20) # amount rewarded to either if the choices don't match mismatch_amount = Money(0.00) opera_husband_amount = Money(0.20) opera_wife_amount = Money(0.30)
class Constants: rowAcolumnA_row = Money(0.20) rowAcolumnA_column = Money(0.30) # Amount row player gets, if row player chooses A and column player chooses B rowAcolumnB_row = Money(0.40) rowAcolumnB_column = Money(0.10) rowBcolumnA_row = Money(0.05) rowBcolumnA_column = Money(0.45) rowBcolumnB_row = Money(0.15) rowBcolumnB_column = Money(0.25)
def cost_from_effort(effort): costs = {1: 0, 2: .20, 3: .40, 4: .60, 5: .90, 6: 1.20, 7: 1.60, 8: 2.00, 9: 2.50, 10: 3.00} return Money(costs[effort])
class Constants: # Marginal cost of production, effectively the minimum price (exclusive)""" marginal_cost = Money(0.20) maximum_price = Money(1.00)
class Constants: stag_stag_amount = Money(0.20) stag_hare_amount = Money(0.00) hare_stag_amount = Money(0.10) hare_hare_amount = Money(0.10)
class Constants: # Payoff for each player if choices group group_amount = Money(1.00) # Payoff for each player if choices don't group mismatch_amount = Money(0.00)
class Constants: winner_payoff = Money(1.00)
class Constants: # Initial amount allocated to the dictator allocated_amount = Money(1.00)
class Constants: min_allowable_bid = Money(0.0) max_allowable_bid = Money(10.0)
class Constants: max_bid_amount = Money(1.00)
class Constants: min_allowable_bid = Money(0.0) max_allowable_bid = Money(10.0) # Error margin for the value estimates shown to the players estimate_error_margin = Money(1.00)
def return_from_effort(self, effort): return effort * Money(self.agent_work_effort_base_return)