from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) # from otree_tools.models.fields import OtherModelField import random import itertools author = 'Celine Zhang' doc = """ This is a one-period public goods game with 32 players and 4 per group. """ class Constants(BaseConstants): name_in_url = 'fourparty' players_per_group = None num_rounds = 1 instructions_template = 'dictator/instructions.html' endowment = c(100) endowment1 = c(30) endowment2 = c(30) endowment3 = c(30) endowment4 = c(30) endowment5 = c(30) endowment6 = c(30) endowment7 = c(30) endowment8 = c(30) endowment9 = c(30) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): decision1 = models.CurrencyField( min=0, max=Constants.endowment1, ) decision2 = models.CurrencyField( min=0, max=Constants.endowment2, ) decision3 = models.CurrencyField( min=0, max=Constants.endowment3, ) decision4 = models.CurrencyField( min=0, max=Constants.endowment4, ) decision5 = models.CurrencyField( min=0, max=Constants.endowment5, ) decision6 = models.CurrencyField( min=0, max=Constants.endowment6, ) decision7 = models.CurrencyField( min=0, max=Constants.endowment7, ) decision8 = models.CurrencyField( min=0, max=Constants.endowment8, ) decision9 = models.CurrencyField( min=0, max=Constants.endowment9, ) newcheck = models.CharField(choices=['Person A', 'Person B', 'Person C' ], widget=widgets.RadioSelect) newcheck2 = models.CharField(choices=['Person A', 'Person B', 'Person C' ], widget=widgets.RadioSelect) newcheck3 = models.CharField(choices=['Nothing', 'Send points to Person B', 'Remove points from Person A' ], widget=widgets.RadioSelect) newcheck4 = models.CharField(choices=['Send additional points to Person B', 'Remove additional points from Person A', 'Remove points from Person C' ], widget=widgets.RadioSelect) s1q1attempt = models.IntegerField(initial=0) s1q2attempt = models.IntegerField(initial=0) subjectid = models.CharField(initial='')