from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) from radiogrid import RadioGridField from django.forms import widgets as django_widgets 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 = 'Personal_Norms_session_1' players_per_group = None num_rounds = 1 instructions_template = 'Personal_Norms_session_1/Instructions.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): P_ID = models.StringField(label="Please check whether your particpant ID is entered correctly.") consent = models.IntegerField( label='Consent declaration:', initial=None, choices=[ [1, 'I 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 ) # demographic start questionnaire sex = models.IntegerField( label='What is your gender?', choices=[ [1, 'male'], [2, 'female'], [3, 'other / prefer not to say']], widget=widgets.RadioSelect, ) age = models.IntegerField( label='Please enter your year of birth (YYYY):', min=1900, max=2002, ) nationality = models.StringField( label="What is you nationality?" ) # control variables m_check_1 = models.BooleanField( label='Individual B will only be informed about the game if Individual A decides to play the game.', widget=widgets.CheckboxInput, blank=True) m_check_2 = models.BooleanField( label='Individual A can only distribute the points if he/she decides to play the game.', widget=widgets.CheckboxInput, blank=True) ROWS1 = ( (1, "Pass (Do not Play Game)"), (2, "Play Game and Give $1 to Individual B"), (3, "Play Game and Give $1 to Individual B"), (4, "Play Game and Give $2 to Individual B"), (5, "Play Game and Give $3 to Individual B"), (6, "Play Game and Give $4 to Individual B"), (7, "Play Game and Give $4 to Individual B"), (8, "Play Game and Give $4 to Individual B"), (9, "Play Game and Give $4 to Individual B"), (10, "Play Game and Give $4 to Individual B"), (11, "Play Game and Give $4 to Individual B"), (12, "Play Game and Give $4 to Individual B"), ) VALUES = ( (1, "Very socially inappropriate"), (2, "Somewhat socially inappropriate"), (3, "Somewhat socially appropriate"), (4, "Very socially appropriate"), ) personalnorm_session_1 = RadioGridField(rows=ROWS1, values=VALUES, require_all_fields=True, default="", verbose_name='From those five options, how socially appropriate would it be to choose each of the following?') feedback = models.LongStringField(blank=True) ################################################################ ########## Varia ########## ################################################################ UserAgent = models.StringField() device = models.StringField()