from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random doc = """ One player decides how to divide a certain amount between himself and the other player. See: Kahneman, Daniel, Jack L. Knetsch, and Richard H. Thaler. "Fairness and the assumptions of economics." Journal of business (1986): S285-S300. """ class Constants(BaseConstants): name_in_url = 'consent' players_per_group = None num_rounds = 1 #instructions_template = 'dictator_private/Instructions.html' class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): p.condition = random.sample(["private","normal"], k=1)[0] class Group(BaseGroup): pass class Player(BasePlayer): consent = models.IntegerField( label='Consent declaration:', initial=None, choices=[ [1, 'I have read and understood the stated terms. I had enough time to make a decision. Herewith, I consent to participate in this study.'], [0, 'I choose not to participate in this study.'] ], widget=widgets.RadioSelect ) ################################################################ ########## Varia ########## ################################################################ UserAgent = models.StringField() device = models.StringField() condition = models.StringField()