from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random import itertools from random import shuffle # author = 'Dan Way' doc = """ Cost Reporting """ class Constants(BaseConstants): name_in_url = 'cost_reporting' players_per_group = 2 num_rounds = 1 class Subsession(BaseSubsession): def creating_session(self): if 'condition' in self.session.config: for g in self.get_groups(): #for p in g.get_players(): p1 = g.get_player_by_id(1) p2 = g.get_player_by_id(2) #First person is Manager A, second is B...they'll be rematched later anyway p1.participant.vars['condition'] = self.session.config['condition'] p1.participant.vars['type'] = 1 p2.participant.vars['condition'] = self.session.config['condition'] p2.participant.vars['type'] = 2 class Group(BaseGroup): pass class Player(BasePlayer): def role(self): if self.type == 1: return 'Manager A' else: return 'Manager B' condition = models.IntegerField() type = models.IntegerField() partner_id = models.IntegerField() informed_consent = models.CharField(initial=None, choices=[('Yes', 'Yes'), ('No', 'No')], verbose_name='', widget=widgets.RadioSelect()) kc1 = models.CharField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc2 = models.CharField(initial=None, choices=[('a', 'a. The same individual in all periods.'), ('b', 'b. A different individual in each period.')], verbose_name='', widget=widgets.RadioSelect()) kc3 = models.CharField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc4 = models.CharField(initial=None, choices=[('a', 'a. The other division manager'), ('b', 'b. The company owner'), ('c', 'c. Both (a) and (b) will know the actual cost of your project')], verbose_name='', widget=widgets.RadioSelect()) kc5 = models.CharField(initial=None, choices=[('a', 'a. One of the two managers could receive an audit bonus for reporting the ' 'project cost accurately.'), ('b', 'b. One of the two managers could receive no compensation at all for the ' 'period if it is determined they misreported the project cost.'), ('c', 'c. The manager of the project being audited could receive additional ' 'funds from the company owner above the actual project cost.'), ('d', 'd. One of the two managers could still receive their fixed salary for the period.')], verbose_name='', widget=widgets.RadioSelect()) kc6 = models.CharField(initial=None, choices=[('a', 'a. The other manager will NEVER know what costs you have reported.'), ('b', 'b. Only at the END of the reporting period after projects are funded.'), ('c', 'c. Prior to making their own cost reports.')], verbose_name='', widget=widgets.RadioSelect()) kc7 = models.CharField(initial=None, choices=[('a', 'a. Only at the END of the reporting period after projects are funded.'), ('b', 'b. Prior to making your cost reports.'), ('c', 'c. You will NEVER know what costs the other manager reported.')], verbose_name='', widget=widgets.RadioSelect()) kc8 = models.CharField(initial=None, choices=[('a', 'a. 70%/30%'), ('b', 'b. 60%/40%'), ('c', 'c. 50%/50%')], verbose_name='', widget=widgets.RadioSelect()) worker_id = models.CharField(initial='e') ip_address = models.CharField() mturk_dupe = models.IntegerField()