from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'jacopo.bregolin@gmail.com' doc = """ Introductiory description and instructions of the game. """ """ Here is set the treatment to which the player belongs. 1A: 1 advisor + 0.6 1B: 1 advisor + 0.7 2A1: 2 advisors + 0.6 + version 1 of the last rounds 2A2: 2 advisors + 0.6 + version 2 of the last rounds 2B1: 2 advisors + 0.7 + version 1 of the last rounds 2B2: 2 advisors + 0.7 + version 2 of the last rounds """ import random class Constants(BaseConstants): print('#################### THIS VERSION IS UPDATED AT June 2nd 2021 + minor modification in date May 9th 2023 where symbol < was replaced with html counterpart < ###################################') name_in_url = 'Instructions' players_per_group = None num_rounds = 1 # SET HERE WHAT IS THE MAX BID PEOPLE CAN MAKE IN THE LAST ROUNDS max_bid_single = 250 max_bid_bundle = 250 # SET HERE WHAT IS THE MAX BID WHICH CAN BE DRAWN IN THE LAST ROUNDS FOR THE SECOND PRICE AUCTION # (we decided to allow a difference between the max price drawn and the max price of the bid) # (max drawn price is based on true ditribution of what layers should play, while the max bid price allows for the participant to go beyond to not risk # a bunching at the max) max_bid_single_drawn = 100 max_bid_bundle_drawn = 100 # payoff for 1 answer correct payoff_answer_correct = 500 class Subsession(BaseSubsession): def creating_session(self): self.session.vars['euroconversion'] = self.session.config['euroconversion'] self.session.vars['max_bid_single'] = Constants.max_bid_single self.session.vars['max_bid_bundle'] = Constants.max_bid_bundle self.session.vars['max_bid_single_drawn'] = Constants.max_bid_single_drawn self.session.vars['max_bid_bundle_drawn'] = Constants.max_bid_bundle_drawn self.session.vars['payoff_answer_correct'] = Constants.payoff_answer_correct self.session.vars['init_endowment'] = self.session.config['init_endowment_points'] # recover treatment from setting.py treatment = self.session.config['Treatment'] for p in self.get_players(): # allocate treatment to participants p.participant.vars['treatment'] = treatment if p.participant.vars['treatment'].startswith('2'): # allocate version of last rounds to participants with 2-advisor treatment p.participant.vars['treatment_2advisors_lastrounds'] = self.session.config['version_lastrounds'] else: p.participant.vars['treatment_2advisors_lastrounds'] = '-' # random value for the examples given in the introduction (using blue or green) p.descriptiontype = random.choice(['g','b']) class Group(BaseGroup): pass class Player(BasePlayer): descriptiontype = models.StringField()