from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) doc = '\nThis is a standard 2-player trust game where the amount sent by player 1 gets\ntripled. The trust game was first proposed by\n\n Berg, Dickhaut, and McCabe (1995)\n.\n' class Constants(BaseConstants): name_in_url = "trust_1" players_per_group = 2 num_rounds = 1 endowment = c(10) multiplier = 3 instructions_template = "trust_1/instructions.html" class Subsession(BaseSubsession): pass class Group(BaseGroup): sent_amount = models.CurrencyField( doc="Amount sent by P1", max=Constants.endowment, min=0 ) sent_back_amount = models.CurrencyField(doc="Amount sent back by P2", min=0) def sent_back_amount_max(self): return self.sent_amount * Constants.multiplier def set_payoffs(self): p1 = self.get_player_by_id(1) p2 = self.get_player_by_id(2) p1.payoff = Constants.endowment - self.sent_amount + self.sent_back_amount p2.payoff = ( Constants.endowment + self.sent_amount * Constants.multiplier - self.sent_back_amount ) class Player(BasePlayer): twentyone = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="1) You sent this amount because you believe that the responder is trustworthy and will send back enough to compensate you:", ) twentytwo = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="2) You sent this amount because you believe that the responder is untrustworthy and will not send back enough to compensate you:", ) twentythree = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="3) You sent this amount because you like taking risks for a possibility of higher return:", ) twentyfour = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very Important"], ], label="4) You sent this amount because you do not like taking risks even if they may bring higher returns:", ) twentyfive = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="5) You sent this amount because you do not want to be let down by receiving back very little from the responder:", ) twentysix = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="6) You sent this amount because you are a generous person and believe in sharing:", ) twentyseven = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="7) You sent this amount because you would like everyone to get an equal share of the pie:", ) twentyeight = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="8) You sent this amount because you would like to maximize the pool of potential resources that can be shared:", ) twentynine = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="1) You sent this amount because you felt the need to reciprocate to the trust that the proposer showed toward you:", ) thirty = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very impotant"], ], label="2) You sent this amount because you felt that the proposer did not trust you enough:", ) thirtyone = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="3) You sent this amount because you are a generous person and believe in sharing:", ) thirtytwo = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="4) You sent this amount because you want to maximize your gain and do not believe in sharing:", ) thirtythree = models.StringField( choices=[ ["1", "1 - Not at all important"], ["2", "2 - Mildly important"], ["3", "3 - Important"], ["4", "4 - Very important"], ], label="5) You sent this amount because you would like everyone to get an equal share of the pie:", ) def role(self): return {1: "A", 2: "B"}[self.id_in_group]