from otree.api import * import time doc = """ Real effort task """ class C(BaseConstants): NAME_IN_URL = 'Task_2' PLAYERS_PER_GROUP = 2 NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): team_account = models.IntegerField() class Player(BasePlayer): get_timeout_seconds = models.IntegerField() task_understood = models.BooleanField( widget=widgets.CheckboxInput(), blank=True, ) #PRODUCTION number_K_1= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') #entries in formfield number_IK_1 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_1 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') #clicked sum_IK_1 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_1 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') # total correct in grid correct_IK_1 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_1 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_2= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_2 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_2 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_2 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_2 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_2 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_2 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_3= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_3 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_3 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_3 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_3 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_3 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_3 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_4= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_4 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_4 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_4 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_4 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_4 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_4 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_5= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_5 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_5 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_5 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_5 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_5 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_5 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_6= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_6 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_6 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_6 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_6 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_6 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_6 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_7= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_7 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_7 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_7 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_7 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_7 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_7 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_8= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_8 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_8 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_8 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_8 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_8 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_8 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_9= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_9 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_9 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_9 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_9 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_9 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_9 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_10= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_10 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_10 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_10 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_10 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_10 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_10 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_11= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_11 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_11 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_11 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_11 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_11 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_11 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_12= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_12 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_12 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_12 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_12 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_12 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_12 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_13= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_13 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_13 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_13 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_13 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_13 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_13 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_14= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_14 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_14 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_14 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_14 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_14 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_14 = models.IntegerField(initial=0, min=0, label='Payout for respective player') number_K_15= models.IntegerField(initial=0, min=0, max=100, label='Number of letters "K" clicked in the grid.') number_IK_15 = models.IntegerField(initial=0, min=0, max=100, label='Number of letters "I" clicked in the grid.') sum_K_15 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "K" clicked in the grid.') sum_IK_15 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') correct_K_15 = models.IntegerField(initial=0, min=0, max=100, label='Sum of correct "K" in the grid.') correct_IK_15 = models.IntegerField(initial=0, min=0, max=100, label='Sum of letters "IK" clicked in the grid.') payout_15 = models.IntegerField(initial=0, min=0, label='Payout for respective player') payout_total = models.IntegerField(initial=0, min=0, label='Sum of all payouts in the production round') #FUNCTIONS def payout_calculation(treatment, calc_num_K, calc_num_IK, calc_sum_K, calc_sum_IK, calc_cor_K, calc_cor_IK): if calc_cor_K == 0: calc_payout = 0; return(calc_payout) else: if treatment < 3: if calc_sum_K == calc_cor_K: sum_K_is_K = 1; else: sum_K_is_K = 0; if calc_sum_IK == calc_cor_IK: sum_IK_is_IK = 1; else: sum_IK_is_IK = 0; if calc_num_K == calc_cor_K: num_K_is_K = 1; else: num_K_is_K = 0; if calc_num_IK == calc_cor_IK: num_IK_is_IK = 1; else: num_IK_is_IK = 0; calc_payout = int((sum_K_is_K + sum_IK_is_IK + num_K_is_K + num_IK_is_IK) * 50) return (calc_payout) else: sum_Ks = calc_sum_K * 5 sum_IKs = calc_sum_IK * 7 if calc_num_K == calc_cor_K: a_K = 23; a_K_is_K = 1; else: a_K = 0; a_K_is_K = 0; if calc_num_IK == calc_cor_IK: a_IK = 17; a_IK_is_IK = 1; else: a_IK = 0; a_IK_is_IK = 0; calc_payout = int(round(sum_Ks + sum_IKs + a_K + a_IK + (0.25 * ( (sum_Ks * a_K_is_K) + (sum_IKs * a_IK_is_IK) + (sum_Ks * a_IK_is_IK) + ( sum_IKs * a_K_is_K))) * (1.2 * a_K_is_K * a_IK_is_IK), 0)) return (calc_payout) def get_timeout_seconds(player): participant = player.participant return participant.expiry - time.time() # PAGES class ProductionIntro(Page): form_model = 'player' @staticmethod def before_next_page(player, timeout_happened): participant = player.participant participant.expiry = time.time() + 60 * 5 class Task_1(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_1', 'number_IK_1'] @staticmethod def live_method(player, data): player.sum_K_1 = int(data['value_K']); player.sum_IK_1 = int(data['value_IK']); player.correct_K_1 = int(data['correct_K']); player.correct_IK_1 = int(data['correct_IK']); class Task_2(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_2', 'number_IK_2'] @staticmethod def live_method(player, data): player.sum_K_2 = int(data['value_K']); player.sum_IK_2 = int(data['value_IK']); player.correct_K_2 = int(data['correct_K']); player.correct_IK_2 = int(data['correct_IK']); class Task_3(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_3', 'number_IK_3'] @staticmethod def live_method(player, data): player.sum_K_3 = int(data['value_K']); player.sum_IK_3 = int(data['value_IK']); player.correct_K_3 = int(data['correct_K']); player.correct_IK_3 = int(data['correct_IK']); class Task_4(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_4', 'number_IK_4'] @staticmethod def live_method(player, data): player.sum_K_4 = int(data['value_K']); player.sum_IK_4 = int(data['value_IK']); player.correct_K_4 = int(data['correct_K']); player.correct_IK_4 = int(data['correct_IK']); class Task_5(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_5', 'number_IK_5'] @staticmethod def live_method(player, data): player.sum_K_5 = int(data['value_K']); player.sum_IK_5 = int(data['value_IK']); player.correct_K_5 = int(data['correct_K']); player.correct_IK_5 = int(data['correct_IK']); class Task_6(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_6', 'number_IK_6'] @staticmethod def live_method(player, data): player.sum_K_6 = int(data['value_K']); player.sum_IK_6 = int(data['value_IK']); player.correct_K_6 = int(data['correct_K']); player.correct_IK_6 = int(data['correct_IK']); class Task_7(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_7', 'number_IK_7'] @staticmethod def live_method(player, data): player.sum_K_7 = int(data['value_K']); player.sum_IK_7 = int(data['value_IK']); player.correct_K_7 = int(data['correct_K']); player.correct_IK_7 = int(data['correct_IK']); class Task_8(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_8', 'number_IK_8'] @staticmethod def live_method(player, data): player.sum_K_8 = int(data['value_K']); player.sum_IK_8 = int(data['value_IK']); player.correct_K_8 = int(data['correct_K']); player.correct_IK_8 = int(data['correct_IK']); class Task_9(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_9', 'number_IK_9'] @staticmethod def live_method(player, data): player.sum_K_9 = int(data['value_K']); player.sum_IK_9 = int(data['value_IK']); player.correct_K_9 = int(data['correct_K']); player.correct_IK_9 = int(data['correct_IK']); class Task_10(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_10', 'number_IK_10'] @staticmethod def live_method(player, data): player.sum_K_10 = int(data['value_K']); player.sum_IK_10 = int(data['value_IK']); player.correct_K_10 = int(data['correct_K']); player.correct_IK_10 = int(data['correct_IK']); class Task_11(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_11', 'number_IK_11'] @staticmethod def live_method(player, data): player.sum_K_11 = int(data['value_K']); player.sum_IK_11 = int(data['value_IK']); player.correct_K_11 = int(data['correct_K']); player.correct_IK_11 = int(data['correct_IK']); class Task_12(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_12', 'number_IK_12'] @staticmethod def live_method(player, data): player.sum_K_12 = int(data['value_K']); player.sum_IK_12 = int(data['value_IK']); player.correct_K_12 = int(data['correct_K']); player.correct_IK_12 = int(data['correct_IK']); class Task_13(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_13', 'number_IK_13'] @staticmethod def live_method(player, data): player.sum_K_13 = int(data['value_K']); player.sum_IK_13 = int(data['value_IK']); player.correct_K_13 = int(data['correct_K']); player.correct_IK_13 = int(data['correct_IK']); class Task_14(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_14', 'number_IK_14'] @staticmethod def live_method(player, data): player.sum_K_14 = int(data['value_K']); player.sum_IK_14 = int(data['value_IK']); player.correct_K_14 = int(data['correct_K']); player.correct_IK_14 = int(data['correct_IK']); class Task_15(Page): timer_text = 'Time left to complete the task round:' get_timeout_seconds = get_timeout_seconds def is_displayed(player): participant = player.participant return (participant.expiry - time.time()) > 1 form_model = 'player' form_fields = ['number_K_15', 'number_IK_15'] @staticmethod def live_method(player, data): player.sum_K_15 = int(data['value_K']); player.sum_IK_15 = int(data['value_IK']); player.correct_K_15 = int(data['correct_K']); player.correct_IK_15 = int(data['correct_IK']); class Results(Page): form_model = 'player' timeout_seconds = 30 @staticmethod def vars_for_template(player): participant = player.participant treatment = participant.contract_group player.payout_1 = payout_calculation(treatment, player.number_K_1, player.number_IK_1, player.sum_K_1, player.sum_IK_1, player.correct_K_1, player.correct_IK_1) player.payout_2 = payout_calculation(treatment, player.number_K_2, player.number_IK_2, player.sum_K_2, player.sum_IK_2, player.correct_K_2, player.correct_IK_2) player.payout_3 = payout_calculation(treatment, player.number_K_3, player.number_IK_3, player.sum_K_3, player.sum_IK_3, player.correct_K_3, player.correct_IK_3) player.payout_4 = payout_calculation(treatment, player.number_K_4, player.number_IK_4, player.sum_K_4, player.sum_IK_4, player.correct_K_4, player.correct_IK_4) player.payout_5 = payout_calculation(treatment, player.number_K_5, player.number_IK_5, player.sum_K_5, player.sum_IK_5, player.correct_K_5, player.correct_IK_5) player.payout_6 = payout_calculation(treatment, player.number_K_6, player.number_IK_6, player.sum_K_6, player.sum_IK_6, player.correct_K_6, player.correct_IK_6) player.payout_7 = payout_calculation(treatment, player.number_K_7, player.number_IK_7, player.sum_K_7, player.sum_IK_7, player.correct_K_7, player.correct_IK_7) player.payout_8 = payout_calculation(treatment, player.number_K_8, player.number_IK_8, player.sum_K_8, player.sum_IK_8, player.correct_K_8, player.correct_IK_8) player.payout_9 = payout_calculation(treatment, player.number_K_9, player.number_IK_9, player.sum_K_9, player.sum_IK_9, player.correct_K_9, player.correct_IK_9) player.payout_10 = payout_calculation(treatment, player.number_K_10, player.number_IK_10, player.sum_K_10, player.sum_IK_10, player.correct_K_10, player.correct_IK_10) player.payout_11 = payout_calculation(treatment, player.number_K_11, player.number_IK_11, player.sum_K_11, player.sum_IK_11, player.correct_K_11, player.correct_IK_11) player.payout_12 = payout_calculation(treatment, player.number_K_12, player.number_IK_12, player.sum_K_12, player.sum_IK_12, player.correct_K_12, player.correct_IK_12) player.payout_13 = payout_calculation(treatment, player.number_K_13, player.number_IK_13, player.sum_K_13, player.sum_IK_13, player.correct_K_13, player.correct_IK_13) player.payout_14 = payout_calculation(treatment, player.number_K_14, player.number_IK_14, player.sum_K_14, player.sum_IK_14, player.correct_K_14, player.correct_IK_14) player.payout_15 = payout_calculation(treatment, player.number_K_15, player.number_IK_15, player.sum_K_15, player.sum_IK_15, player.correct_K_15, player.correct_IK_15) player.payout_total = player.payout_1 + player.payout_2 + player.payout_3 + player.payout_4 + player.payout_5 + player.payout_6 + player.payout_7 + player.payout_8 + player.payout_9 + player.payout_10 + player.payout_11 + player.payout_12 + player.payout_13 + player.payout_14 + player.payout_15 participant.total_earnings_2 = player.payout_total class Wait_1 (WaitPage): form_model = 'player' @staticmethod def set_payoffs(group): players = group.get_players() contributions = [p.payout_total for p in players] group.team_account = sum(contributions) for player in players: participant = player.participant participant.team_account_2 = group.team_account after_all_players_arrive = set_payoffs page_sequence = [ProductionIntro, Task_1, Task_2, Task_3, Task_4, Task_5, Task_6, Task_7, Task_8, Task_9, Task_10, Task_11, Task_12, Task_13, Task_14, Task_15, Results, Wait_1]