from decimal import Decimal from otree.api import * from public_goods import * class Constants(BaseConstants): name_in_url = 'public_goods_intro' players_per_group = 4 num_rounds = 12 endowment = cu(30) instruction_template = 'public_goods/instruction.html' conversion_rate = 1000 class Subsession(BaseSubsession): multiplier = models.FloatField() real_world_endowment = models.CurrencyField() class Group(BaseGroup): total_contribution = models.CurrencyField() individual_share = models.CurrencyField() class Player(BasePlayer): contribution = models.CurrencyField( min=0, max=Constants.endowment, label=f"How much do you decide to invest into the Group Exchange account? Please enter an amount from 0 to {Constants.endowment}" )