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_p2' players_per_group = 2 num_rounds = 1 class Subsession(BaseSubsession): pass 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() worker_id = models.CharField(initial='e') pay_period = models.IntegerField() pay_period_lira = models.IntegerField() comp_1 = models.CharField() comp_2 = models.FloatField() comp_received = models.FloatField() #Placeholder for cooperation task when determining group comp total_wait_time = models.IntegerField() wait_bonus = models.FloatField() total_comp = models.FloatField() #Interim questionnaire reporting_control = models.CharField(initial=None, choices=[('1', '1 = None at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Some control.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Complete control.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) other_mgr_trust = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Somewhat.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = A great deal.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) vertical_trust = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Somewhat.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = A great deal.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) other_mgr_influence = models.CharField(initial=None, choices=[('1', '1 = Knowing the other manager was also reporting caused me to report ' 'LESS accurately.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = It did not affect my decisions.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Knowing the other manager was also reporting caused ' 'me to report MORE accurately.')], verbose_name='') individual_reporting_dif = models.CharField(initial=None, choices=[('1', '1 = I would have reported costs LESS accurately.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = My reports would have been no different.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = I would have reported costs MORE accurately.')], verbose_name='') shared_interest_infl = models.CharField(initial=None, choices=[('1', '1 = It did not affect my reporting decisions.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = It made me report slightly higher costs to try to obtain some funds to split with them.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = It made me report MUCH higher costs to try to obtain more funds to split with them.')], verbose_name='') owner_concern = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) entitled_misreporting = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) company_attachment = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) company_exit = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) company_attractiveness = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) firm_member_similarity = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) relational_identification = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4 = Neither disagree nor agree.'), ('5', '5'), ('6', '6'), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) #Cooperation task individual_points = models.IntegerField(verbose_name='', min=0, max=50) duo_points = models.IntegerField(verbose_name='', min=0, max=50) firm_points = models.IntegerField(verbose_name='', min=0, max=50) decision_time = models.CharField() #PEQ compensatory_behavior = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Neither disagree nor agree.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) mgr_carryover = models.CharField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Neither disagree nor agree.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_expectations = models.CharField(initial=None, choices=[('1', '1 = I did not expect others to allocate ANY points to the group project.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = I expected others to allocate SOME points to the group project.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = I expected others to allocate ALL of their points to the group project.')], verbose_name='') peq_attention = models.CharField(initial=None, choices=[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11')], verbose_name='', widget=widgets.RadioSelectHorizontal()) comp_sat_1 = models.CharField(initial=None, choices=[('1', '1 = Not at all satisfied.'), ('2', '2'), ('3', '3'), ('4', '4 = Somewhat satisfied.'), ('5', '5'), ('6', '6'), ('7', '7 = Very satisfied.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) comp_sat_2 = models.CharField(initial=None, choices=[('1', '1 = Not at all satisfied.'), ('2', '2'), ('3', '3'), ('4', '4 = Somewhat satisifed.'), ('5', '5'), ('6', '6'), ('7', '7 = Very satisfied.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_turk_income = models.CharField(initial=None, choices=[('1', '1 = My work on MTurk is for fun or interest only - I ' 'don`t rely on it for income.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = My work on MTurk supplements my household`s' ' primary income.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = My work on MTurk generates a significant' ' portion of my household`s total income.')], verbose_name='') peq_affect_happy = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_sad = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_excited = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_upset = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_proud = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_irritable = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_inspired = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peq_affect_nervous = models.CharField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6 = Moderately.'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11 = Extremely.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) gender = models.CharField(initial=None, choices=[('1', 'Male'), ('2', 'Female')], verbose_name='', widget=widgets.RadioSelect()) age_range = models.CharField(initial=None, choices=[('1', '18-24'), ('2', '25-34'), ('3', '35-44'), ('4', '45-54'), ('5', '55-64'), ('6', '65 and older')], verbose_name='', widget=widgets.RadioSelect()) work_experience = models.IntegerField(verbose_name='') education = models.CharField(initial=None, choices=[('1', 'Less than high school'), ('2', 'High school graduate'), ('3', 'Some college'), ('4', '2 year degree'), ('5', '4 year degree'), ('6', 'Graduate degree')], verbose_name='', widget=widgets.RadioSelect())