from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, # Currency as c, currency_range Currency as c, ) import random doc = """ This is an iterated Prisoner's Dilemma where players play against a computer player that executes a particular strategy. """ class Constants(BaseConstants): name_in_url = 'pre2' players_per_group = None # players_per_group = 1 num_rounds = 1 instructions_template = 'pre_survey2/instructions.html' # payoff if 1 player defects and the other cooperates""", betray_payoff = c(300) betrayed_payoff = c(0) # payoff if both players cooperate or both defect both_cooperate_payoff = c(200) both_defect_payoff = c(50) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): exp_payoff = models.CurrencyField( label='What do you think your total payoff at the end of this session (15 rounds) will be? ' 'The instructions and payoffs are reproduced below for your reference' )