from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = 'This is a survey for players to take after the game.' class Constants(BaseConstants): name_in_url = 'survey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): strategy = models.LongStringField(label='How did you decide which site to go to?') poacher_strategy = models.LongStringField(label='How do you think that the ranger decides where to go?') choice = models.IntegerField(choices=[[1, 'I went to sites where I am more likely to see a rhino.'], [2, 'I went to sites where I am less likely to be caught by the ranger.'], [3, 'I took into account both the likelihood of seeing a rhino and that of being caught by the ranger.']], label='Which of the following most closely resembles your strategy?', widget=widgets.RadioSelect) def get_bonus(self): return max(round(int(self.participant.payoff) * 0.1,2),0) def get_payment(self): return max(round(int(self.participant.payoff) * 0.1,2),0) + 1