from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Alexander Schneeberger' doc = """ Rule Elicitation for the Rule Following Task """ class Constants(BaseConstants): name_in_url = 'RE' players_per_group = None num_rounds = 1 # Choices rule_choices = [ ['Blue', 'The rule is to put the balls in the blue bucket'], ['Yellow', 'The rule is to put the balls in the yellow bucket'], ] # Load other Content RFT_Box = 'RE/Box_RFT.html' class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): p.RFT_blue_bonus = c(self.session.config['RFT_blue_bonus']) p.RFT_yellow_bonus = c(self.session.config['RFT_yellow_bonus']) class Group(BaseGroup): pass class Player(BasePlayer): rule = models.StringField(choices=Constants.rule_choices) # For the description of the Rule Following Task RFT_blue_bonus = models.CurrencyField() RFT_yellow_bonus = models.CurrencyField()