from otree.api import * import time import random import math from decimal import Decimal import psycopg2 class C(BaseConstants): NAME_IN_URL = 'grpc' PLAYERS_PER_GROUP = 4 NUM_ROUNDS = 1 EMPLOYEE1_ROLE = "Employee" EMPLOYEE2_ROLE = "Employee" EMPLOYEE3_ROLE = "Employee" MANAGER_ROLE = "Manager" class Group(BaseGroup): pass class Subsession(BaseSubsession): pass class Player(BasePlayer): worker_id = models.CharField(initial='e') mturk_dupe = models.IntegerField(initial=0) exp_role = models.IntegerField() #1 = employee; 2=manager condition = models.IntegerField() informed_consent = models.StringField(initial=None, choices=[('Yes', 'Yes'), ('No', 'No')], verbose_name='', widget=widgets.RadioSelect()) kc1 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc2 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc3 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc4 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc5 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc6 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc7 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc8 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc9 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc10 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) kc11 = models.StringField(initial=None, choices=['True', 'False'], verbose_name='', widget=widgets.RadioSelect()) p1_productivity = models.IntegerField() p2_productivity = models.IntegerField() p3_productivity = models.IntegerField() p4_productivity = models.IntegerField() p5_productivity = models.IntegerField() p6_productivity = models.IntegerField() p7_productivity = models.IntegerField() p8_productivity = models.IntegerField() p9_productivity = models.IntegerField() p1_contribution = models.IntegerField() p2_contribution = models.IntegerField() p3_contribution = models.IntegerField() p4_contribution = models.IntegerField() p5_contribution = models.IntegerField() p6_contribution = models.IntegerField() p7_contribution = models.IntegerField() p8_contribution = models.IntegerField() p9_contribution = models.IntegerField() p1_output = models.IntegerField() p2_output = models.IntegerField() p3_output = models.IntegerField() p4_output = models.IntegerField() p5_output = models.IntegerField() p6_output = models.IntegerField() p7_output = models.IntegerField() p8_output = models.IntegerField() p9_output = models.IntegerField() p1_B_productivity = models.IntegerField() p2_B_productivity = models.IntegerField() p3_B_productivity = models.IntegerField() p4_B_productivity = models.IntegerField() p5_B_productivity = models.IntegerField() p6_B_productivity = models.IntegerField() p7_B_productivity = models.IntegerField() p8_B_productivity = models.IntegerField() p9_B_productivity = models.IntegerField() p1_B_contribution = models.IntegerField() p2_B_contribution = models.IntegerField() p3_B_contribution = models.IntegerField() p4_B_contribution = models.IntegerField() p5_B_contribution = models.IntegerField() p6_B_contribution = models.IntegerField() p7_B_contribution = models.IntegerField() p8_B_contribution = models.IntegerField() p9_B_contribution = models.IntegerField() p1_B_output = models.IntegerField() p2_B_output = models.IntegerField() p3_B_output = models.IntegerField() p4_B_output = models.IntegerField() p5_B_output = models.IntegerField() p6_B_output = models.IntegerField() p7_B_output = models.IntegerField() p8_B_output = models.IntegerField() p9_B_output = models.IntegerField() p1_C_productivity = models.IntegerField() p2_C_productivity = models.IntegerField() p3_C_productivity = models.IntegerField() p4_C_productivity = models.IntegerField() p5_C_productivity = models.IntegerField() p6_C_productivity = models.IntegerField() p7_C_productivity = models.IntegerField() p8_C_productivity = models.IntegerField() p9_C_productivity = models.IntegerField() p1_C_contribution = models.IntegerField() p2_C_contribution = models.IntegerField() p3_C_contribution = models.IntegerField() p4_C_contribution = models.IntegerField() p5_C_contribution = models.IntegerField() p6_C_contribution = models.IntegerField() p7_C_contribution = models.IntegerField() p8_C_contribution = models.IntegerField() p9_C_contribution = models.IntegerField() p1_C_output = models.IntegerField() p2_C_output = models.IntegerField() p3_C_output = models.IntegerField() p4_C_output = models.IntegerField() p5_C_output = models.IntegerField() p6_C_output = models.IntegerField() p7_C_output = models.IntegerField() p8_C_output = models.IntegerField() p9_C_output = models.IntegerField() p1_team_contributions = models.IntegerField() #This field is for managers to know total p2_team_contributions = models.IntegerField() p3_team_contributions = models.IntegerField() p4_team_contributions = models.IntegerField() p5_team_contributions = models.IntegerField() p6_team_contributions = models.IntegerField() p7_team_contributions = models.IntegerField() p8_team_contributions = models.IntegerField() p9_team_contributions = models.IntegerField() p1_team_output = models.IntegerField() p2_team_output = models.IntegerField() p3_team_output = models.IntegerField() p4_team_output = models.IntegerField() p5_team_output = models.IntegerField() p6_team_output = models.IntegerField() p7_team_output = models.IntegerField() p8_team_output = models.IntegerField() p9_team_output = models.IntegerField() p1_team_bonus_penalty = models.IntegerField(default=0) p2_team_bonus_penalty = models.IntegerField(default=0) p3_team_bonus_penalty = models.IntegerField(default=0) p4_team_bonus_penalty = models.IntegerField(default=0) p5_team_bonus_penalty = models.IntegerField(default=0) p6_team_bonus_penalty = models.IntegerField(default=0) p7_team_bonus_penalty = models.IntegerField(default=0) p8_team_bonus_penalty = models.IntegerField(default=0) p9_team_bonus_penalty = models.IntegerField(default=0) p1_eval_A = models.IntegerField() #A is just for managers; B and C also for employees (peers) p1_eval_B = models.IntegerField() p1_eval_C = models.IntegerField() p2_eval_A = models.IntegerField() p2_eval_B = models.IntegerField() p2_eval_C = models.IntegerField() p3_eval_A = models.IntegerField() p3_eval_B = models.IntegerField() p3_eval_C = models.IntegerField() p4_eval_A = models.IntegerField() p4_eval_B = models.IntegerField() p4_eval_C = models.IntegerField() p5_eval_A = models.IntegerField() p5_eval_B = models.IntegerField() p5_eval_C = models.IntegerField() p6_eval_A = models.IntegerField() p6_eval_B = models.IntegerField() p6_eval_C = models.IntegerField() p7_eval_A = models.IntegerField() p7_eval_B = models.IntegerField() p7_eval_C = models.IntegerField() p8_eval_A = models.IntegerField() p8_eval_B = models.IntegerField() p8_eval_C = models.IntegerField() p9_eval_A = models.IntegerField() p9_eval_B = models.IntegerField() p9_eval_C = models.IntegerField() p1_eval_from_B = models.IntegerField() p1_eval_from_C = models.IntegerField() p2_eval_from_B = models.IntegerField() p2_eval_from_C = models.IntegerField() p3_eval_from_B = models.IntegerField() p3_eval_from_C = models.IntegerField() p4_eval_from_B = models.IntegerField() p4_eval_from_C = models.IntegerField() p5_eval_from_B = models.IntegerField() p5_eval_from_C = models.IntegerField() p6_eval_from_B = models.IntegerField() p6_eval_from_C = models.IntegerField() p7_eval_from_B = models.IntegerField() p7_eval_from_C = models.IntegerField() p8_eval_from_B = models.IntegerField() p8_eval_from_C = models.IntegerField() p9_eval_from_B = models.IntegerField() p9_eval_from_C = models.IntegerField() # For managers ############################### p1_eval_A_of_B = models.IntegerField() p1_eval_A_of_C = models.IntegerField() p1_eval_B_of_A = models.IntegerField() p1_eval_B_of_C = models.IntegerField() p1_eval_C_of_A = models.IntegerField() p1_eval_C_of_B = models.IntegerField() p2_eval_A_of_B = models.IntegerField() p2_eval_A_of_C = models.IntegerField() p2_eval_B_of_A = models.IntegerField() p2_eval_B_of_C = models.IntegerField() p2_eval_C_of_A = models.IntegerField() p2_eval_C_of_B = models.IntegerField() p3_eval_A_of_B = models.IntegerField() p3_eval_A_of_C = models.IntegerField() p3_eval_B_of_A = models.IntegerField() p3_eval_B_of_C = models.IntegerField() p3_eval_C_of_A = models.IntegerField() p3_eval_C_of_B = models.IntegerField() p4_eval_A_of_B = models.IntegerField() p4_eval_A_of_C = models.IntegerField() p4_eval_B_of_A = models.IntegerField() p4_eval_B_of_C = models.IntegerField() p4_eval_C_of_A = models.IntegerField() p4_eval_C_of_B = models.IntegerField() p5_eval_A_of_B = models.IntegerField() p5_eval_A_of_C = models.IntegerField() p5_eval_B_of_A = models.IntegerField() p5_eval_B_of_C = models.IntegerField() p5_eval_C_of_A = models.IntegerField() p5_eval_C_of_B = models.IntegerField() p6_eval_A_of_B = models.IntegerField() p6_eval_A_of_C = models.IntegerField() p6_eval_B_of_A = models.IntegerField() p6_eval_B_of_C = models.IntegerField() p6_eval_C_of_A = models.IntegerField() p6_eval_C_of_B = models.IntegerField() p7_eval_A_of_B = models.IntegerField() p7_eval_A_of_C = models.IntegerField() p7_eval_B_of_A = models.IntegerField() p7_eval_B_of_C = models.IntegerField() p7_eval_C_of_A = models.IntegerField() p7_eval_C_of_B = models.IntegerField() p8_eval_A_of_B = models.IntegerField() p8_eval_A_of_C = models.IntegerField() p8_eval_B_of_A = models.IntegerField() p8_eval_B_of_C = models.IntegerField() p8_eval_C_of_A = models.IntegerField() p8_eval_C_of_B = models.IntegerField() p9_eval_A_of_B = models.IntegerField() p9_eval_A_of_C = models.IntegerField() p9_eval_B_of_A = models.IntegerField() p9_eval_B_of_C = models.IntegerField() p9_eval_C_of_A = models.IntegerField() p9_eval_C_of_B = models.IntegerField() # For managers, A can be the "self" fields for the employees p1_ind_bonus_penalty = models.IntegerField(default=0) p2_ind_bonus_penalty = models.IntegerField(default=0) p3_ind_bonus_penalty = models.IntegerField(default=0) p4_ind_bonus_penalty = models.IntegerField(default=0) p5_ind_bonus_penalty = models.IntegerField(default=0) p6_ind_bonus_penalty = models.IntegerField(default=0) p7_ind_bonus_penalty = models.IntegerField(default=0) p8_ind_bonus_penalty = models.IntegerField(default=0) p9_ind_bonus_penalty = models.IntegerField(default=0) p1_B_bonus_penalty = models.IntegerField(default=0) p2_B_bonus_penalty = models.IntegerField(default=0) p3_B_bonus_penalty = models.IntegerField(default=0) p4_B_bonus_penalty = models.IntegerField(default=0) p5_B_bonus_penalty = models.IntegerField(default=0) p6_B_bonus_penalty = models.IntegerField(default=0) p7_B_bonus_penalty = models.IntegerField(default=0) p8_B_bonus_penalty = models.IntegerField(default=0) p9_B_bonus_penalty = models.IntegerField(default=0) p1_C_bonus_penalty = models.IntegerField(default=0) p2_C_bonus_penalty = models.IntegerField(default=0) p3_C_bonus_penalty = models.IntegerField(default=0) p4_C_bonus_penalty = models.IntegerField(default=0) p5_C_bonus_penalty = models.IntegerField(default=0) p6_C_bonus_penalty = models.IntegerField(default=0) p7_C_bonus_penalty = models.IntegerField(default=0) p8_C_bonus_penalty = models.IntegerField(default=0) p9_C_bonus_penalty = models.IntegerField(default=0) p1_total_points = models.IntegerField(default=0) #Round up to next integer for Managers p2_total_points = models.IntegerField(default=0) p3_total_points = models.IntegerField(default=0) p4_total_points = models.IntegerField(default=0) p5_total_points = models.IntegerField(default=0) p6_total_points = models.IntegerField(default=0) p7_total_points = models.IntegerField(default=0) p8_total_points = models.IntegerField(default=0) p9_total_points = models.IntegerField(default=0) total_points = models.IntegerField(default=0) risk_attitude = models.StringField(initial=None, choices=[('1', "1 = I'm not at all willing to take risks."), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', "6 = I'm somewhat willing to take risks."), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', "11 = I'm very willing to take risks.")], verbose_name='') allocation_difficulty = models.StringField(initial=None, choices=[('1', '1 = Not at all difficult.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat difficult.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very difficult.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) allocation_stress = models.StringField(initial=None, choices=[('1', '1 = Not at all stressful.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat stressful.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very stressful.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) allocation_postpone = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) allocation_careful = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) responsible_for_comp = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_consistency = models.StringField(initial=None, choices=[('1', '1 = Not at all consistent.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat consistent.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very consistent.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) emp_comp_fairness = models.StringField(initial=None, choices=[('1', '1 = Not at all fair.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat fair.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very fair.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) own_comp_fairness = models.StringField(initial=None, choices=[('1', '1 = Not at all fair.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat fair.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very fair.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) target_difficulty = models.StringField(initial=None, choices=[('1', '1 = Not at all difficult.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat difficult.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very difficult.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) effect_lower_prod = models.StringField(initial=None, choices=[('1', '1 = I would have contributed many fewer points' ' than if my productivity were higher.'), ('2', '2 '), ('3', '3 '), ('4', '4 = I would have contributed the same points' ' as if my productivity were higher.'), ('5', '5 '), ('6', '6 '), ('7', '7 = I would have contributed many more points' ' than if my productivity were higher.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_basis = models.StringField(initial=None, choices=[('1', '1 = Peer evaluations were based ' 'entirely on the number of points contributed.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Peer evaluations were based on both' ' factors equally.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Peer evaluations were based entirely on the' ' effect on team output of individual ' 'contributions.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) inputs_observable = models.StringField(initial=None, choices=[('1', '1 = My allocations would have been based ' 'entirely on the number of points contributed.'), ('2', '2 '), ('3', '3 '), ('4', '4 = My allocations would have been based on both' ' factors equally.'), ('5', '5 '), ('6', '6 '), ('7', '7 = My allocations would have been based ' 'entirely on the ' 'effect on team output of individual ' 'contributions.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) equal_allocations_just = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) deserve_greater_comp = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) allocation_single_influence = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) allocation_unanimous = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) allocation_expl = models.StringField(verbose_name='') # Employees.... contribution_difficulty = models.StringField(initial=None, choices=[('1', '1 = Not at all difficult.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat difficult.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very difficult.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) evaluation_difficulty = models.StringField(initial=None, choices=[('1', '1 = Not at all difficult.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat difficult.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very difficult.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) productivity_fairness = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) bonus_penalty_fairness = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) total_comp_fairness = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) productivity_satisfaction = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) low_productivity_act = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_expectations = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) job_satisfaction = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) job_valued = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) like_comp_structure = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) happy_comp_structure = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) no_bonus_penalty_feeling = models.StringField(initial=None, choices=[('1', '1 = Very dissatisfied.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither satisfied nor dissatisfied.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very satisfied.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) bonus_penalty_feeling = models.StringField(initial=None, choices=[('1', '1 = Very dissatisfied.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither satisfied nor dissatisfied.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very satisfied.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) contract_preference = models.IntegerField(verbose_name='') peer_pressure = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_conscious = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) difference_unobservable = models.StringField(initial=None, choices=[('1', '1 = I would have contributed many fewer points toward' ' increasing team output.'), ('2', '2 '), ('3', '3 '), ('4', '4 = My decisions would have been no different.'), ('5', '5 '), ('6', '6 '), ('7', '7 = I would have contributed many more points toward' ' increasing team output.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) bonus_penalty_equality = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) manager_influence = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) teammate_predictability = models.StringField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat.'), ('5', '5 '), ('6', '6 '), ('7', '7 = To a great extent.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) teammate_norms = models.StringField(initial=None, choices=[('1', '1 = Not at all.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat.'), ('5', '5 '), ('6', '6 '), ('7', '7 = A great deal.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) teammate_target_effect = models.StringField(initial=None, choices=[('1', '1 = Not at all challenging.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Somewhat challenging.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Very challenging.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) self_interest_imp = models.StringField(initial=None, choices=[('1', '1 = My individual returns were much more important.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Both were equally important.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Helping the team reach its target output was much' ' more important.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) mgr_antic_influence = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_accuracy = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_cooperation = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_strategic = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) peer_eval_factors = models.StringField(initial=None, choices=[('1', '1 = Ratings were based much more on points contributions.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Both factors equally.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Ratings were based much more on individual ' 'output.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_id_1 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_id_2 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_id_3 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_id_4 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_id_5 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) group_id_6 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_1 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_2 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_3 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_4 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_5 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_6 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_7 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_8 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) narcissism_9 = models.StringField(initial=None, choices=[('1', '1 = Strongly disagree.'), ('2', '2 '), ('3', '3 '), ('4', '4 = Neither agree nor disagree.'), ('5', '5 '), ('6', '6 '), ('7', '7 = Strongly agree.')], verbose_name='', widget=widgets.RadioSelectHorizontal()) gender = models.StringField(initial=None, choices=[('a', 'Male'), ('b', 'Female'), ('c', 'Non-binary'), ('d', 'Other'), ('e', 'Prefer not to answer')], verbose_name='', widget=widgets.RadioSelect()) age = models.IntegerField(verbose_name='', min=18, max=110) work_experience = models.IntegerField(verbose_name='', min=0) major = models.StringField(verbose_name='') gpa = models.FloatField(verbose_name='', min=0.00, max=4.00) pay_method = models.StringField(initial=None, choices=[('a', 'Receive cash.'), ('b', 'Receive electronically via CashApp.'), ('c', 'Receive electronically via Venmo.'), ('d', 'Receive electronically via PayPal.')], verbose_name='', widget=widgets.RadioSelect()) pay_id = models.StringField(verbose_name='') email = models.StringField(verbose_name='') first_name = models.StringField(verbose_name='') last_name = models.StringField(verbose_name='') referring_prof = models.StringField(verbose_name='') points_compensation = models.StringField() total_compensation = models.StringField() #FUNCTIONS def creating_session(subsession): session = subsession.session for player in subsession.get_players(): player.condition = session.config['condition'] player.participant.label = 'e' # PAGES class IC(Page): form_model = 'player' form_fields = ['informed_consent'] #def before_next_page(player, timeout_happened): # See if that worker ID already appears in players, in which case they at least started the experiment #if player.participant.label != 'e': # worker_match = [w for w in OnlineWorkers.filter() if (w.worker_id == player.participant.label)] # if not worker_match: # OnlineWorkers.create(worker_id=player.participant.label) # player.worker_id = player.participant.label # else: # player.mturk_dupe = 1 class IC_Decline(Page): @staticmethod def is_displayed(player: Player): return player.informed_consent == "No" class DuplicateWorker(Page): @staticmethod def is_displayed(player: Player): return player.mturk_dupe == 1 class GenInstructions(Page): pass class TaskInstructions1(Page): pass class TaskInstructions2(Page): pass class PerfEval(Page): pass class Compensation(Page): pass class KnowledgeCheck(Page): form_model = 'player' form_fields = ['kc1', 'kc2', 'kc3', 'kc4', 'kc5', 'kc6', 'kc7', 'kc8', 'kc9', 'kc10', 'kc11'] class P1Contribution(Page): form_model = 'player' form_fields = ['p1_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P2Contribution(Page): form_model = 'player' form_fields = ['p2_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P3Contribution(Page): form_model = 'player' form_fields = ['p3_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P4Contribution(Page): form_model = 'player' form_fields = ['p4_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P5Contribution(Page): form_model = 'player' form_fields = ['p5_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P6Contribution(Page): form_model = 'player' form_fields = ['p6_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P7Contribution(Page): form_model = 'player' form_fields = ['p7_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P8Contribution(Page): form_model = 'player' form_fields = ['p8_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P9Contribution(Page): form_model = 'player' form_fields = ['p9_contribution'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class GroupWait1(WaitPage): body_text = ("Please wait briefly while others reach this point. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) if p1.condition == 1 or p1.condition == 2: single_task_productivity = [5, 7, 9] random.shuffle(single_task_productivity) p1.p1_productivity = single_task_productivity[0] p1.p2_productivity = single_task_productivity[0] p1.p3_productivity = single_task_productivity[0] p1.p4_productivity = single_task_productivity[0] p1.p5_productivity = single_task_productivity[0] p1.p6_productivity = single_task_productivity[0] p1.p7_productivity = single_task_productivity[0] p1.p8_productivity = single_task_productivity[0] p1.p9_productivity = single_task_productivity[0] p1.p1_B_productivity = single_task_productivity[1] p1.p2_B_productivity = single_task_productivity[1] p1.p3_B_productivity = single_task_productivity[1] p1.p4_B_productivity = single_task_productivity[1] p1.p5_B_productivity = single_task_productivity[1] p1.p6_B_productivity = single_task_productivity[1] p1.p7_B_productivity = single_task_productivity[1] p1.p8_B_productivity = single_task_productivity[1] p1.p9_B_productivity = single_task_productivity[1] p1.p1_C_productivity = single_task_productivity[2] p1.p2_C_productivity = single_task_productivity[2] p1.p3_C_productivity = single_task_productivity[2] p1.p4_C_productivity = single_task_productivity[2] p1.p5_C_productivity = single_task_productivity[2] p1.p6_C_productivity = single_task_productivity[2] p1.p7_C_productivity = single_task_productivity[2] p1.p8_C_productivity = single_task_productivity[2] p1.p9_C_productivity = single_task_productivity[2] p2.p1_productivity = single_task_productivity[1] p2.p2_productivity = single_task_productivity[1] p2.p3_productivity = single_task_productivity[1] p2.p4_productivity = single_task_productivity[1] p2.p5_productivity = single_task_productivity[1] p2.p6_productivity = single_task_productivity[1] p2.p7_productivity = single_task_productivity[1] p2.p8_productivity = single_task_productivity[1] p2.p9_productivity = single_task_productivity[1] p2.p1_B_productivity = single_task_productivity[0] p2.p2_B_productivity = single_task_productivity[0] p2.p3_B_productivity = single_task_productivity[0] p2.p4_B_productivity = single_task_productivity[0] p2.p5_B_productivity = single_task_productivity[0] p2.p6_B_productivity = single_task_productivity[0] p2.p7_B_productivity = single_task_productivity[0] p2.p8_B_productivity = single_task_productivity[0] p2.p9_B_productivity = single_task_productivity[0] p2.p1_C_productivity = single_task_productivity[2] p2.p2_C_productivity = single_task_productivity[2] p2.p3_C_productivity = single_task_productivity[2] p2.p4_C_productivity = single_task_productivity[2] p2.p5_C_productivity = single_task_productivity[2] p2.p6_C_productivity = single_task_productivity[2] p2.p7_C_productivity = single_task_productivity[2] p2.p8_C_productivity = single_task_productivity[2] p2.p9_C_productivity = single_task_productivity[2] p3.p1_productivity = single_task_productivity[2] p3.p2_productivity = single_task_productivity[2] p3.p3_productivity = single_task_productivity[2] p3.p4_productivity = single_task_productivity[2] p3.p5_productivity = single_task_productivity[2] p3.p6_productivity = single_task_productivity[2] p3.p7_productivity = single_task_productivity[2] p3.p8_productivity = single_task_productivity[2] p3.p9_productivity = single_task_productivity[2] p3.p1_B_productivity = single_task_productivity[0] p3.p2_B_productivity = single_task_productivity[0] p3.p3_B_productivity = single_task_productivity[0] p3.p4_B_productivity = single_task_productivity[0] p3.p5_B_productivity = single_task_productivity[0] p3.p6_B_productivity = single_task_productivity[0] p3.p7_B_productivity = single_task_productivity[0] p3.p8_B_productivity = single_task_productivity[0] p3.p9_B_productivity = single_task_productivity[0] p3.p1_C_productivity = single_task_productivity[1] p3.p2_C_productivity = single_task_productivity[1] p3.p3_C_productivity = single_task_productivity[1] p3.p4_C_productivity = single_task_productivity[1] p3.p5_C_productivity = single_task_productivity[1] p3.p6_C_productivity = single_task_productivity[1] p3.p7_C_productivity = single_task_productivity[1] p3.p8_C_productivity = single_task_productivity[1] p3.p9_C_productivity = single_task_productivity[1] p4.p1_productivity = single_task_productivity[0] p4.p2_productivity = single_task_productivity[0] p4.p3_productivity = single_task_productivity[0] p4.p4_productivity = single_task_productivity[0] p4.p5_productivity = single_task_productivity[0] p4.p6_productivity = single_task_productivity[0] p4.p7_productivity = single_task_productivity[0] p4.p8_productivity = single_task_productivity[0] p4.p9_productivity = single_task_productivity[0] p4.p1_B_productivity = single_task_productivity[1] p4.p2_B_productivity = single_task_productivity[1] p4.p3_B_productivity = single_task_productivity[1] p4.p4_B_productivity = single_task_productivity[1] p4.p5_B_productivity = single_task_productivity[1] p4.p6_B_productivity = single_task_productivity[1] p4.p7_B_productivity = single_task_productivity[1] p4.p8_B_productivity = single_task_productivity[1] p4.p9_B_productivity = single_task_productivity[1] p4.p1_C_productivity = single_task_productivity[2] p4.p2_C_productivity = single_task_productivity[2] p4.p3_C_productivity = single_task_productivity[2] p4.p4_C_productivity = single_task_productivity[2] p4.p5_C_productivity = single_task_productivity[2] p4.p6_C_productivity = single_task_productivity[2] p4.p7_C_productivity = single_task_productivity[2] p4.p8_C_productivity = single_task_productivity[2] p4.p9_C_productivity = single_task_productivity[2] elif p1.condition == 3 or p1.condition == 4: # Each employee has each productivity rate in each set of 3 periods, so... multi_task_productivity_1 = [[5, 7, 9], [7, 9, 5], [9, 5, 7]] multi_task_productivity_2 = [[5, 7, 9], [7, 9, 5], [9, 5, 7]] multi_task_productivity_3 = [[5, 7, 9], [7, 9, 5], [9, 5, 7]] # ...shuffle each set of 3 and then just set P1 to the first in each, P2 to the second, P3 to the third random.shuffle(multi_task_productivity_1) random.shuffle(multi_task_productivity_2) random.shuffle(multi_task_productivity_3) p1.p1_productivity = multi_task_productivity_1[0][0] p1.p2_productivity = multi_task_productivity_1[1][0] p1.p3_productivity = multi_task_productivity_1[2][0] p1.p4_productivity = multi_task_productivity_2[0][0] p1.p5_productivity = multi_task_productivity_2[1][0] p1.p6_productivity = multi_task_productivity_2[2][0] p1.p7_productivity = multi_task_productivity_3[0][0] p1.p8_productivity = multi_task_productivity_3[1][0] p1.p9_productivity = multi_task_productivity_3[2][0] p1.p1_B_productivity = multi_task_productivity_1[0][1] p1.p2_B_productivity = multi_task_productivity_1[1][1] p1.p3_B_productivity = multi_task_productivity_1[2][1] p1.p4_B_productivity = multi_task_productivity_2[0][1] p1.p5_B_productivity = multi_task_productivity_2[1][1] p1.p6_B_productivity = multi_task_productivity_2[2][1] p1.p7_B_productivity = multi_task_productivity_3[0][1] p1.p8_B_productivity = multi_task_productivity_3[1][1] p1.p9_B_productivity = multi_task_productivity_3[2][1] p1.p1_C_productivity = multi_task_productivity_1[0][2] p1.p2_C_productivity = multi_task_productivity_1[1][2] p1.p3_C_productivity = multi_task_productivity_1[2][2] p1.p4_C_productivity = multi_task_productivity_2[0][2] p1.p5_C_productivity = multi_task_productivity_2[1][2] p1.p6_C_productivity = multi_task_productivity_2[2][2] p1.p7_C_productivity = multi_task_productivity_3[0][2] p1.p8_C_productivity = multi_task_productivity_3[1][2] p1.p9_C_productivity = multi_task_productivity_3[2][2] p2.p1_productivity = multi_task_productivity_1[0][1] p2.p2_productivity = multi_task_productivity_1[1][1] p2.p3_productivity = multi_task_productivity_1[2][1] p2.p4_productivity = multi_task_productivity_2[0][1] p2.p5_productivity = multi_task_productivity_2[1][1] p2.p6_productivity = multi_task_productivity_2[2][1] p2.p7_productivity = multi_task_productivity_3[0][1] p2.p8_productivity = multi_task_productivity_3[1][1] p2.p9_productivity = multi_task_productivity_3[2][1] p2.p1_B_productivity = multi_task_productivity_1[0][0] p2.p2_B_productivity = multi_task_productivity_1[1][0] p2.p3_B_productivity = multi_task_productivity_1[2][0] p2.p4_B_productivity = multi_task_productivity_2[0][0] p2.p5_B_productivity = multi_task_productivity_2[1][0] p2.p6_B_productivity = multi_task_productivity_2[2][0] p2.p7_B_productivity = multi_task_productivity_3[0][0] p2.p8_B_productivity = multi_task_productivity_3[1][0] p2.p9_B_productivity = multi_task_productivity_3[2][0] p2.p1_C_productivity = multi_task_productivity_1[0][2] p2.p2_C_productivity = multi_task_productivity_1[1][2] p2.p3_C_productivity = multi_task_productivity_1[2][2] p2.p4_C_productivity = multi_task_productivity_2[0][2] p2.p5_C_productivity = multi_task_productivity_2[1][2] p2.p6_C_productivity = multi_task_productivity_2[2][2] p2.p7_C_productivity = multi_task_productivity_3[0][2] p2.p8_C_productivity = multi_task_productivity_3[1][2] p2.p9_C_productivity = multi_task_productivity_3[2][2] p3.p1_productivity = multi_task_productivity_1[0][2] p3.p2_productivity = multi_task_productivity_1[1][2] p3.p3_productivity = multi_task_productivity_1[2][2] p3.p4_productivity = multi_task_productivity_2[0][2] p3.p5_productivity = multi_task_productivity_2[1][2] p3.p6_productivity = multi_task_productivity_2[2][2] p3.p7_productivity = multi_task_productivity_3[0][2] p3.p8_productivity = multi_task_productivity_3[1][2] p3.p9_productivity = multi_task_productivity_3[2][2] p3.p1_B_productivity = multi_task_productivity_1[0][0] p3.p2_B_productivity = multi_task_productivity_1[1][0] p3.p3_B_productivity = multi_task_productivity_1[2][0] p3.p4_B_productivity = multi_task_productivity_2[0][0] p3.p5_B_productivity = multi_task_productivity_2[1][0] p3.p6_B_productivity = multi_task_productivity_2[2][0] p3.p7_B_productivity = multi_task_productivity_3[0][0] p3.p8_B_productivity = multi_task_productivity_3[1][0] p3.p9_B_productivity = multi_task_productivity_3[2][0] p3.p1_C_productivity = multi_task_productivity_1[0][1] p3.p2_C_productivity = multi_task_productivity_1[1][1] p3.p3_C_productivity = multi_task_productivity_1[2][1] p3.p4_C_productivity = multi_task_productivity_2[0][1] p3.p5_C_productivity = multi_task_productivity_2[1][1] p3.p6_C_productivity = multi_task_productivity_2[2][1] p3.p7_C_productivity = multi_task_productivity_3[0][1] p3.p8_C_productivity = multi_task_productivity_3[1][1] p3.p9_C_productivity = multi_task_productivity_3[2][1] # Might as well update the manager's record, even though they don't get this info. p4.p1_productivity = multi_task_productivity_1[0][0] p4.p2_productivity = multi_task_productivity_1[1][0] p4.p3_productivity = multi_task_productivity_1[2][0] p4.p4_productivity = multi_task_productivity_2[0][0] p4.p5_productivity = multi_task_productivity_2[1][0] p4.p6_productivity = multi_task_productivity_2[2][0] p4.p7_productivity = multi_task_productivity_3[0][0] p4.p8_productivity = multi_task_productivity_3[1][0] p4.p9_productivity = multi_task_productivity_3[2][0] p4.p1_B_productivity = multi_task_productivity_1[0][1] p4.p2_B_productivity = multi_task_productivity_1[1][1] p4.p3_B_productivity = multi_task_productivity_1[2][1] p4.p4_B_productivity = multi_task_productivity_2[0][1] p4.p5_B_productivity = multi_task_productivity_2[1][1] p4.p6_B_productivity = multi_task_productivity_2[2][1] p4.p7_B_productivity = multi_task_productivity_3[0][1] p4.p8_B_productivity = multi_task_productivity_3[1][1] p4.p9_B_productivity = multi_task_productivity_3[2][1] p4.p1_C_productivity = multi_task_productivity_1[0][2] p4.p2_C_productivity = multi_task_productivity_1[1][2] p4.p3_C_productivity = multi_task_productivity_1[2][2] p4.p4_C_productivity = multi_task_productivity_2[0][2] p4.p5_C_productivity = multi_task_productivity_2[1][2] p4.p6_C_productivity = multi_task_productivity_2[2][2] p4.p7_C_productivity = multi_task_productivity_3[0][2] p4.p8_C_productivity = multi_task_productivity_3[1][2] p4.p9_C_productivity = multi_task_productivity_3[2][2] class GroupWaitC1(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p1_output = p1.p1_contribution * p1.p1_productivity p2.p1_output = p2.p1_contribution * p2.p1_productivity p3.p1_output = p3.p1_contribution * p3.p1_productivity # Update teammate's output for each employee p1.p1_B_output = p2.p1_output p1.p1_C_output = p3.p1_output p2.p1_B_output = p1.p1_output p2.p1_C_output = p3.p1_output p3.p1_B_output = p1.p1_output p3.p1_C_output = p2.p1_output p4.p1_output = p1.p1_output p4.p1_B_output = p2.p1_output p4.p1_C_output = p3.p1_output # Same for contributions p1.p1_B_contribution = p2.p1_contribution p1.p1_C_contribution = p3.p1_contribution p2.p1_B_contribution = p1.p1_contribution p2.p1_C_contribution = p3.p1_contribution p3.p1_B_contribution = p1.p1_contribution p3.p1_C_contribution = p2.p1_contribution # Want total team contributions so it's not calculated on the fly p1.p1_team_contributions = p1.p1_contribution + p1.p1_B_contribution + p1.p1_C_contribution p2.p1_team_contributions = p1.p1_team_contributions p3.p1_team_contributions = p1.p1_team_contributions p4.p1_team_contributions = p1.p1_team_contributions # Same for team output p1.p1_team_output = p1.p1_output + p2.p1_output + p3.p1_output p2.p1_team_output = p1.p1_team_output p3.p1_team_output = p1.p1_team_output p4.p1_team_output = p1.p1_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p1_team_output >= 300: p1.p1_team_bonus_penalty = 90 p2.p1_team_bonus_penalty = 90 p3.p1_team_bonus_penalty = 90 p4.p1_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p1_team_output < 300: p1.p1_team_bonus_penalty = 90 p2.p1_team_bonus_penalty = 90 p3.p1_team_bonus_penalty = 90 p4.p1_team_bonus_penalty = 90 class GroupWaitC2(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p2_output = p1.p2_contribution * p1.p2_productivity p2.p2_output = p2.p2_contribution * p2.p2_productivity p3.p2_output = p3.p2_contribution * p3.p2_productivity # Update teammate's output for each employee p1.p2_B_output = p2.p2_output p1.p2_C_output = p3.p2_output p2.p2_B_output = p1.p2_output p2.p2_C_output = p3.p2_output p3.p2_B_output = p1.p2_output p3.p2_C_output = p2.p2_output p4.p2_output = p1.p2_output p4.p2_B_output = p2.p2_output p4.p2_C_output = p3.p2_output # Same for contributions p1.p2_B_contribution = p2.p2_contribution p1.p2_C_contribution = p3.p2_contribution p2.p2_B_contribution = p1.p2_contribution p2.p2_C_contribution = p3.p2_contribution p3.p2_B_contribution = p1.p2_contribution p3.p2_C_contribution = p2.p2_contribution # Want total team contributions so it's not calculated on the fly p1.p2_team_contributions = p1.p2_contribution + p1.p2_B_contribution + p1.p2_C_contribution p2.p2_team_contributions = p1.p2_team_contributions p3.p2_team_contributions = p1.p2_team_contributions p4.p2_team_contributions = p1.p2_team_contributions # Same for team output p1.p2_team_output = p1.p2_output + p2.p2_output + p3.p2_output p2.p2_team_output = p1.p2_team_output p3.p2_team_output = p1.p2_team_output p4.p2_team_output = p1.p2_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p2_team_output >= 300: p1.p2_team_bonus_penalty = 90 p2.p2_team_bonus_penalty = 90 p3.p2_team_bonus_penalty = 90 p4.p2_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p2_team_output < 300: p1.p2_team_bonus_penalty = 90 p2.p2_team_bonus_penalty = 90 p3.p2_team_bonus_penalty = 90 p4.p2_team_bonus_penalty = 90 class GroupWaitC3(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p3_output = p1.p3_contribution * p1.p3_productivity p2.p3_output = p2.p3_contribution * p2.p3_productivity p3.p3_output = p3.p3_contribution * p3.p3_productivity # Update teammate's output for each employee p1.p3_B_output = p2.p3_output p1.p3_C_output = p3.p3_output p2.p3_B_output = p1.p3_output p2.p3_C_output = p3.p3_output p3.p3_B_output = p1.p3_output p3.p3_C_output = p2.p3_output p4.p3_output = p1.p3_output p4.p3_B_output = p2.p3_output p4.p3_C_output = p3.p3_output # Same for contributions p1.p3_B_contribution = p2.p3_contribution p1.p3_C_contribution = p3.p3_contribution p2.p3_B_contribution = p1.p3_contribution p2.p3_C_contribution = p3.p3_contribution p3.p3_B_contribution = p1.p3_contribution p3.p3_C_contribution = p2.p3_contribution # Want total team contributions so it's not calculated on the fly p1.p3_team_contributions = p1.p3_contribution + p1.p3_B_contribution + p1.p3_C_contribution p2.p3_team_contributions = p1.p3_team_contributions p3.p3_team_contributions = p1.p3_team_contributions p4.p3_team_contributions = p1.p3_team_contributions # Same for team output p1.p3_team_output = p1.p3_output + p2.p3_output + p3.p3_output p2.p3_team_output = p1.p3_team_output p3.p3_team_output = p1.p3_team_output p4.p3_team_output = p1.p3_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p3_team_output >= 300: p1.p3_team_bonus_penalty = 90 p2.p3_team_bonus_penalty = 90 p3.p3_team_bonus_penalty = 90 p4.p3_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p3_team_output < 300: p1.p3_team_bonus_penalty = 90 p2.p3_team_bonus_penalty = 90 p3.p3_team_bonus_penalty = 90 p4.p3_team_bonus_penalty = 90 class GroupWaitC4(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p4_output = p1.p4_contribution * p1.p4_productivity p2.p4_output = p2.p4_contribution * p2.p4_productivity p3.p4_output = p3.p4_contribution * p3.p4_productivity # Update teammate's output for each employee p1.p4_B_output = p2.p4_output p1.p4_C_output = p3.p4_output p2.p4_B_output = p1.p4_output p2.p4_C_output = p3.p4_output p3.p4_B_output = p1.p4_output p3.p4_C_output = p2.p4_output p4.p4_output = p1.p4_output p4.p4_B_output = p2.p4_output p4.p4_C_output = p3.p4_output # Same for contributions p1.p4_B_contribution = p2.p4_contribution p1.p4_C_contribution = p3.p4_contribution p2.p4_B_contribution = p1.p4_contribution p2.p4_C_contribution = p3.p4_contribution p3.p4_B_contribution = p1.p4_contribution p3.p4_C_contribution = p2.p4_contribution # Want total team contributions so it's not calculated on the fly p1.p4_team_contributions = p1.p4_contribution + p1.p4_B_contribution + p1.p4_C_contribution p2.p4_team_contributions = p1.p4_team_contributions p3.p4_team_contributions = p1.p4_team_contributions p4.p4_team_contributions = p1.p4_team_contributions # Same for team output p1.p4_team_output = p1.p4_output + p2.p4_output + p3.p4_output p2.p4_team_output = p1.p4_team_output p3.p4_team_output = p1.p4_team_output p4.p4_team_output = p1.p4_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p4_team_output >= 300: p1.p4_team_bonus_penalty = 90 p2.p4_team_bonus_penalty = 90 p3.p4_team_bonus_penalty = 90 p4.p4_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p4_team_output < 300: p1.p4_team_bonus_penalty = 90 p2.p4_team_bonus_penalty = 90 p3.p4_team_bonus_penalty = 90 p4.p4_team_bonus_penalty = 90 class GroupWaitC5(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p5_output = p1.p5_contribution * p1.p5_productivity p2.p5_output = p2.p5_contribution * p2.p5_productivity p3.p5_output = p3.p5_contribution * p3.p5_productivity # Update teammate's output for each employee p1.p5_B_output = p2.p5_output p1.p5_C_output = p3.p5_output p2.p5_B_output = p1.p5_output p2.p5_C_output = p3.p5_output p3.p5_B_output = p1.p5_output p3.p5_C_output = p2.p5_output p4.p5_output = p1.p5_output p4.p5_B_output = p2.p5_output p4.p5_C_output = p3.p5_output # Same for contributions p1.p5_B_contribution = p2.p5_contribution p1.p5_C_contribution = p3.p5_contribution p2.p5_B_contribution = p1.p5_contribution p2.p5_C_contribution = p3.p5_contribution p3.p5_B_contribution = p1.p5_contribution p3.p5_C_contribution = p2.p5_contribution # Want total team contributions so it's not calculated on the fly p1.p5_team_contributions = p1.p5_contribution + p1.p5_B_contribution + p1.p5_C_contribution p2.p5_team_contributions = p1.p5_team_contributions p3.p5_team_contributions = p1.p5_team_contributions p4.p5_team_contributions = p1.p5_team_contributions # Same for team output p1.p5_team_output = p1.p5_output + p2.p5_output + p3.p5_output p2.p5_team_output = p1.p5_team_output p3.p5_team_output = p1.p5_team_output p4.p5_team_output = p1.p5_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p5_team_output >= 300: p1.p5_team_bonus_penalty = 90 p2.p5_team_bonus_penalty = 90 p3.p5_team_bonus_penalty = 90 p4.p5_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p5_team_output < 300: p1.p5_team_bonus_penalty = 90 p2.p5_team_bonus_penalty = 90 p3.p5_team_bonus_penalty = 90 p4.p5_team_bonus_penalty = 90 class GroupWaitC6(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p6_output = p1.p6_contribution * p1.p6_productivity p2.p6_output = p2.p6_contribution * p2.p6_productivity p3.p6_output = p3.p6_contribution * p3.p6_productivity # Update teammate's output for each employee p1.p6_B_output = p2.p6_output p1.p6_C_output = p3.p6_output p2.p6_B_output = p1.p6_output p2.p6_C_output = p3.p6_output p3.p6_B_output = p1.p6_output p3.p6_C_output = p2.p6_output p4.p6_output = p1.p6_output p4.p6_B_output = p2.p6_output p4.p6_C_output = p3.p6_output # Same for contributions p1.p6_B_contribution = p2.p6_contribution p1.p6_C_contribution = p3.p6_contribution p2.p6_B_contribution = p1.p6_contribution p2.p6_C_contribution = p3.p6_contribution p3.p6_B_contribution = p1.p6_contribution p3.p6_C_contribution = p2.p6_contribution # Want total team contributions so it's not calculated on the fly p1.p6_team_contributions = p1.p6_contribution + p1.p6_B_contribution + p1.p6_C_contribution p2.p6_team_contributions = p1.p6_team_contributions p3.p6_team_contributions = p1.p6_team_contributions p4.p6_team_contributions = p1.p6_team_contributions # Same for team output p1.p6_team_output = p1.p6_output + p2.p6_output + p3.p6_output p2.p6_team_output = p1.p6_team_output p3.p6_team_output = p1.p6_team_output p4.p6_team_output = p1.p6_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p6_team_output >= 300: p1.p6_team_bonus_penalty = 90 p2.p6_team_bonus_penalty = 90 p3.p6_team_bonus_penalty = 90 p4.p6_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p6_team_output < 300: p1.p6_team_bonus_penalty = 90 p2.p6_team_bonus_penalty = 90 p3.p6_team_bonus_penalty = 90 p4.p6_team_bonus_penalty = 90 class GroupWaitC7(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p7_output = p1.p7_contribution * p1.p7_productivity p2.p7_output = p2.p7_contribution * p2.p7_productivity p3.p7_output = p3.p7_contribution * p3.p7_productivity # Update teammate's output for each employee p1.p7_B_output = p2.p7_output p1.p7_C_output = p3.p7_output p2.p7_B_output = p1.p7_output p2.p7_C_output = p3.p7_output p3.p7_B_output = p1.p7_output p3.p7_C_output = p2.p7_output p4.p7_output = p1.p7_output p4.p7_B_output = p2.p7_output p4.p7_C_output = p3.p7_output # Same for contributions p1.p7_B_contribution = p2.p7_contribution p1.p7_C_contribution = p3.p7_contribution p2.p7_B_contribution = p1.p7_contribution p2.p7_C_contribution = p3.p7_contribution p3.p7_B_contribution = p1.p7_contribution p3.p7_C_contribution = p2.p7_contribution # Want total team contributions so it's not calculated on the fly p1.p7_team_contributions = p1.p7_contribution + p1.p7_B_contribution + p1.p7_C_contribution p2.p7_team_contributions = p1.p7_team_contributions p3.p7_team_contributions = p1.p7_team_contributions p4.p7_team_contributions = p1.p7_team_contributions # Same for team output p1.p7_team_output = p1.p7_output + p2.p7_output + p3.p7_output p2.p7_team_output = p1.p7_team_output p3.p7_team_output = p1.p7_team_output p4.p7_team_output = p1.p7_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p7_team_output >= 300: p1.p7_team_bonus_penalty = 90 p2.p7_team_bonus_penalty = 90 p3.p7_team_bonus_penalty = 90 p4.p7_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p7_team_output < 300: p1.p7_team_bonus_penalty = 90 p2.p7_team_bonus_penalty = 90 p3.p7_team_bonus_penalty = 90 p4.p7_team_bonus_penalty = 90 class GroupWaitC8(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p8_output = p1.p8_contribution * p1.p8_productivity p2.p8_output = p2.p8_contribution * p2.p8_productivity p3.p8_output = p3.p8_contribution * p3.p8_productivity # Update teammate's output for each employee p1.p8_B_output = p2.p8_output p1.p8_C_output = p3.p8_output p2.p8_B_output = p1.p8_output p2.p8_C_output = p3.p8_output p3.p8_B_output = p1.p8_output p3.p8_C_output = p2.p8_output p4.p8_output = p1.p8_output p4.p8_B_output = p2.p8_output p4.p8_C_output = p3.p8_output # Same for contributions p1.p8_B_contribution = p2.p8_contribution p1.p8_C_contribution = p3.p8_contribution p2.p8_B_contribution = p1.p8_contribution p2.p8_C_contribution = p3.p8_contribution p3.p8_B_contribution = p1.p8_contribution p3.p8_C_contribution = p2.p8_contribution # Want total team contributions so it's not calculated on the fly p1.p8_team_contributions = p1.p8_contribution + p1.p8_B_contribution + p1.p8_C_contribution p2.p8_team_contributions = p1.p8_team_contributions p3.p8_team_contributions = p1.p8_team_contributions p4.p8_team_contributions = p1.p8_team_contributions # Same for team output p1.p8_team_output = p1.p8_output + p2.p8_output + p3.p8_output p2.p8_team_output = p1.p8_team_output p3.p8_team_output = p1.p8_team_output p4.p8_team_output = p1.p8_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p8_team_output >= 300: p1.p8_team_bonus_penalty = 90 p2.p8_team_bonus_penalty = 90 p3.p8_team_bonus_penalty = 90 p4.p8_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p8_team_output < 300: p1.p8_team_bonus_penalty = 90 p2.p8_team_bonus_penalty = 90 p3.p8_team_bonus_penalty = 90 p4.p8_team_bonus_penalty = 90 class GroupWaitC9(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Each employee's output is just their contribution times their productivity rate p1.p9_output = p1.p9_contribution * p1.p9_productivity p2.p9_output = p2.p9_contribution * p2.p9_productivity p3.p9_output = p3.p9_contribution * p3.p9_productivity # Update teammate's output for each employee p1.p9_B_output = p2.p9_output p1.p9_C_output = p3.p9_output p2.p9_B_output = p1.p9_output p2.p9_C_output = p3.p9_output p3.p9_B_output = p1.p9_output p3.p9_C_output = p2.p9_output p4.p9_output = p1.p9_output p4.p9_B_output = p2.p9_output p4.p9_C_output = p3.p9_output # Same for contributions p1.p9_B_contribution = p2.p9_contribution p1.p9_C_contribution = p3.p9_contribution p2.p9_B_contribution = p1.p9_contribution p2.p9_C_contribution = p3.p9_contribution p3.p9_B_contribution = p1.p9_contribution p3.p9_C_contribution = p2.p9_contribution # Want total team contributions so it's not calculated on the fly p1.p9_team_contributions = p1.p9_contribution + p1.p9_B_contribution + p1.p9_C_contribution p2.p9_team_contributions = p1.p9_team_contributions p3.p9_team_contributions = p1.p9_team_contributions p4.p9_team_contributions = p1.p9_team_contributions # Same for team output p1.p9_team_output = p1.p9_output + p2.p9_output + p3.p9_output p2.p9_team_output = p1.p9_team_output p3.p9_team_output = p1.p9_team_output p4.p9_team_output = p1.p9_team_output # Determine if the bonus or penalty applies, and update for everyone, including manager if p1.condition == 1 or p1.condition == 3: if p1.p9_team_output >= 300: p1.p9_team_bonus_penalty = 90 p2.p9_team_bonus_penalty = 90 p3.p9_team_bonus_penalty = 90 p4.p9_team_bonus_penalty = 90 elif p1.condition == 2 or p1.condition == 4: if p1.p9_team_output < 300: p1.p9_team_bonus_penalty = 90 p2.p9_team_bonus_penalty = 90 p3.p9_team_bonus_penalty = 90 p4.p9_team_bonus_penalty = 90 class GroupWaitP1(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p1_eval_A_of_B = p1.p1_eval_B p4.p1_eval_A_of_C = p1.p1_eval_C p4.p1_eval_B_of_A = p2.p1_eval_B p4.p1_eval_B_of_C = p2.p1_eval_C p4.p1_eval_C_of_A = p3.p1_eval_B p4.p1_eval_C_of_B = p3.p1_eval_C # Also their comp... p4.p1_total_points = 15 + math.ceil((p4.p1_team_output / 10)) # Update employees' records p1.p1_eval_from_B = p2.p1_eval_B p1.p1_eval_from_C = p3.p1_eval_B p2.p1_eval_from_B = p1.p1_eval_B p2.p1_eval_from_C = p3.p1_eval_C p3.p1_eval_from_B = p1.p1_eval_C p3.p1_eval_from_C = p2.p1_eval_C class GroupWaitP2(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p2_eval_A_of_B = p1.p2_eval_B p4.p2_eval_A_of_C = p1.p2_eval_C p4.p2_eval_B_of_A = p2.p2_eval_B p4.p2_eval_B_of_C = p2.p2_eval_C p4.p2_eval_C_of_A = p3.p2_eval_B p4.p2_eval_C_of_B = p3.p2_eval_C # Also their comp... p4.p2_total_points = 15 + math.ceil((p4.p2_team_output / 10)) # Update employees' records p1.p2_eval_from_B = p2.p2_eval_B p1.p2_eval_from_C = p3.p2_eval_B p2.p2_eval_from_B = p1.p2_eval_B p2.p2_eval_from_C = p3.p2_eval_C p3.p2_eval_from_B = p1.p2_eval_C p3.p2_eval_from_C = p2.p2_eval_C class GroupWaitP3(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p3_eval_A_of_B = p1.p3_eval_B p4.p3_eval_A_of_C = p1.p3_eval_C p4.p3_eval_B_of_A = p2.p3_eval_B p4.p3_eval_B_of_C = p2.p3_eval_C p4.p3_eval_C_of_A = p3.p3_eval_B p4.p3_eval_C_of_B = p3.p3_eval_C # Also their comp... p4.p3_total_points = 15 + math.ceil((p4.p3_team_output / 10)) # Update employees' records p1.p3_eval_from_B = p2.p3_eval_B p1.p3_eval_from_C = p3.p3_eval_B p2.p3_eval_from_B = p1.p3_eval_B p2.p3_eval_from_C = p3.p3_eval_C p3.p3_eval_from_B = p1.p3_eval_C p3.p3_eval_from_C = p2.p3_eval_C class GroupWaitP4(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p4_eval_A_of_B = p1.p4_eval_B p4.p4_eval_A_of_C = p1.p4_eval_C p4.p4_eval_B_of_A = p2.p4_eval_B p4.p4_eval_B_of_C = p2.p4_eval_C p4.p4_eval_C_of_A = p3.p4_eval_B p4.p4_eval_C_of_B = p3.p4_eval_C # Also their comp... p4.p4_total_points = 15 + math.ceil((p4.p4_team_output / 10)) # Update employees' records p1.p4_eval_from_B = p2.p4_eval_B p1.p4_eval_from_C = p3.p4_eval_B p2.p4_eval_from_B = p1.p4_eval_B p2.p4_eval_from_C = p3.p4_eval_C p3.p4_eval_from_B = p1.p4_eval_C p3.p4_eval_from_C = p2.p4_eval_C class GroupWaitP5(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p5_eval_A_of_B = p1.p5_eval_B p4.p5_eval_A_of_C = p1.p5_eval_C p4.p5_eval_B_of_A = p2.p5_eval_B p4.p5_eval_B_of_C = p2.p5_eval_C p4.p5_eval_C_of_A = p3.p5_eval_B p4.p5_eval_C_of_B = p3.p5_eval_C # Also their comp... p4.p5_total_points = 15 + math.ceil((p4.p5_team_output / 10)) # Update employees' records p1.p5_eval_from_B = p2.p5_eval_B p1.p5_eval_from_C = p3.p5_eval_B p2.p5_eval_from_B = p1.p5_eval_B p2.p5_eval_from_C = p3.p5_eval_C p3.p5_eval_from_B = p1.p5_eval_C p3.p5_eval_from_C = p2.p5_eval_C class GroupWaitP6(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p6_eval_A_of_B = p1.p6_eval_B p4.p6_eval_A_of_C = p1.p6_eval_C p4.p6_eval_B_of_A = p2.p6_eval_B p4.p6_eval_B_of_C = p2.p6_eval_C p4.p6_eval_C_of_A = p3.p6_eval_B p4.p6_eval_C_of_B = p3.p6_eval_C # Also their comp... p4.p6_total_points = 15 + math.ceil((p4.p6_team_output / 10)) # Update employees' records p1.p6_eval_from_B = p2.p6_eval_B p1.p6_eval_from_C = p3.p6_eval_B p2.p6_eval_from_B = p1.p6_eval_B p2.p6_eval_from_C = p3.p6_eval_C p3.p6_eval_from_B = p1.p6_eval_C p3.p6_eval_from_C = p2.p6_eval_C class GroupWaitP7(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p7_eval_A_of_B = p1.p7_eval_B p4.p7_eval_A_of_C = p1.p7_eval_C p4.p7_eval_B_of_A = p2.p7_eval_B p4.p7_eval_B_of_C = p2.p7_eval_C p4.p7_eval_C_of_A = p3.p7_eval_B p4.p7_eval_C_of_B = p3.p7_eval_C # Also their comp... p4.p7_total_points = 15 + math.ceil((p4.p7_team_output / 10)) # Update employees' records p1.p7_eval_from_B = p2.p7_eval_B p1.p7_eval_from_C = p3.p7_eval_B p2.p7_eval_from_B = p1.p7_eval_B p2.p7_eval_from_C = p3.p7_eval_C p3.p7_eval_from_B = p1.p7_eval_C p3.p7_eval_from_C = p2.p7_eval_C class GroupWaitP8(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p8_eval_A_of_B = p1.p8_eval_B p4.p8_eval_A_of_C = p1.p8_eval_C p4.p8_eval_B_of_A = p2.p8_eval_B p4.p8_eval_B_of_C = p2.p8_eval_C p4.p8_eval_C_of_A = p3.p8_eval_B p4.p8_eval_C_of_B = p3.p8_eval_C # Also their comp... p4.p8_total_points = 15 + math.ceil((p4.p8_team_output / 10)) # Update employees' records p1.p8_eval_from_B = p2.p8_eval_B p1.p8_eval_from_C = p3.p8_eval_B p2.p8_eval_from_B = p1.p8_eval_B p2.p8_eval_from_C = p3.p8_eval_C p3.p8_eval_from_B = p1.p8_eval_C p3.p8_eval_from_C = p2.p8_eval_C class GroupWaitP9(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) # Update manager fields so that eval screen is easy to pull p4.p9_eval_A_of_B = p1.p9_eval_B p4.p9_eval_A_of_C = p1.p9_eval_C p4.p9_eval_B_of_A = p2.p9_eval_B p4.p9_eval_B_of_C = p2.p9_eval_C p4.p9_eval_C_of_A = p3.p9_eval_B p4.p9_eval_C_of_B = p3.p9_eval_C # Also their comp... p4.p9_total_points = 15 + math.ceil((p4.p9_team_output / 10)) # Update employees' records p1.p9_eval_from_B = p2.p9_eval_B p1.p9_eval_from_C = p3.p9_eval_B p2.p9_eval_from_B = p1.p9_eval_B p2.p9_eval_from_C = p3.p9_eval_C p3.p9_eval_from_B = p1.p9_eval_C p3.p9_eval_from_C = p2.p9_eval_C class GroupWaitM1(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p1_ind_bonus_penalty = p4.p1_ind_bonus_penalty p1.p1_B_bonus_penalty = p4.p1_B_bonus_penalty p1.p1_C_bonus_penalty = p4.p1_C_bonus_penalty p2.p1_ind_bonus_penalty = p4.p1_B_bonus_penalty p2.p1_B_bonus_penalty = p4.p1_ind_bonus_penalty p2.p1_C_bonus_penalty = p4.p1_C_bonus_penalty p3.p1_ind_bonus_penalty = p4.p1_C_bonus_penalty p3.p1_B_bonus_penalty = p4.p1_ind_bonus_penalty p3.p1_C_bonus_penalty = p4.p1_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p1_total_points = 10 + 20 - p1.p1_contribution + p1.p1_ind_bonus_penalty p2.p1_total_points = 10 + 20 - p2.p1_contribution + p2.p1_ind_bonus_penalty p3.p1_total_points = 10 + 20 - p3.p1_contribution + p3.p1_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p1_total_points = 40 + 20 - p1.p1_contribution - p1.p1_ind_bonus_penalty p2.p1_total_points = 40 + 20 - p2.p1_contribution - p2.p1_ind_bonus_penalty p3.p1_total_points = 40 + 20 - p3.p1_contribution - p3.p1_ind_bonus_penalty class GroupWaitM2(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p2_ind_bonus_penalty = p4.p2_ind_bonus_penalty p1.p2_B_bonus_penalty = p4.p2_B_bonus_penalty p1.p2_C_bonus_penalty = p4.p2_C_bonus_penalty p2.p2_ind_bonus_penalty = p4.p2_B_bonus_penalty p2.p2_B_bonus_penalty = p4.p2_ind_bonus_penalty p2.p2_C_bonus_penalty = p4.p2_C_bonus_penalty p3.p2_ind_bonus_penalty = p4.p2_C_bonus_penalty p3.p2_B_bonus_penalty = p4.p2_ind_bonus_penalty p3.p2_C_bonus_penalty = p4.p2_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p2_total_points = 10 + 20 - p1.p2_contribution + p1.p2_ind_bonus_penalty p2.p2_total_points = 10 + 20 - p2.p2_contribution + p2.p2_ind_bonus_penalty p3.p2_total_points = 10 + 20 - p3.p2_contribution + p3.p2_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p2_total_points = 40 + 20 - p1.p2_contribution - p1.p2_ind_bonus_penalty p2.p2_total_points = 40 + 20 - p2.p2_contribution - p2.p2_ind_bonus_penalty p3.p2_total_points = 40 + 20 - p3.p2_contribution - p3.p2_ind_bonus_penalty class GroupWaitM3(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p3_ind_bonus_penalty = p4.p3_ind_bonus_penalty p1.p3_B_bonus_penalty = p4.p3_B_bonus_penalty p1.p3_C_bonus_penalty = p4.p3_C_bonus_penalty p2.p3_ind_bonus_penalty = p4.p3_B_bonus_penalty p2.p3_B_bonus_penalty = p4.p3_ind_bonus_penalty p2.p3_C_bonus_penalty = p4.p3_C_bonus_penalty p3.p3_ind_bonus_penalty = p4.p3_C_bonus_penalty p3.p3_B_bonus_penalty = p4.p3_ind_bonus_penalty p3.p3_C_bonus_penalty = p4.p3_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p3_total_points = 10 + 20 - p1.p3_contribution + p1.p3_ind_bonus_penalty p2.p3_total_points = 10 + 20 - p2.p3_contribution + p2.p3_ind_bonus_penalty p3.p3_total_points = 10 + 20 - p3.p3_contribution + p3.p3_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p3_total_points = 40 + 20 - p1.p3_contribution - p1.p3_ind_bonus_penalty p2.p3_total_points = 40 + 20 - p2.p3_contribution - p2.p3_ind_bonus_penalty p3.p3_total_points = 40 + 20 - p3.p3_contribution - p3.p3_ind_bonus_penalty class GroupWaitM4(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p4_ind_bonus_penalty = p4.p4_ind_bonus_penalty p1.p4_B_bonus_penalty = p4.p4_B_bonus_penalty p1.p4_C_bonus_penalty = p4.p4_C_bonus_penalty p2.p4_ind_bonus_penalty = p4.p4_B_bonus_penalty p2.p4_B_bonus_penalty = p4.p4_ind_bonus_penalty p2.p4_C_bonus_penalty = p4.p4_C_bonus_penalty p3.p4_ind_bonus_penalty = p4.p4_C_bonus_penalty p3.p4_B_bonus_penalty = p4.p4_ind_bonus_penalty p3.p4_C_bonus_penalty = p4.p4_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p4_total_points = 10 + 20 - p1.p4_contribution + p1.p4_ind_bonus_penalty p2.p4_total_points = 10 + 20 - p2.p4_contribution + p2.p4_ind_bonus_penalty p3.p4_total_points = 10 + 20 - p3.p4_contribution + p3.p4_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p4_total_points = 40 + 20 - p1.p4_contribution - p1.p4_ind_bonus_penalty p2.p4_total_points = 40 + 20 - p2.p4_contribution - p2.p4_ind_bonus_penalty p3.p4_total_points = 40 + 20 - p3.p4_contribution - p3.p4_ind_bonus_penalty class GroupWaitM5(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p5_ind_bonus_penalty = p4.p5_ind_bonus_penalty p1.p5_B_bonus_penalty = p4.p5_B_bonus_penalty p1.p5_C_bonus_penalty = p4.p5_C_bonus_penalty p2.p5_ind_bonus_penalty = p4.p5_B_bonus_penalty p2.p5_B_bonus_penalty = p4.p5_ind_bonus_penalty p2.p5_C_bonus_penalty = p4.p5_C_bonus_penalty p3.p5_ind_bonus_penalty = p4.p5_C_bonus_penalty p3.p5_B_bonus_penalty = p4.p5_ind_bonus_penalty p3.p5_C_bonus_penalty = p4.p5_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p5_total_points = 10 + 20 - p1.p5_contribution + p1.p5_ind_bonus_penalty p2.p5_total_points = 10 + 20 - p2.p5_contribution + p2.p5_ind_bonus_penalty p3.p5_total_points = 10 + 20 - p3.p5_contribution + p3.p5_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p5_total_points = 40 + 20 - p1.p5_contribution - p1.p5_ind_bonus_penalty p2.p5_total_points = 40 + 20 - p2.p5_contribution - p2.p5_ind_bonus_penalty p3.p5_total_points = 40 + 20 - p3.p5_contribution - p3.p5_ind_bonus_penalty class GroupWaitM6(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p6_ind_bonus_penalty = p4.p6_ind_bonus_penalty p1.p6_B_bonus_penalty = p4.p6_B_bonus_penalty p1.p6_C_bonus_penalty = p4.p6_C_bonus_penalty p2.p6_ind_bonus_penalty = p4.p6_B_bonus_penalty p2.p6_B_bonus_penalty = p4.p6_ind_bonus_penalty p2.p6_C_bonus_penalty = p4.p6_C_bonus_penalty p3.p6_ind_bonus_penalty = p4.p6_C_bonus_penalty p3.p6_B_bonus_penalty = p4.p6_ind_bonus_penalty p3.p6_C_bonus_penalty = p4.p6_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p6_total_points = 10 + 20 - p1.p6_contribution + p1.p6_ind_bonus_penalty p2.p6_total_points = 10 + 20 - p2.p6_contribution + p2.p6_ind_bonus_penalty p3.p6_total_points = 10 + 20 - p3.p6_contribution + p3.p6_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p6_total_points = 40 + 20 - p1.p6_contribution - p1.p6_ind_bonus_penalty p2.p6_total_points = 40 + 20 - p2.p6_contribution - p2.p6_ind_bonus_penalty p3.p6_total_points = 40 + 20 - p3.p6_contribution - p3.p6_ind_bonus_penalty class GroupWaitM7(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p7_ind_bonus_penalty = p4.p7_ind_bonus_penalty p1.p7_B_bonus_penalty = p4.p7_B_bonus_penalty p1.p7_C_bonus_penalty = p4.p7_C_bonus_penalty p2.p7_ind_bonus_penalty = p4.p7_B_bonus_penalty p2.p7_B_bonus_penalty = p4.p7_ind_bonus_penalty p2.p7_C_bonus_penalty = p4.p7_C_bonus_penalty p3.p7_ind_bonus_penalty = p4.p7_C_bonus_penalty p3.p7_B_bonus_penalty = p4.p7_ind_bonus_penalty p3.p7_C_bonus_penalty = p4.p7_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p7_total_points = 10 + 20 - p1.p7_contribution + p1.p7_ind_bonus_penalty p2.p7_total_points = 10 + 20 - p2.p7_contribution + p2.p7_ind_bonus_penalty p3.p7_total_points = 10 + 20 - p3.p7_contribution + p3.p7_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p7_total_points = 40 + 20 - p1.p7_contribution - p1.p7_ind_bonus_penalty p2.p7_total_points = 40 + 20 - p2.p7_contribution - p2.p7_ind_bonus_penalty p3.p7_total_points = 40 + 20 - p3.p7_contribution - p3.p7_ind_bonus_penalty class GroupWaitM8(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p8_ind_bonus_penalty = p4.p8_ind_bonus_penalty p1.p8_B_bonus_penalty = p4.p8_B_bonus_penalty p1.p8_C_bonus_penalty = p4.p8_C_bonus_penalty p2.p8_ind_bonus_penalty = p4.p8_B_bonus_penalty p2.p8_B_bonus_penalty = p4.p8_ind_bonus_penalty p2.p8_C_bonus_penalty = p4.p8_C_bonus_penalty p3.p8_ind_bonus_penalty = p4.p8_C_bonus_penalty p3.p8_B_bonus_penalty = p4.p8_ind_bonus_penalty p3.p8_C_bonus_penalty = p4.p8_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p8_total_points = 10 + 20 - p1.p8_contribution + p1.p8_ind_bonus_penalty p2.p8_total_points = 10 + 20 - p2.p8_contribution + p2.p8_ind_bonus_penalty p3.p8_total_points = 10 + 20 - p3.p8_contribution + p3.p8_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p8_total_points = 40 + 20 - p1.p8_contribution - p1.p8_ind_bonus_penalty p2.p8_total_points = 40 + 20 - p2.p8_contribution - p2.p8_ind_bonus_penalty p3.p8_total_points = 40 + 20 - p3.p8_contribution - p3.p8_ind_bonus_penalty class GroupWaitM9(WaitPage): body_text = ("Please wait briefly while others finish making decisions. You will be automatically advanced " "when ready.") @staticmethod def after_all_players_arrive(group: Group): p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) p3 = group.get_player_by_id(3) p4 = group.get_player_by_id(4) p1.p9_ind_bonus_penalty = p4.p9_ind_bonus_penalty p1.p9_B_bonus_penalty = p4.p9_B_bonus_penalty p1.p9_C_bonus_penalty = p4.p9_C_bonus_penalty p2.p9_ind_bonus_penalty = p4.p9_B_bonus_penalty p2.p9_B_bonus_penalty = p4.p9_ind_bonus_penalty p2.p9_C_bonus_penalty = p4.p9_C_bonus_penalty p3.p9_ind_bonus_penalty = p4.p9_C_bonus_penalty p3.p9_B_bonus_penalty = p4.p9_ind_bonus_penalty p3.p9_C_bonus_penalty = p4.p9_B_bonus_penalty if p1.condition == 1 or p1.condition == 3: p1.p9_total_points = 10 + 20 - p1.p9_contribution + p1.p9_ind_bonus_penalty p2.p9_total_points = 10 + 20 - p2.p9_contribution + p2.p9_ind_bonus_penalty p3.p9_total_points = 10 + 20 - p3.p9_contribution + p3.p9_ind_bonus_penalty elif p1.condition == 2 or p1.condition == 4: p1.p9_total_points = 40 + 20 - p1.p9_contribution - p1.p9_ind_bonus_penalty p2.p9_total_points = 40 + 20 - p2.p9_contribution - p2.p9_ind_bonus_penalty p3.p9_total_points = 40 + 20 - p3.p9_contribution - p3.p9_ind_bonus_penalty class P1PeerEval(Page): form_model = 'player' form_fields = ['p1_eval_B', 'p1_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P2PeerEval(Page): form_model = 'player' form_fields = ['p2_eval_B', 'p2_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P3PeerEval(Page): form_model = 'player' form_fields = ['p3_eval_B', 'p3_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P4PeerEval(Page): form_model = 'player' form_fields = ['p4_eval_B', 'p4_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P5PeerEval(Page): form_model = 'player' form_fields = ['p5_eval_B', 'p5_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P6PeerEval(Page): form_model = 'player' form_fields = ['p6_eval_B', 'p6_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P7PeerEval(Page): form_model = 'player' form_fields = ['p7_eval_B', 'p7_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P8PeerEval(Page): form_model = 'player' form_fields = ['p8_eval_B', 'p8_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P9PeerEval(Page): form_model = 'player' form_fields = ['p9_eval_B', 'p9_eval_C'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P1MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p1_team_bonus_penalty == 90: return ['p1_ind_bonus_penalty', 'p1_B_bonus_penalty', 'p1_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p1_eval_B_of_A + player.p1_eval_C_of_A) / 2.00 avB = (player.p1_eval_A_of_B + player.p1_eval_C_of_B) / 2.00 avC = (player.p1_eval_A_of_C + player.p1_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P2MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p2_team_bonus_penalty == 90: return ['p2_ind_bonus_penalty', 'p2_B_bonus_penalty', 'p2_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p2_eval_B_of_A + player.p2_eval_C_of_A) / 2.00 avB = (player.p2_eval_A_of_B + player.p2_eval_C_of_B) / 2.00 avC = (player.p2_eval_A_of_C + player.p2_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P3MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p3_team_bonus_penalty == 90: return ['p3_ind_bonus_penalty', 'p3_B_bonus_penalty', 'p3_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p3_eval_B_of_A + player.p3_eval_C_of_A) / 2.00 avB = (player.p3_eval_A_of_B + player.p3_eval_C_of_B) / 2.00 avC = (player.p3_eval_A_of_C + player.p3_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P4MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p4_team_bonus_penalty == 90: return ['p4_ind_bonus_penalty', 'p4_B_bonus_penalty', 'p4_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p4_eval_B_of_A + player.p4_eval_C_of_A) / 2.00 avB = (player.p4_eval_A_of_B + player.p4_eval_C_of_B) / 2.00 avC = (player.p4_eval_A_of_C + player.p4_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P5MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p5_team_bonus_penalty == 90: return ['p5_ind_bonus_penalty', 'p5_B_bonus_penalty', 'p5_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p5_eval_B_of_A + player.p5_eval_C_of_A) / 2.00 avB = (player.p5_eval_A_of_B + player.p5_eval_C_of_B) / 2.00 avC = (player.p5_eval_A_of_C + player.p5_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P6MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p6_team_bonus_penalty == 90: return ['p6_ind_bonus_penalty', 'p6_B_bonus_penalty', 'p6_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p6_eval_B_of_A + player.p6_eval_C_of_A) / 2.00 avB = (player.p6_eval_A_of_B + player.p6_eval_C_of_B) / 2.00 avC = (player.p6_eval_A_of_C + player.p6_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P7MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p7_team_bonus_penalty == 90: return ['p7_ind_bonus_penalty', 'p7_B_bonus_penalty', 'p7_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p7_eval_B_of_A + player.p7_eval_C_of_A) / 2.00 avB = (player.p7_eval_A_of_B + player.p7_eval_C_of_B) / 2.00 avC = (player.p7_eval_A_of_C + player.p7_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P8MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p8_team_bonus_penalty == 90: return ['p8_ind_bonus_penalty', 'p8_B_bonus_penalty', 'p8_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p8_eval_B_of_A + player.p8_eval_C_of_A) / 2.00 avB = (player.p8_eval_A_of_B + player.p8_eval_C_of_B) / 2.00 avC = (player.p8_eval_A_of_C + player.p8_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P9MgrEval(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.role == "Manager" def get_form_fields(player: Player): if player.p9_team_bonus_penalty == 90: return ['p9_ind_bonus_penalty', 'p9_B_bonus_penalty', 'p9_C_bonus_penalty'] def vars_for_template(player: Player): avA = (player.p9_eval_B_of_A + player.p9_eval_C_of_A) / 2.00 avB = (player.p9_eval_A_of_B + player.p9_eval_C_of_B) / 2.00 avC = (player.p9_eval_A_of_C + player.p9_eval_B_of_C) / 2.00 return dict( avg_A=avA, avg_B=avB, avg_C=avC ) class P1Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P2Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P3Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P4Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P5Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P6Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P7Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P8Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class P9Results(Page): @staticmethod def is_displayed(player: Player): return player.role == "Employee" class PEQE1(Page): form_model = 'player' form_fields = ['risk_attitude', 'own_comp_fairness', 'target_difficulty', 'contribution_difficulty', 'evaluation_difficulty', 'productivity_fairness', 'bonus_penalty_fairness', 'total_comp_fairness', 'productivity_satisfaction', 'low_productivity_act', 'peer_expectations', 'job_satisfaction', 'job_valued', 'like_comp_structure', 'happy_comp_structure', 'no_bonus_penalty_feeling', 'bonus_penalty_feeling', 'peer_pressure', 'peer_eval_conscious', 'difference_unobservable'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" @staticmethod def before_next_page(player, timeout_happened): player.total_points = (player.p1_total_points + player.p2_total_points + player.p3_total_points + player.p4_total_points + player.p5_total_points + player.p6_total_points + player.p7_total_points + player.p8_total_points + player.p9_total_points) if player.total_points < 0: player.total_points = 0 points_comp = (math.ceil(player.total_points * 100.0)/100.0) / 50.00 total_comp = 5.00 + points_comp player.points_compensation = '{0:.2f}'.format(points_comp) player.total_compensation = '{0:.2f}'.format(total_comp) class PEQE2(Page): form_model = 'player' form_fields = ['bonus_penalty_equality', 'manager_influence', 'teammate_predictability', 'teammate_norms', 'teammate_target_effect', 'self_interest_imp', 'mgr_antic_influence', 'peer_eval_accuracy', 'peer_eval_cooperation', 'peer_eval_strategic', 'peer_eval_factors', 'group_id_1', 'group_id_2', 'group_id_3', 'group_id_4', 'group_id_5', 'group_id_6'] @staticmethod def is_displayed(player: Player): return player.role == "Employee" class PEQM1(Page): form_model = 'player' form_fields = ['risk_attitude', 'allocation_difficulty', 'allocation_stress', 'allocation_postpone', 'allocation_careful', 'responsible_for_comp', 'peer_eval_consistency', 'emp_comp_fairness', 'own_comp_fairness', 'target_difficulty', 'effect_lower_prod', 'peer_eval_basis', 'inputs_observable'] @staticmethod def is_displayed(player: Player): return player.role == "Manager" @staticmethod def before_next_page(player, timeout_happened): player.total_points = (player.p1_total_points + player.p2_total_points + player.p3_total_points + player.p4_total_points + player.p5_total_points + player.p6_total_points + player.p7_total_points + player.p8_total_points + player.p9_total_points) points_comp = (math.ceil(player.total_points * 100.0)/100.0) / 50.00 total_comp = 5.00 + points_comp player.points_compensation = '{0:.2f}'.format(points_comp) player.total_compensation = '{0:.2f}'.format(total_comp) class PEQM2(Page): form_model = 'player' form_fields = ['equal_allocations_just', 'deserve_greater_comp', 'allocation_single_influence', 'allocation_unanimous', 'allocation_expl', 'group_id_1', 'group_id_2', 'group_id_3', 'group_id_4', 'group_id_5', 'group_id_6'] @staticmethod def is_displayed(player: Player): return player.role == "Manager" class PEQ3(Page): form_model = 'player' form_fields = ['contract_preference', 'narcissism_1', 'narcissism_2', 'narcissism_3', 'narcissism_4', 'narcissism_5', 'narcissism_6', 'narcissism_7', 'narcissism_8', 'narcissism_9', 'gender', 'age', 'gpa', 'major', 'work_experience', 'pay_method', 'pay_id', 'email', 'first_name', 'last_name', 'referring_prof'] class ExitResults(Page): pass page_sequence = \ [ IC, IC_Decline, DuplicateWorker, GenInstructions, TaskInstructions1, TaskInstructions2, PerfEval, Compensation, KnowledgeCheck, GroupWait1, P1Contribution, GroupWaitC1, P1PeerEval, GroupWaitP1, P1MgrEval, GroupWaitM1, P1Results, P2Contribution, GroupWaitC2, P2PeerEval, GroupWaitP2, P2MgrEval, GroupWaitM2, P2Results, P3Contribution, GroupWaitC3, P3PeerEval, GroupWaitP3, P3MgrEval, GroupWaitM3, P3Results, P4Contribution, GroupWaitC4, P4PeerEval, GroupWaitP4, P4MgrEval, GroupWaitM4, P4Results, P5Contribution, GroupWaitC5, P5PeerEval, GroupWaitP5, P5MgrEval, GroupWaitM5, P5Results, P6Contribution, GroupWaitC6, P6PeerEval, GroupWaitP6, P6MgrEval, GroupWaitM6, P6Results, P7Contribution, GroupWaitC7, P7PeerEval, GroupWaitP7, P7MgrEval, GroupWaitM7, P7Results, P8Contribution, GroupWaitC8, P8PeerEval, GroupWaitP8, P8MgrEval, GroupWaitM8, P8Results, P9Contribution, GroupWaitC9, P9PeerEval, GroupWaitP9, P9MgrEval, GroupWaitM9, P9Results, PEQE1, PEQE2, PEQM1, PEQM2, PEQ3, ExitResults ]