from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'Checkout' PLAYERS_PER_GROUP = None NUM_ROUNDS = 3 PAYOFF_INITIAL = 0 COMPLETE_PAY = 1 BONUS_PAY = 1 TOT_EXP_TIME = 15 TREAT1_PAR_N = 0 TREAT2_PAR_N = 100 TREAT3_PAR_N = 0 TREAT4_PAR_N = 0 TREAT5_PAR_N = 100 TREAT6_PAR_N = 0 TREAT7_PAR_N = 0 TREAT8_PAR_N = 100 TREAT9_PAR_N = 0 TREAT10_PAR_N = 0 TREAT11_PAR_N = 100 TREAT12_PAR_N = 0 CHECKOUT_TIME_MU_EASY = 2.199 CHECKOUT_TIME_SD_EASY = 0.397 CHECKOUT_TIME_MU_DIFF = 2.971 CHECKOUT_TIME_SD_DIFF = 0.396 CASHIER_DEDUCT_TIME = 1 MIN_CSHER_TIME_EASY = 4.232 MAX_CSHER_TIME_EASY = 18.611 MIN_CSHER_TIME_DIFF = 9.112 MAX_CSHER_TIME_DIFF = 40.405 BONUS_PAY_TIME_EASY_LOW_5 = 85.466 BONUS_PAY_TIME_EASY_LOW_10 = 146.295 BONUS_PAY_TIME_EASY_LOW_15 = 204.429 BONUS_PAY_TIME_EASY_HIGH_5 = 38.998 BONUS_PAY_TIME_EASY_HIGH_10 = 83.746 BONUS_PAY_TIME_EASY_HIGH_15 = 129.529 BONUS_PAY_TIME_DIFF_LOW_5 = 185.588 BONUS_PAY_TIME_DIFF_LOW_10 = 317.41 BONUS_PAY_TIME_DIFF_LOW_15 = 443.362 BONUS_PAY_TIME_DIFF_HIGH_5 = 84.284 BONUS_PAY_TIME_DIFF_HIGH_10 = 181.082 BONUS_PAY_TIME_DIFF_HIGH_15 = 280.136 PLAYER_RANGE_NUM_SD = 1.65 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): your_payoff_fn = models.FloatField(initial=0) treatment_group = models.IntegerField(initial=0) item_n_to_play = models.IntegerField(initial=0) treatment_difficulty = models.IntegerField() treatment_timepressure = models.IntegerField() co_method = models.StringField() checkout_bonus_time = models.FloatField(initial=0) time_spent_q1 = models.FloatField(initial=0) time_spent_q2 = models.FloatField(initial=0) time_spent_q3 = models.FloatField(initial=0) time_spent_q4 = models.FloatField(initial=0) time_spent_q5 = models.FloatField(initial=0) minutes_q1 = models.FloatField() minutes_q2 = models.FloatField() minutes_q3 = models.FloatField() minutes_q4 = models.FloatField() minutes_q5 = models.FloatField() seconds_q1 = models.FloatField() seconds_q2 = models.FloatField() seconds_q3 = models.FloatField() seconds_q4 = models.FloatField() seconds_q5 = models.FloatField() answer_q1 = models.IntegerField(initial=0) weight_q1 = models.FloatField(initial=0) w_1 = models.FloatField() price_q1 = models.FloatField() p_1 = models.FloatField() answer_q2 = models.IntegerField(initial=0) weight_q2 = models.FloatField(initial=0) w_2 = models.FloatField() price_q2 = models.FloatField() p_2 = models.FloatField() answer_q3 = models.IntegerField(initial=0) weight_q3 = models.FloatField(initial=0) w_3 = models.FloatField() price_q3 = models.FloatField() p_3 = models.FloatField() answer_q4 = models.IntegerField(initial=0) weight_q4 = models.FloatField(initial=0) w_4 = models.FloatField() price_q4 = models.FloatField() p_4 = models.FloatField() answer_q5 = models.IntegerField(initial=0) weight_q5 = models.FloatField(initial=0) w_5 = models.FloatField() price_q5 = models.FloatField() p_5 = models.FloatField() start_time_q1 = models.FloatField() end_time_q1 = models.FloatField(initial=1e+26) start_time_q2 = models.FloatField() end_time_q2 = models.FloatField(initial=1e+26) start_time_q3 = models.FloatField() end_time_q3 = models.FloatField(initial=1e+26) start_time_q4 = models.FloatField() end_time_q4 = models.FloatField(initial=1e+26) start_time_q5 = models.FloatField() end_time_q5 = models.FloatField(initial=1e+26) cat_1 = models.StringField() item_1 = models.StringField() cat_2 = models.StringField() item_2 = models.StringField() cat_3 = models.StringField() item_3 = models.StringField() cat_4 = models.StringField() item_4 = models.StringField() cat_5 = models.StringField() item_5 = models.StringField() cplttimenow = models.FloatField(initial=-404) a = models.FloatField() item_num = models.IntegerField(initial=0) timeout = models.FloatField(initial=0) exp_et = models.FloatField(initial=0) esq11 = models.FloatField() esq12 = models.FloatField() esq13 = models.FloatField() esq2 = models.FloatField() esq3 = models.FloatField() esq4 = models.FloatField() esq5 = models.FloatField() mturkidnum = models.StringField() player_input_info = models.LongStringField(initial=' ') cashier_time = models.FloatField(initial=0) quiz_failed_attempts = models.IntegerField(initial=0) start_time_practice = models.FloatField(initial=0) seconds_p1 = models.FloatField() weight_p1 = models.FloatField() price_p1 = models.FloatField() start_time_p1 = models.FloatField() end_time_p1 = models.FloatField() cat_1_p = models.StringField() cat_2_p = models.StringField() cat_3_p = models.StringField() item_1_p = models.StringField() item_2_p = models.StringField() item_3_p = models.StringField() w_1_p = models.FloatField() w_2_p = models.FloatField() w_3_p = models.FloatField() p_1_p = models.FloatField() p_2_p = models.FloatField() p_3_p = models.FloatField() seconds_p2 = models.FloatField() weight_p2 = models.FloatField() price_p2 = models.FloatField() start_time_p2 = models.FloatField() end_time_p2 = models.FloatField() seconds_p3 = models.FloatField() weight_p3 = models.FloatField() price_p3 = models.FloatField() start_time_p3 = models.FloatField() end_time_p3 = models.FloatField() time_spent_p1 = models.FloatField(initial=0) time_spent_p2 = models.FloatField(initial=0) time_spent_p3 = models.FloatField(initial=0) start_time_major = models.FloatField() time_average_p = models.FloatField() cashier_time_total = models.FloatField() checkout_option_selection = models.FloatField() cashier_time_1 = models.FloatField() cashier_time_2 = models.FloatField() cashier_time_3 = models.FloatField() cashier_time_4 = models.FloatField() cashier_time_5 = models.FloatField() total_time_use = models.FloatField(initial=0) num_correct_quiz = models.IntegerField(initial=0) cashier_time_per_item_lb = models.FloatField() cashier_time_per_item_ub = models.FloatField() cashier_time_total_lb = models.FloatField() cashier_time_total_ub = models.FloatField() cashier_time_total_quiz7 = models.FloatField() self_time_total_quiz8 = models.FloatField() time_total_average_p = models.FloatField() quiz1 = models.IntegerField(choices=[[5, '5'], [10, '10'], [15, '15'], [20, '20']], widget=widgets.RadioSelect) quiz2 = models.StringField(choices=[['a', 'Weight'], ['b', 'Price'], ['c', 'Both weight and price'], ['d', 'Either weight or price']], widget=widgets.RadioSelect) quiz3 = models.StringField(choices=[['a', 'In alphabetical order'], ['b', 'In random order'], ['c', 'In either way'], ['d', 'Noe of the above']], widget=widgets.RadioSelect) quiz4 = models.StringField(choices=[['a', '4-19'], ['b', '4-40'], ['c', '9-19'], ['d', '9-40']], widget=widgets.RadioSelect) quiz5 = models.StringField(choices=[['a', 'Take a break'], ['b', 'Click "Next Item" to proceed'], ['c', 'Wait for the screen to proceed automatically'], ['d', 'Close the browse window']], widget=widgets.RadioSelect) quiz6 = models.FloatField() quiz7 = models.StringField(choices=[['a', 'I have the option to choose either self-checkout or cashier checkout.'], ['b', 'I must complete both the checkout task and the survey to receive cash payment.'], ['c', 'If I exit the study in the middle, I will earn $0.'], ['d', 'I can continue the study and earn reward even if I fail this quiz.']], widget=widgets.RadioSelect) quiz8 = models.StringField(choices=[['a', '1'], ['b', '3'], ['c', '5'], ['d', 'Unlimited']], widget=widgets.RadioSelect) incorrect_quiz_num_list = models.StringField() num_incorrect_quiz = models.IntegerField() quiz_attempt_left = models.IntegerField(initial=0) surveyage = models.IntegerField() surveygender = models.IntegerField(choices=[[1, 'Male'], [2, 'Female'], [3, 'Other'], [4, 'Prefer not to say']], widget=widgets.RadioSelect) surveyedu = models.IntegerField(choices=[[1, 'Primary'], [2, 'Secondary'], [3, 'Associate'], [4, 'Bachelors'], [5, 'Masters'], [6, 'Doctor']], widget=widgets.RadioSelect) surveydevice = models.IntegerField(choices=[[1, 'Cell phone'], [2, 'Tablet'], [3, 'Laptop'], [4, 'Desktop'], [5, 'Other']], widget=widgets.RadioSelect) survey0 = models.IntegerField(choices=[[1, 'Self checkout'], [2, 'Cashier checkout']], widget=widgets.RadioSelectHorizontal) survey1 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey2 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey3 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey4 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey5 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey6 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey7 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey8 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) survey9 = models.IntegerField(choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neutral'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], widget=widgets.RadioSelectHorizontal) time_per_item_lb = models.FloatField(initial=0) time_per_item_ub = models.FloatField(initial=0) time_total_lb = models.FloatField(initial=0) time_total_ub = models.FloatField(initial=0) def live_method_pqc(player: Player, data): player.start_time_practice = float(data['start_time_practice_var']) def live_method_p1(player: Player, data): player.weight_p1 = float(data['weight_p1_var']) player.price_p1 = float(data['price_p1_var']) player.start_time_p1 = float(data['start_time_p1_var']) player.end_time_p1 = float(data['end_time_p1_var']) def live_method_p2(player: Player, data): player.weight_p2 = float(data['weight_p2_var']) player.price_p2 = float(data['price_p2_var']) player.start_time_p2 = float(data['start_time_p2_var']) player.end_time_p2 = float(data['end_time_p2_var']) def live_method_p3(player: Player, data): player.weight_p3 = float(data['weight_p3_var']) player.price_p3 = float(data['price_p3_var']) player.start_time_p3 = float(data['start_time_p3_var']) player.end_time_p3 = float(data['end_time_p3_var']) def live_method_SCM(player: Player, data): player.start_time_major = float(data['start_time_major_var']) def live_method_q1(player: Player, data): player.weight_q1 = float(data['weight_q1_var']) player.price_q1 = float(data['price_q1_var']) player.start_time_q1 = float(data['start_time_q1_var']) player.end_time_q1 = float(data['end_time_q1_var']) player.total_time_use = float(data['total_time_use_var']) def live_method_q2(player: Player, data): player.weight_q2 = float(data['weight_q2_var']) player.price_q2 = float(data['price_q2_var']) player.start_time_q2 = float(data['start_time_q2_var']) player.end_time_q2 = float(data['end_time_q2_var']) player.total_time_use = float(data['total_time_use_var']) def live_method_q3(player: Player, data): player.weight_q3 = float(data['weight_q3_var']) player.price_q3 = float(data['price_q3_var']) player.start_time_q3 = float(data['start_time_q3_var']) player.end_time_q3 = float(data['end_time_q3_var']) player.total_time_use = float(data['total_time_use_var']) def live_method_q4(player: Player, data): player.weight_q4 = float(data['weight_q4_var']) player.price_q4 = float(data['price_q4_var']) player.start_time_q4 = float(data['start_time_q4_var']) player.end_time_q4 = float(data['end_time_q4_var']) player.total_time_use = float(data['total_time_use_var']) def live_method_q5(player: Player, data): player.weight_q5 = float(data['weight_q5_var']) player.price_q5 = float(data['price_q5_var']) player.start_time_q5 = float(data['start_time_q5_var']) player.end_time_q5 = float(data['end_time_q5_var']) player.total_time_use = float(data['total_time_use_var']) def live_method_WME(player: Player, data): player.checkout_option_selection = float(data['checkout_option_selection_var']) def custom_export(players): yield ['participant_code', 'id_in_group'] for p in players: pp = p.participant yield [pp.code, p.id_in_group] class AssignParticipantTreatment(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): group = player.group # Treatment 1: 5 items, Low Difficulty, Low Time Pressure ### Treatment 2: 10 items, Low Difficulty, Low Time Pressure # Treatment 3: 15 items, Low Difficulty, Low Time Pressure # Treatment 4: 5 items, Low Difficulty, High Time Pressure ## Treatment 5: 10 items, Low Difficulty, High Time Pressure # Treatment 6: 15 items, Low Difficulty, High Time Pressure # Treatment 7: 5 items, High Difficulty, Low Time Pressure ### Treatment 8: 10 items, High Difficulty, Low Time Pressure # Treatment 9: 15 items, High Difficulty, Low Time Pressure # Treatment 10: 5 items, High Difficulty, High Time Pressure ## Treatment 11: 10 items, High Difficulty, High Time Pressure # Treatment 12: 15 items, High Difficulty, High Time Pressure if (player.id_in_group <= C.TREAT1_PAR_N): player.treatment_difficulty = 0 player.treatment_timepressure = 0 player.treatment_group = 1 player.item_n_to_play = 5 player.player_input_info = "find its weight information from a table. You need to enter the weight from a drop-down list" player.checkout_bonus_time = C.BONUS_PAY_TIME_EASY_LOW_5 elif (player.id_in_group - C.TREAT1_PAR_N <= C.TREAT2_PAR_N): player.treatment_difficulty = 0 player.treatment_timepressure = 0 player.treatment_group = 2 player.item_n_to_play = 10 player.player_input_info = "find its weight information from a table. You need to enter the weight from a drop-down list" player.checkout_bonus_time = C.BONUS_PAY_TIME_EASY_LOW_10 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N <= C.TREAT3_PAR_N): player.treatment_difficulty = 0 player.treatment_timepressure = 0 player.treatment_group = 3 player.item_n_to_play = 15 player.player_input_info = "find its weight information from a table. You need to enter the weight from a drop-down list" player.checkout_bonus_time = C.BONUS_PAY_TIME_EASY_LOW_15 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N <= C.TREAT4_PAR_N): player.treatment_difficulty = 0 player.treatment_timepressure = 1 player.treatment_group = 4 player.item_n_to_play = 5 player.player_input_info = "find its weight information from a table. You need to enter the weight from a drop-down list" player.checkout_bonus_time = C.BONUS_PAY_TIME_EASY_HIGH_5 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N <= C.TREAT5_PAR_N): player.treatment_difficulty = 0 player.treatment_timepressure = 1 player.treatment_group = 5 player.item_n_to_play = 10 player.player_input_info = "find its weight information from a table. You need to enter the weight from a drop-down list" player.checkout_bonus_time = C.BONUS_PAY_TIME_EASY_HIGH_10 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N <= C.TREAT6_PAR_N): player.treatment_difficulty = 0 player.treatment_timepressure = 1 player.treatment_group = 6 player.item_n_to_play = 15 player.player_input_info = "find its weight information from a table. You need to enter the weight from a drop-down list" player.checkout_bonus_time = C.BONUS_PAY_TIME_EASY_HIGH_15 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N - C.TREAT6_PAR_N <= C.TREAT7_PAR_N): player.treatment_difficulty = 1 player.treatment_timepressure = 0 player.treatment_group = 7 player.item_n_to_play = 5 player.player_input_info = "find its weight and price information from a table. You need to enter the weight from a drop-down list, and enter the price using a slider bar" player.checkout_bonus_time = C.BONUS_PAY_TIME_DIFF_LOW_5 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N - C.TREAT6_PAR_N - C.TREAT7_PAR_N <= C.TREAT8_PAR_N): player.treatment_difficulty = 1 player.treatment_timepressure = 0 player.treatment_group = 8 player.item_n_to_play = 10 player.player_input_info = "find its weight and price information from a table. You need to enter the weight from a drop-down list, and enter the price using a slider bar" player.checkout_bonus_time = C.BONUS_PAY_TIME_DIFF_LOW_10 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N - C.TREAT6_PAR_N - C.TREAT7_PAR_N - C.TREAT8_PAR_N <= C.TREAT9_PAR_N): player.treatment_difficulty = 1 player.treatment_timepressure = 0 player.treatment_group = 9 player.item_n_to_play = 15 player.player_input_info = "find its weight and price information from a table. You need to enter the weight from a drop-down list, and enter the price using a slider bar" player.checkout_bonus_time = C.BONUS_PAY_TIME_DIFF_LOW_15 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N - C.TREAT6_PAR_N - C.TREAT7_PAR_N - C.TREAT8_PAR_N - C.TREAT9_PAR_N <= C.TREAT10_PAR_N): player.treatment_difficulty = 1 player.treatment_timepressure = 1 player.treatment_group = 10 player.item_n_to_play = 5 player.player_input_info = "find its weight and price information from a table. You need to enter the weight from a drop-down list, and enter the price using a slider bar" player.checkout_bonus_time = C.BONUS_PAY_TIME_DIFF_HIGH_5 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N - C.TREAT6_PAR_N - C.TREAT7_PAR_N - C.TREAT8_PAR_N - C.TREAT9_PAR_N - C.TREAT10_PAR_N <= C.TREAT11_PAR_N): player.treatment_difficulty = 1 player.treatment_timepressure = 1 player.treatment_group = 11 player.item_n_to_play = 10 player.player_input_info = "find its weight and price information from a table. You need to enter the weight from a drop-down list, and enter the price using a slider bar" player.checkout_bonus_time = C.BONUS_PAY_TIME_DIFF_HIGH_10 elif (player.id_in_group - C.TREAT1_PAR_N - C.TREAT2_PAR_N - C.TREAT3_PAR_N - C.TREAT4_PAR_N - C.TREAT5_PAR_N - C.TREAT6_PAR_N - C.TREAT7_PAR_N - C.TREAT8_PAR_N - C.TREAT9_PAR_N - C.TREAT10_PAR_N - C.TREAT11_PAR_N <= C.TREAT12_PAR_N): player.treatment_difficulty = 1 player.treatment_timepressure = 1 player.treatment_group = 12 player.item_n_to_play = 15 player.player_input_info = "find its weight and price information from a table. You need to enter the weight from a drop-down list, and enter the price using a slider bar" player.checkout_bonus_time = C.BONUS_PAY_TIME_DIFF_HIGH_15 # Cashier Checkout time import numpy as np if player.treatment_difficulty == 0: mu, sigma = C.CHECKOUT_TIME_MU_EASY, C.CHECKOUT_TIME_SD_EASY np.random.seed(seed=None) s = np.random.lognormal(mu, sigma, 5) s[0] = np.min([np.max([s[0], C.MIN_CSHER_TIME_EASY]), C.MAX_CSHER_TIME_EASY]) s[1] = np.min([np.max([s[1], C.MIN_CSHER_TIME_EASY]), C.MAX_CSHER_TIME_EASY]) s[2] = np.min([np.max([s[2], C.MIN_CSHER_TIME_EASY]), C.MAX_CSHER_TIME_EASY]) s[3] = np.min([np.max([s[3], C.MIN_CSHER_TIME_EASY]), C.MAX_CSHER_TIME_EASY]) s[4] = np.min([np.max([s[4], C.MIN_CSHER_TIME_EASY]), C.MAX_CSHER_TIME_EASY]) player.cashier_time_per_item_lb = round(C.MIN_CSHER_TIME_EASY) player.cashier_time_per_item_ub = round(C.MAX_CSHER_TIME_EASY) player.cashier_time_total_lb = player.cashier_time_per_item_lb*player.item_n_to_play player.cashier_time_total_ub = player.cashier_time_per_item_ub*player.item_n_to_play elif player.treatment_difficulty == 1: mu, sigma = C.CHECKOUT_TIME_MU_DIFF, C.CHECKOUT_TIME_SD_DIFF np.random.seed(seed=None) s = np.random.lognormal(mu, sigma, 5) s[0] = np.min([np.max([s[0], C.MIN_CSHER_TIME_DIFF]), C.MAX_CSHER_TIME_DIFF]) s[1] = np.min([np.max([s[1], C.MIN_CSHER_TIME_DIFF]), C.MAX_CSHER_TIME_DIFF]) s[2] = np.min([np.max([s[2], C.MIN_CSHER_TIME_DIFF]), C.MAX_CSHER_TIME_DIFF]) s[3] = np.min([np.max([s[3], C.MIN_CSHER_TIME_DIFF]), C.MAX_CSHER_TIME_DIFF]) s[4] = np.min([np.max([s[4], C.MIN_CSHER_TIME_DIFF]), C.MAX_CSHER_TIME_DIFF]) player.cashier_time_per_item_lb = round(C.MIN_CSHER_TIME_DIFF) player.cashier_time_per_item_ub = round(C.MAX_CSHER_TIME_DIFF) player.cashier_time_total_lb = player.cashier_time_per_item_lb*player.item_n_to_play player.cashier_time_total_ub = player.cashier_time_per_item_ub*player.item_n_to_play player.cashier_time_1 = s[0] - C.CASHIER_DEDUCT_TIME player.cashier_time_2 = s[1] - C.CASHIER_DEDUCT_TIME player.cashier_time_3 = s[2] - C.CASHIER_DEDUCT_TIME player.cashier_time_4 = s[3] - C.CASHIER_DEDUCT_TIME player.cashier_time_5 = s[4] - C.CASHIER_DEDUCT_TIME player.cashier_time_total_quiz7 = player.checkout_bonus_time + 15 player.self_time_total_quiz8 = player.checkout_bonus_time -8 return False class ConsentDisclosure(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): if player.round_number == 1: return True else: return False class InstructionQuizANDTimeSetup(Page): form_model = 'player' form_fields = ['quiz1', 'quiz2', 'quiz3', 'quiz4', 'quiz5', 'quiz6', 'quiz7', 'quiz8'] @staticmethod def is_displayed(player: Player): if player.round_number == 1: return True else: return False @staticmethod def error_message(player: Player, values): solutions = dict(quiz1=player.item_n_to_play , quiz2='a' , quiz3='a' , quiz4='a' , quiz5='b' , quiz6= int(str(player.checkout_bonus_time)[0:str(player.checkout_bonus_time).rfind(".")]) , quiz7='d' , quiz8='b') if player.treatment_difficulty == 1: solutions["quiz2"] = "c" solutions["quiz3"] = "b" solutions["quiz4"] = "d" incorrect_list = [] player.num_correct_quiz = 8 if values["quiz1"] != solutions["quiz1"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(1) if values["quiz2"] != solutions["quiz2"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(2) if values["quiz3"] != solutions["quiz3"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(3) if values["quiz4"] != solutions["quiz4"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(4) if values["quiz5"] != solutions["quiz5"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(5) if values["quiz6"] != solutions["quiz6"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(6) if values["quiz7"] != solutions["quiz7"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(7) if values["quiz8"] != solutions["quiz8"]: player.num_correct_quiz = player.num_correct_quiz - 1 incorrect_list.append(8) player.incorrect_quiz_num_list = str(incorrect_list)[1:-1] player.num_incorrect_quiz = 8-player.num_correct_quiz if player.num_correct_quiz == 8: player.quiz_failed_attempts = 999 if player.num_correct_quiz != 8: player.quiz_failed_attempts += 1 player.quiz_attempt_left = 3 - player.quiz_failed_attempts if player.quiz_failed_attempts < 3: return "Quiz ", str(incorrect_list)[1:-1], " were answered incorrectly. Please fix. You have " + str(3 - player.quiz_failed_attempts) + " attempts left." errors = {name: 'Incorrect' for name in solutions if values[name] != solutions[name]} if errors and player.quiz_failed_attempts < 3: return errors class FailQuiz(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): if player.in_round(1).quiz_failed_attempts == 3: return True else: return False class PassQuizCongrats(Page): form_model = 'player' live_method = 'live_method_pqc' @staticmethod def is_displayed(player: Player): if player.round_number == 1: return True else: return False class PracticeItem1(Page): form_model = 'player' live_method = 'live_method_p1' @staticmethod def is_displayed(player: Player): group = player.group player.item_num = 1 # Shuffle Categories - only need for item 1, 6, 11 import random random.seed(9999*player.id_in_group) cat_array = ["Fruit", "Coffee", "Seafood", "Vege", "Meat"]; random.shuffle(cat_array) player.cat_1_p = cat_array[0] player.cat_2_p = cat_array[1] player.cat_3_p = cat_array[2] # Items fruit_list = ["Peach","Blueberry","Mango","Cherry","Watermelon","Lemon","Orange","Pear","Grapes","Pineapple","Raspberry","Kiwi","Apricot","Lychee","Grapefruit","Apple","Guava","Banana","Papaya","Cantaloup","Nectarine","Pomegranate","Plum","Mandarin","Jackfruit","Melon","Coconut","Dragon Fruit","Cloudberry","Pineberry","Passionfruit","Tamarillo","Tamarind","Tangelo","Tayberry","Lime","Loquat","Longan","Feijoa","Fig"] coffee_list = ["Arabica","Bourbon","Catimor","Catuai","Caturra","Excelsa","Geisha","Icatu","Jackson","Jamaican","Jember","Kent","Kona Typica","Liberica","Maracatu","Maragogype","Mocca","Mundo","Pacamara","Pacas","Arusha","Benguet","Bernardina","Charrier","Harar","Sidamo","Yirgacheffe","Bonifieur","Kona","Java","Maragogipe","Maragaturra","Mocha","Sagada","Santos","Sarchimor","Typica","Uganda","Brutte","Starmaya"] seafood_list = ["Anchovies","Anglerfish","Barracuda","Bass","Blowfish","Bluefish","Bonito","Bream","Burbot","Carp","Catfish","Dogfish","Dorade","Flounder","Grouper","Haddock","Halibut","Herring","Lamprey","Monkfish","Mullet","Parrotfish","Perch","Pike","Pilchard","Pollock","Pomfret","Pompano","Sablefish","Sardine","Shark","Skate","Sturgeon","Surimi","Swordfish","Tilapia","Tilefish","Turbot","Wahoo","Whiting"] vege_list = ["Artichokes","Arugula","Asparagus","Avocados","Basil","Beets","Broccoli","Carrots","Cauliflower","Chard","Corn","Cucumber","Eggplant","Fennel","Fiddleheads","Garlic","Green Onions","Kohlrabi","Morels","Mushrooms","Nettles","Lettuce","Okra","Parsley","Potatoes","Radish","Rhubarb","Spinach","Spring Onions","Tomatoes","Turnips","Bok Choy","Broccolini","Cabbage","Celeriac","Celery","Daikon","Parsnips","Kale","Leeks"] meat_list = ["Ribeye Steak","Rib Roast","Arm Roast","Chuck Roast","Chuck Steak","Brisket","T-Bone Steak","Sirloin Steak","Short Ribs","Flank Steak","Round Steak","Cube Steak","Rump Roast","Ground Beef","Stew Meat","Soup Bones","Chicken Breast","Chicken Thighs","Chicken Wings","Chicken Liver","Chicken Heart","Gizzard","Bacon","Ham","Pork Belly","Pork Rib Roast","Pork Ribs","Pork Steak","Pork Tenderloin","Pork Shoulder","Sausage","Pork Chops","Ground Pork","Lamb Rib","Lamb Shank","Lamb Breast","Lamb Sirloin","Lamb Neck","Pekin Duck","Turkey"] price = { "Peach" : 1.3, "Blueberry" : 5.4, "Mango" : 3.8, "Cherry" : 6.6, "Watermelon" : 2.7, "Lemon" : 4.9, "Orange" : 1.2, "Pear" : 3.9, "Grapes" : 3.2, "Pineapple" : 1.5, "Raspberry" : 6.3, "Kiwi" : 4.3, "Apricot" : 4.2, "Lychee" : 6.6, "Grapefruit" : 3.6, "Apple" : 3.4, "Guava" : 4.6, "Banana" : 3.3, "Papaya" : 2.9, "Cantaloup" : 4.5, "Nectarine" : 5.4, "Pomegranate" : 6.0, "Plum" : 3.6, "Mandarin" : 3.1, "Jackfruit" : 0.4, "Melon" : 3.6, "Coconut" : 6.0, "Dragon Fruit" : 1.7, "Cloudberry" : 3.5, "Pineberry" : 6.4, "Passionfruit" : 3.1, "Tamarillo" : 6.1, "Tamarind" : 5.1, "Tangelo" : 3.6, "Tayberry" : 6.3, "Lime" : 4.4, "Loquat" : 5.0, "Longan" : 1.8, "Feijoa" : 6.9, "Fig" : 6.6, "Arabica" : 6.2, "Bourbon" : 4.6, "Catimor" : 5.1, "Catuai" : 1.6, "Caturra" : 3.5, "Excelsa" : 4.5, "Geisha" : 3.1, "Icatu" : 1.4, "Jackson" : 2.5, "Jamaican" : 4.1, "Jember" : 0.7, "Kent" : 1.0, "Kona Typica" : 3.1, "Liberica" : 0.4, "Maracatu" : 5.9, "Maragogype" : 5.8, "Mocca" : 3.3, "Mundo" : 0.5, "Pacamara" : 4.5, "Pacas" : 0.6, "Arusha" : 1.7, "Benguet" : 1.3, "Bernardina" : 4.5, "Charrier" : 0.9, "Harar" : 6.4, "Sidamo" : 6.7, "Yirgacheffe" : 2.2, "Bonifieur" : 5.4, "Kona" : 2.6, "Java" : 4.2, "Maragogipe" : 3.6, "Maragaturra" : 6.0, "Mocha" : 4.7, "Sagada" : 1.9, "Santos" : 6.1, "Sarchimor" : 1.6, "Typica" : 5.7, "Uganda" : 6.3, "Brutte" : 4.2, "Starmaya" : 6.1, "Anchovies" : 0.9, "Anglerfish" : 2.1, "Barracuda" : 1.7, "Bass" : 5.2, "Blowfish" : 1.5, "Bluefish" : 3.5, "Bonito" : 0.2, "Bream" : 4.0, "Burbot" : 0.1, "Carp" : 6.1, "Catfish" : 6.2, "Dogfish" : 3.3, "Dorade" : 5.9, "Flounder" : 1.2, "Grouper" : 0.1, "Haddock" : 2.1, "Halibut" : 0.1, "Herring" : 1.9, "Lamprey" : 4.1, "Monkfish" : 1.6, "Mullet" : 1.1, "Parrotfish" : 4.8, "Perch" : 4.3, "Pike" : 6.9, "Pilchard" : 4.0, "Pollock" : 2.0, "Pomfret" : 2.5, "Pompano" : 2.2, "Sablefish" : 1.7, "Sardine" : 0.8, "Shark" : 1.4, "Skate" : 5.8, "Sturgeon" : 1.5, "Surimi" : 5.8, "Swordfish" : 5.1, "Tilapia" : 4.6, "Tilefish" : 3.1, "Turbot" : 6.4, "Wahoo" : 0.9, "Whiting" : 4.0, "Artichokes" : 2.1, "Arugula" : 3.9, "Asparagus" : 0.3, "Avocados" : 4.6, "Basil" : 4.4, "Beets" : 5.4, "Broccoli" : 5.6, "Carrots" : 1.0, "Cauliflower" : 5.4, "Chard" : 2.1, "Corn" : 4.5, "Cucumber" : 2.6, "Eggplant" : 1.4, "Fennel" : 6.0, "Fiddleheads" : 1.0, "Garlic" : 0.9, "Green Onions" : 1.5, "Kohlrabi" : 0.5, "Morels" : 2.5, "Mushrooms" : 4.9, "Nettles" : 2.3, "Lettuce" : 1.5, "Okra" : 2.5, "Parsley" : 0.5, "Potatoes" : 3.1, "Radish" : 0.9, "Rhubarb" : 6.1, "Spinach" : 4.7, "Spring Onions" : 4.5, "Tomatoes" : 3.4, "Turnips" : 4.1, "Bok Choy" : 5.5, "Broccolini" : 3.6, "Cabbage" : 3.8, "Celeriac" : 3.0, "Celery" : 3.4, "Daikon" : 4.4, "Parsnips" : 3.1, "Kale" : 4.9, "Leeks" : 0.4, "Ribeye Steak" : 6.3, "Rib Roast" : 7.0, "Arm Roast" : 6.1, "Chuck Roast" : 5.3, "Chuck Steak" : 0.4, "Brisket" : 1.0, "T-Bone Steak" : 2.6, "Sirloin Steak" : 4.8, "Short Ribs" : 1.8, "Flank Steak" : 1.1, "Round Steak" : 1.1, "Cube Steak" : 4.2, "Rump Roast" : 5.9, "Ground Beef" : 2.2, "Stew Meat" : 7.0, "Soup Bones" : 2.3, "Chicken Breast" : 0.9, "Chicken Thighs" : 3.8, "Chicken Wings" : 2.1, "Chicken Liver" : 6.4, "Chicken Heart" : 0.7, "Gizzard" : 5.9, "Bacon" : 5.9, "Ham" : 3.6, "Pork Belly" : 2.4, "Pork Rib Roast" : 2.5, "Pork Ribs" : 3.8, "Pork Steak" : 2.4, "Pork Tenderloin" : 3.9, "Pork Shoulder" : 6.7, "Sausage" : 0.2, "Pork Chops" : 1.4, "Ground Pork" : 5.9, "Lamb Rib" : 1.7, "Lamb Shank" : 1.0, "Lamb Breast" : 1.2, "Lamb Sirloin" : 6.9, "Lamb Neck" : 3.6, "Pekin Duck" : 4.8, "Turkey" : 4.6 } weight = { "Peach" : 5.0, "Blueberry" : 5.5, "Mango" : 4.0, "Cherry" : 3.5, "Watermelon" : 6.0, "Lemon" : 6.5, "Orange" : 8.5, "Pear" : 5.0, "Grapes" : 7.5, "Pineapple" : 4.0, "Raspberry" : 5.0, "Kiwi" : 0.5, "Apricot" : 6.5, "Lychee" : 8.0, "Grapefruit" : 4.0, "Apple" : 5.5, "Guava" : 4.5, "Banana" : 7.0, "Papaya" : 9.0, "Cantaloup" : 8.5, "Nectarine" : 2.0, "Pomegranate" : 1.0, "Plum" : 3.5, "Mandarin" : 9.0, "Jackfruit" : 8.0, "Melon" : 2.5, "Coconut" : 3.0, "Dragon Fruit" : 3.5, "Cloudberry" : 9.0, "Pineberry" : 1.0, "Passionfruit" : 2.0, "Tamarillo" : 8.5, "Tamarind" : 7.5, "Tangelo" : 0.5, "Tayberry" : 2.0, "Lime" : 3.5, "Loquat" : 6.0, "Longan" : 7.5, "Feijoa" : 6.5, "Fig" : 2.5, "Arabica" : 1.0, "Bourbon" : 3.0, "Catimor" : 5.5, "Catuai" : 6.0, "Caturra" : 9.0, "Excelsa" : 3.0, "Geisha" : 6.0, "Icatu" : 7.0, "Jackson" : 9.0, "Jamaican" : 0.5, "Jember" : 1.5, "Kent" : 0.5, "Kona Typica" : 9.0, "Liberica" : 3.0, "Maracatu" : 1.5, "Maragogype" : 4.5, "Mocca" : 9.0, "Mundo" : 6.5, "Pacamara" : 5.0, "Pacas" : 0.5, "Arusha" : 3.0, "Benguet" : 0.5, "Bernardina" : 6.5, "Charrier" : 3.0, "Harar" : 5.5, "Sidamo" : 5.5, "Yirgacheffe" : 1.0, "Bonifieur" : 4.0, "Kona" : 7.0, "Java" : 2.5, "Maragogipe" : 4.0, "Maragaturra" : 9.0, "Mocha" : 2.5, "Sagada" : 4.5, "Santos" : 5.0, "Sarchimor" : 3.0, "Typica" : 7.0, "Uganda" : 3.5, "Brutte" : 4.0, "Starmaya" : 8.5, "Anchovies" : 5.0, "Anglerfish" : 9.0, "Barracuda" : 3.0, "Bass" : 5.0, "Blowfish" : 5.0, "Bluefish" : 5.0, "Bonito" : 3.0, "Bream" : 9.0, "Burbot" : 4.0, "Carp" : 8.5, "Catfish" : 3.0, "Dogfish" : 4.0, "Dorade" : 1.0, "Flounder" : 9.0, "Grouper" : 3.5, "Haddock" : 6.0, "Halibut" : 6.0, "Herring" : 6.5, "Lamprey" : 6.5, "Monkfish" : 7.5, "Mullet" : 0.5, "Parrotfish" : 0.5, "Perch" : 9.0, "Pike" : 7.5, "Pilchard" : 9.0, "Pollock" : 1.0, "Pomfret" : 2.5, "Pompano" : 9.0, "Sablefish" : 1.5, "Sardine" : 8.5, "Shark" : 3.5, "Skate" : 1.5, "Sturgeon" : 8.0, "Surimi" : 4.0, "Swordfish" : 6.0, "Tilapia" : 8.5, "Tilefish" : 3.0, "Turbot" : 4.5, "Wahoo" : 6.0, "Whiting" : 4.0, "Artichokes" : 2.5, "Arugula" : 9.0, "Asparagus" : 8.0, "Avocados" : 2.0, "Basil" : 3.5, "Beets" : 5.5, "Broccoli" : 3.0, "Carrots" : 1.5, "Cauliflower" : 6.5, "Chard" : 7.5, "Corn" : 7.0, "Cucumber" : 5.0, "Eggplant" : 6.5, "Fennel" : 4.5, "Fiddleheads" : 3.0, "Garlic" : 9.0, "Green Onions" : 9.0, "Kohlrabi" : 2.0, "Morels" : 7.5, "Mushrooms" : 1.5, "Nettles" : 0.5, "Lettuce" : 8.0, "Okra" : 5.0, "Parsley" : 8.0, "Potatoes" : 5.0, "Radish" : 0.5, "Rhubarb" : 4.0, "Spinach" : 8.0, "Spring Onions" : 6.0, "Tomatoes" : 5.5, "Turnips" : 2.5, "Bok Choy" : 7.5, "Broccolini" : 4.0, "Cabbage" : 7.0, "Celeriac" : 5.0, "Celery" : 4.5, "Daikon" : 1.0, "Parsnips" : 4.0, "Kale" : 4.0, "Leeks" : 5.0, "Ribeye Steak" : 4.0, "Rib Roast" : 1.0, "Arm Roast" : 9.0, "Chuck Roast" : 6.0, "Chuck Steak" : 4.0, "Brisket" : 3.0, "T-Bone Steak" : 0.5, "Sirloin Steak" : 4.5, "Short Ribs" : 1.5, "Flank Steak" : 9.0, "Round Steak" : 4.5, "Cube Steak" : 1.5, "Rump Roast" : 7.5, "Ground Beef" : 7.5, "Stew Meat" : 7.0, "Soup Bones" : 3.0, "Chicken Breast" : 3.0, "Chicken Thighs" : 1.5, "Chicken Wings" : 3.5, "Chicken Liver" : 3.5, "Chicken Heart" : 1.0, "Gizzard" : 9.0, "Bacon" : 7.5, "Ham" : 3.0, "Pork Belly" : 7.5, "Pork Rib Roast" : 0.5, "Pork Ribs" : 2.0, "Pork Steak" : 4.5, "Pork Tenderloin" : 8.0, "Pork Shoulder" : 6.5, "Sausage" : 3.5, "Pork Chops" : 7.0, "Ground Pork" : 4.0, "Lamb Rib" : 6.0, "Lamb Shank" : 4.5, "Lamb Breast" : 5.0, "Lamb Sirloin" : 2.5, "Lamb Neck" : 8.5, "Pekin Duck" : 5.5, "Turkey" : 9.0 } fruit_choice = random.choice(fruit_list) coffee_choice = random.choice(coffee_list) seafood_choice = random.choice(seafood_list) vege_choice = random.choice(vege_list) meat_choice = random.choice(meat_list) item = { "Fruit" : fruit_choice, "Coffee" : coffee_choice, "Seafood" : seafood_choice, "Vege" : vege_choice, "Meat" : meat_choice } player.item_1_p = item[player.cat_1_p] player.item_2_p = item[player.cat_2_p] player.item_3_p = item[player.cat_3_p] player.p_1_p = price[player.item_1_p] player.p_2_p = price[player.item_2_p] player.p_3_p = price[player.item_3_p] player.w_1_p = weight[player.item_1_p] player.w_2_p = weight[player.item_2_p] player.w_3_p = weight[player.item_3_p] if player.round_number == 1: return True else: return False @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_1_p = player.item_1_p, cat_1_p = player.cat_1_p, w_1_p = player.w_1_p, p_1_p = player.p_1_p, start_time_practice = player.start_time_practice) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_p1 = (player.end_time_p1 - player.start_time_p1)/1000 class PracticeItem2(Page): form_model = 'player' live_method = 'live_method_p2' @staticmethod def is_displayed(player: Player): player.item_num = (player.round_number -1 ) * 5 + 2 if player.round_number == 1: return True else: return False @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_2_p = player.item_2_p, cat_2_p = player.cat_2_p, w_2_p = player.w_2_p, p_2_p = player.p_2_p, start_time_practice = player.start_time_practice, end_time_p1 = player.end_time_p1) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_p2 = (player.end_time_p2 - player.start_time_p2)/1000 class PracticeItem3(Page): form_model = 'player' live_method = 'live_method_p3' @staticmethod def is_displayed(player: Player): player.item_num = (player.round_number -1 ) * 5 + 3 if player.round_number == 1: return True else: return False @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_3_p = player.item_3_p, cat_3_p = player.cat_3_p, w_3_p = player.w_3_p, p_3_p = player.p_3_p, start_time_practice = player.start_time_practice, end_time_p2 = player.end_time_p2) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_p3 = (player.end_time_p3 - player.start_time_p3)/1000 import numpy as np time_spent_p_array = np.array([player.time_spent_p1, player.time_spent_p2, player.time_spent_p3]) player.time_per_item_lb = round(np.min(time_spent_p_array)) player.time_per_item_ub = round(np.max(time_spent_p_array)) player.time_total_lb = round(player.time_per_item_lb*player.item_n_to_play, 0) player.time_total_ub = round(player.time_per_item_ub*player.item_n_to_play, 0) class PracticeRoundSummary(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): if player.round_number == 1: return True else: return False class WelcometoMainExp(Page): form_model = 'player' live_method = 'live_method_WME' @staticmethod def is_displayed(player: Player): if player.round_number == 1: return True else: return False class SelectedCheckoutMethod(Page): form_model = 'player' live_method = 'live_method_SCM' @staticmethod def is_displayed(player: Player): if player.in_round(1).checkout_option_selection == 1: player.co_method = "Self checkout" else: player.co_method = "Cashier checkout" if player.round_number == 1: return True else: return False class Item1(Page): form_model = 'player' live_method = 'live_method_q1' @staticmethod def is_displayed(player: Player): group = player.group player.item_num = (player.round_number -1 ) * 5 + 1 player.co_method = player.in_round(1).co_method # Shuffle Categories - only need for item 1, 6, 11 import random random.seed(player.round_number*player.id_in_group) cat_array = ["Fruit", "Coffee", "Seafood", "Vege", "Meat"]; random.shuffle(cat_array) player.cat_1 = cat_array[0] player.cat_2 = cat_array[1] player.cat_3 = cat_array[2] player.cat_4 = cat_array[3] player.cat_5 = cat_array[4] # Items fruit_list = ["Peach","Blueberry","Mango","Cherry","Watermelon","Lemon","Orange","Pear","Grapes","Pineapple","Raspberry","Kiwi","Apricot","Lychee","Grapefruit","Apple","Guava","Banana","Papaya","Cantaloup","Nectarine","Pomegranate","Plum","Mandarin","Jackfruit","Melon","Coconut","Dragon Fruit","Cloudberry","Pineberry","Passionfruit","Tamarillo","Tamarind","Tangelo","Tayberry","Lime","Loquat","Longan","Feijoa","Fig"] coffee_list = ["Arabica","Bourbon","Catimor","Catuai","Caturra","Excelsa","Geisha","Icatu","Jackson","Jamaican","Jember","Kent","Kona Typica","Liberica","Maracatu","Maragogype","Mocca","Mundo","Pacamara","Pacas","Arusha","Benguet","Bernardina","Charrier","Harar","Sidamo","Yirgacheffe","Bonifieur","Kona","Java","Maragogipe","Maragaturra","Mocha","Sagada","Santos","Sarchimor","Typica","Uganda","Brutte","Starmaya"] seafood_list = ["Anchovies","Anglerfish","Barracuda","Bass","Blowfish","Bluefish","Bonito","Bream","Burbot","Carp","Catfish","Dogfish","Dorade","Flounder","Grouper","Haddock","Halibut","Herring","Lamprey","Monkfish","Mullet","Parrotfish","Perch","Pike","Pilchard","Pollock","Pomfret","Pompano","Sablefish","Sardine","Shark","Skate","Sturgeon","Surimi","Swordfish","Tilapia","Tilefish","Turbot","Wahoo","Whiting"] vege_list = ["Artichokes","Arugula","Asparagus","Avocados","Basil","Beets","Broccoli","Carrots","Cauliflower","Chard","Corn","Cucumber","Eggplant","Fennel","Fiddleheads","Garlic","Green Onions","Kohlrabi","Morels","Mushrooms","Nettles","Lettuce","Okra","Parsley","Potatoes","Radish","Rhubarb","Spinach","Spring Onions","Tomatoes","Turnips","Bok Choy","Broccolini","Cabbage","Celeriac","Celery","Daikon","Parsnips","Kale","Leeks"] meat_list = ["Ribeye Steak","Rib Roast","Arm Roast","Chuck Roast","Chuck Steak","Brisket","T-Bone Steak","Sirloin Steak","Short Ribs","Flank Steak","Round Steak","Cube Steak","Rump Roast","Ground Beef","Stew Meat","Soup Bones","Chicken Breast","Chicken Thighs","Chicken Wings","Chicken Liver","Chicken Heart","Gizzard","Bacon","Ham","Pork Belly","Pork Rib Roast","Pork Ribs","Pork Steak","Pork Tenderloin","Pork Shoulder","Sausage","Pork Chops","Ground Pork","Lamb Rib","Lamb Shank","Lamb Breast","Lamb Sirloin","Lamb Neck","Pekin Duck","Turkey"] price = { "Peach" : 1.3, "Blueberry" : 5.4, "Mango" : 3.8, "Cherry" : 6.6, "Watermelon" : 2.7, "Lemon" : 4.9, "Orange" : 1.2, "Pear" : 3.9, "Grapes" : 3.2, "Pineapple" : 1.5, "Raspberry" : 6.3, "Kiwi" : 4.3, "Apricot" : 4.2, "Lychee" : 6.6, "Grapefruit" : 3.6, "Apple" : 3.4, "Guava" : 4.6, "Banana" : 3.3, "Papaya" : 2.9, "Cantaloup" : 4.5, "Nectarine" : 5.4, "Pomegranate" : 6.0, "Plum" : 3.6, "Mandarin" : 3.1, "Jackfruit" : 0.4, "Melon" : 3.6, "Coconut" : 6.0, "Dragon Fruit" : 1.7, "Cloudberry" : 3.5, "Pineberry" : 6.4, "Passionfruit" : 3.1, "Tamarillo" : 6.1, "Tamarind" : 5.1, "Tangelo" : 3.6, "Tayberry" : 6.3, "Lime" : 4.4, "Loquat" : 5.0, "Longan" : 1.8, "Feijoa" : 6.9, "Fig" : 6.6, "Arabica" : 6.2, "Bourbon" : 4.6, "Catimor" : 5.1, "Catuai" : 1.6, "Caturra" : 3.5, "Excelsa" : 4.5, "Geisha" : 3.1, "Icatu" : 1.4, "Jackson" : 2.5, "Jamaican" : 4.1, "Jember" : 0.7, "Kent" : 1.0, "Kona Typica" : 3.1, "Liberica" : 0.4, "Maracatu" : 5.9, "Maragogype" : 5.8, "Mocca" : 3.3, "Mundo" : 0.5, "Pacamara" : 4.5, "Pacas" : 0.6, "Arusha" : 1.7, "Benguet" : 1.3, "Bernardina" : 4.5, "Charrier" : 0.9, "Harar" : 6.4, "Sidamo" : 6.7, "Yirgacheffe" : 2.2, "Bonifieur" : 5.4, "Kona" : 2.6, "Java" : 4.2, "Maragogipe" : 3.6, "Maragaturra" : 6.0, "Mocha" : 4.7, "Sagada" : 1.9, "Santos" : 6.1, "Sarchimor" : 1.6, "Typica" : 5.7, "Uganda" : 6.3, "Brutte" : 4.2, "Starmaya" : 6.1, "Anchovies" : 0.9, "Anglerfish" : 2.1, "Barracuda" : 1.7, "Bass" : 5.2, "Blowfish" : 1.5, "Bluefish" : 3.5, "Bonito" : 0.2, "Bream" : 4.0, "Burbot" : 0.1, "Carp" : 6.1, "Catfish" : 6.2, "Dogfish" : 3.3, "Dorade" : 5.9, "Flounder" : 1.2, "Grouper" : 0.1, "Haddock" : 2.1, "Halibut" : 0.1, "Herring" : 1.9, "Lamprey" : 4.1, "Monkfish" : 1.6, "Mullet" : 1.1, "Parrotfish" : 4.8, "Perch" : 4.3, "Pike" : 6.9, "Pilchard" : 4.0, "Pollock" : 2.0, "Pomfret" : 2.5, "Pompano" : 2.2, "Sablefish" : 1.7, "Sardine" : 0.8, "Shark" : 1.4, "Skate" : 5.8, "Sturgeon" : 1.5, "Surimi" : 5.8, "Swordfish" : 5.1, "Tilapia" : 4.6, "Tilefish" : 3.1, "Turbot" : 6.4, "Wahoo" : 0.9, "Whiting" : 4.0, "Artichokes" : 2.1, "Arugula" : 3.9, "Asparagus" : 0.3, "Avocados" : 4.6, "Basil" : 4.4, "Beets" : 5.4, "Broccoli" : 5.6, "Carrots" : 1.0, "Cauliflower" : 5.4, "Chard" : 2.1, "Corn" : 4.5, "Cucumber" : 2.6, "Eggplant" : 1.4, "Fennel" : 6.0, "Fiddleheads" : 1.0, "Garlic" : 0.9, "Green Onions" : 1.5, "Kohlrabi" : 0.5, "Morels" : 2.5, "Mushrooms" : 4.9, "Nettles" : 2.3, "Lettuce" : 1.5, "Okra" : 2.5, "Parsley" : 0.5, "Potatoes" : 3.1, "Radish" : 0.9, "Rhubarb" : 6.1, "Spinach" : 4.7, "Spring Onions" : 4.5, "Tomatoes" : 3.4, "Turnips" : 4.1, "Bok Choy" : 5.5, "Broccolini" : 3.6, "Cabbage" : 3.8, "Celeriac" : 3.0, "Celery" : 3.4, "Daikon" : 4.4, "Parsnips" : 3.1, "Kale" : 4.9, "Leeks" : 0.4, "Ribeye Steak" : 6.3, "Rib Roast" : 7.0, "Arm Roast" : 6.1, "Chuck Roast" : 5.3, "Chuck Steak" : 0.4, "Brisket" : 1.0, "T-Bone Steak" : 2.6, "Sirloin Steak" : 4.8, "Short Ribs" : 1.8, "Flank Steak" : 1.1, "Round Steak" : 1.1, "Cube Steak" : 4.2, "Rump Roast" : 5.9, "Ground Beef" : 2.2, "Stew Meat" : 7.0, "Soup Bones" : 2.3, "Chicken Breast" : 0.9, "Chicken Thighs" : 3.8, "Chicken Wings" : 2.1, "Chicken Liver" : 6.4, "Chicken Heart" : 0.7, "Gizzard" : 5.9, "Bacon" : 5.9, "Ham" : 3.6, "Pork Belly" : 2.4, "Pork Rib Roast" : 2.5, "Pork Ribs" : 3.8, "Pork Steak" : 2.4, "Pork Tenderloin" : 3.9, "Pork Shoulder" : 6.7, "Sausage" : 0.2, "Pork Chops" : 1.4, "Ground Pork" : 5.9, "Lamb Rib" : 1.7, "Lamb Shank" : 1.0, "Lamb Breast" : 1.2, "Lamb Sirloin" : 6.9, "Lamb Neck" : 3.6, "Pekin Duck" : 4.8, "Turkey" : 4.6 } weight = { "Peach" : 5.0, "Blueberry" : 5.5, "Mango" : 4.0, "Cherry" : 3.5, "Watermelon" : 6.0, "Lemon" : 6.5, "Orange" : 8.5, "Pear" : 5.0, "Grapes" : 7.5, "Pineapple" : 4.0, "Raspberry" : 5.0, "Kiwi" : 0.5, "Apricot" : 6.5, "Lychee" : 8.0, "Grapefruit" : 4.0, "Apple" : 5.5, "Guava" : 4.5, "Banana" : 7.0, "Papaya" : 9.0, "Cantaloup" : 8.5, "Nectarine" : 2.0, "Pomegranate" : 1.0, "Plum" : 3.5, "Mandarin" : 9.0, "Jackfruit" : 8.0, "Melon" : 2.5, "Coconut" : 3.0, "Dragon Fruit" : 3.5, "Cloudberry" : 9.0, "Pineberry" : 1.0, "Passionfruit" : 2.0, "Tamarillo" : 8.5, "Tamarind" : 7.5, "Tangelo" : 0.5, "Tayberry" : 2.0, "Lime" : 3.5, "Loquat" : 6.0, "Longan" : 7.5, "Feijoa" : 6.5, "Fig" : 2.5, "Arabica" : 1.0, "Bourbon" : 3.0, "Catimor" : 5.5, "Catuai" : 6.0, "Caturra" : 9.0, "Excelsa" : 3.0, "Geisha" : 6.0, "Icatu" : 7.0, "Jackson" : 9.0, "Jamaican" : 0.5, "Jember" : 1.5, "Kent" : 0.5, "Kona Typica" : 9.0, "Liberica" : 3.0, "Maracatu" : 1.5, "Maragogype" : 4.5, "Mocca" : 9.0, "Mundo" : 6.5, "Pacamara" : 5.0, "Pacas" : 0.5, "Arusha" : 3.0, "Benguet" : 0.5, "Bernardina" : 6.5, "Charrier" : 3.0, "Harar" : 5.5, "Sidamo" : 5.5, "Yirgacheffe" : 1.0, "Bonifieur" : 4.0, "Kona" : 7.0, "Java" : 2.5, "Maragogipe" : 4.0, "Maragaturra" : 9.0, "Mocha" : 2.5, "Sagada" : 4.5, "Santos" : 5.0, "Sarchimor" : 3.0, "Typica" : 7.0, "Uganda" : 3.5, "Brutte" : 4.0, "Starmaya" : 8.5, "Anchovies" : 5.0, "Anglerfish" : 9.0, "Barracuda" : 3.0, "Bass" : 5.0, "Blowfish" : 5.0, "Bluefish" : 5.0, "Bonito" : 3.0, "Bream" : 9.0, "Burbot" : 4.0, "Carp" : 8.5, "Catfish" : 3.0, "Dogfish" : 4.0, "Dorade" : 1.0, "Flounder" : 9.0, "Grouper" : 3.5, "Haddock" : 6.0, "Halibut" : 6.0, "Herring" : 6.5, "Lamprey" : 6.5, "Monkfish" : 7.5, "Mullet" : 0.5, "Parrotfish" : 0.5, "Perch" : 9.0, "Pike" : 7.5, "Pilchard" : 9.0, "Pollock" : 1.0, "Pomfret" : 2.5, "Pompano" : 9.0, "Sablefish" : 1.5, "Sardine" : 8.5, "Shark" : 3.5, "Skate" : 1.5, "Sturgeon" : 8.0, "Surimi" : 4.0, "Swordfish" : 6.0, "Tilapia" : 8.5, "Tilefish" : 3.0, "Turbot" : 4.5, "Wahoo" : 6.0, "Whiting" : 4.0, "Artichokes" : 2.5, "Arugula" : 9.0, "Asparagus" : 8.0, "Avocados" : 2.0, "Basil" : 3.5, "Beets" : 5.5, "Broccoli" : 3.0, "Carrots" : 1.5, "Cauliflower" : 6.5, "Chard" : 7.5, "Corn" : 7.0, "Cucumber" : 5.0, "Eggplant" : 6.5, "Fennel" : 4.5, "Fiddleheads" : 3.0, "Garlic" : 9.0, "Green Onions" : 9.0, "Kohlrabi" : 2.0, "Morels" : 7.5, "Mushrooms" : 1.5, "Nettles" : 0.5, "Lettuce" : 8.0, "Okra" : 5.0, "Parsley" : 8.0, "Potatoes" : 5.0, "Radish" : 0.5, "Rhubarb" : 4.0, "Spinach" : 8.0, "Spring Onions" : 6.0, "Tomatoes" : 5.5, "Turnips" : 2.5, "Bok Choy" : 7.5, "Broccolini" : 4.0, "Cabbage" : 7.0, "Celeriac" : 5.0, "Celery" : 4.5, "Daikon" : 1.0, "Parsnips" : 4.0, "Kale" : 4.0, "Leeks" : 5.0, "Ribeye Steak" : 4.0, "Rib Roast" : 1.0, "Arm Roast" : 9.0, "Chuck Roast" : 6.0, "Chuck Steak" : 4.0, "Brisket" : 3.0, "T-Bone Steak" : 0.5, "Sirloin Steak" : 4.5, "Short Ribs" : 1.5, "Flank Steak" : 9.0, "Round Steak" : 4.5, "Cube Steak" : 1.5, "Rump Roast" : 7.5, "Ground Beef" : 7.5, "Stew Meat" : 7.0, "Soup Bones" : 3.0, "Chicken Breast" : 3.0, "Chicken Thighs" : 1.5, "Chicken Wings" : 3.5, "Chicken Liver" : 3.5, "Chicken Heart" : 1.0, "Gizzard" : 9.0, "Bacon" : 7.5, "Ham" : 3.0, "Pork Belly" : 7.5, "Pork Rib Roast" : 0.5, "Pork Ribs" : 2.0, "Pork Steak" : 4.5, "Pork Tenderloin" : 8.0, "Pork Shoulder" : 6.5, "Sausage" : 3.5, "Pork Chops" : 7.0, "Ground Pork" : 4.0, "Lamb Rib" : 6.0, "Lamb Shank" : 4.5, "Lamb Breast" : 5.0, "Lamb Sirloin" : 2.5, "Lamb Neck" : 8.5, "Pekin Duck" : 5.5, "Turkey" : 9.0 } item = { "Fruit" : random.choice(fruit_list), "Coffee" : random.choice(coffee_list), "Seafood" : random.choice(seafood_list), "Vege" : random.choice(vege_list), "Meat" : random.choice(meat_list) } player.item_1 = item[player.cat_1] player.item_2 = item[player.cat_2] player.item_3 = item[player.cat_3] player.item_4 = item[player.cat_4] player.item_5 = item[player.cat_5] player.p_1 = price[player.item_1] player.p_2 = price[player.item_2] player.p_3 = price[player.item_3] player.p_4 = price[player.item_4] player.p_5 = price[player.item_5] player.w_1 = weight[player.item_1] player.w_2 = weight[player.item_2] player.w_3 = weight[player.item_3] player.w_4 = weight[player.item_4] player.w_5 = weight[player.item_5] if player.round_number == 1: return True elif player.round_number == 2 and player.item_n_to_play > 5: return True elif player.round_number == 3 and player.item_n_to_play > 10: return True @staticmethod def js_vars(player: Player): if player.round_number == 1: return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_1 = player.item_1, cat_1 = player.cat_1, w_1 = player.w_1, p_1 = player.p_1, checkout_bonus_time = player.in_round(1).checkout_bonus_time, start_time_major = player.in_round(1).start_time_major, start_time_for_item1 = player.in_round(1).start_time_major, cashier_time_1 = player.cashier_time_1) else: return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_1 = player.item_1, cat_1 = player.cat_1, w_1 = player.w_1, p_1 = player.p_1, checkout_bonus_time = player.in_round(1).checkout_bonus_time, start_time_major = player.in_round(1).start_time_major, start_time_for_item1 = player.in_round(player.round_number-1).end_time_q5, cashier_time_1 = player.cashier_time_1) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_q1 = (player.end_time_q1 - player.start_time_q1)/1000 class Item2(Page): form_model = 'player' live_method = 'live_method_q2' @staticmethod def is_displayed(player: Player): player.item_num = (player.round_number -1 ) * 5 + 2 if player.round_number == 1: return True elif player.round_number == 2 and player.item_n_to_play > 5: return True elif player.round_number == 3 and player.item_n_to_play > 10: return True @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_2 = player.item_2, cat_2 = player.cat_2, w_2 = player.w_2, p_2 = player.p_2, checkout_bonus_time = player.in_round(1).checkout_bonus_time, start_time_major = player.in_round(1).start_time_major, end_time_q1 = player.end_time_q1, cashier_time_2 = player.cashier_time_2) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_q2 = (player.end_time_q2 - player.start_time_q2)/1000 class Item3(Page): form_model = 'player' live_method = 'live_method_q3' @staticmethod def is_displayed(player: Player): player.item_num = (player.round_number -1 ) * 5 + 3 if player.round_number == 1: return True elif player.round_number == 2 and player.item_n_to_play > 5: return True elif player.round_number == 3 and player.item_n_to_play > 10: return True @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_3 = player.item_3, cat_3 = player.cat_3, w_3 = player.w_3, p_3 = player.p_3, checkout_bonus_time = player.in_round(1).checkout_bonus_time, start_time_major = player.in_round(1).start_time_major, end_time_q2 = player.end_time_q2, cashier_time_3 = player.cashier_time_3) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_q3 = (player.end_time_q3 - player.start_time_q3)/1000 class Item4(Page): form_model = 'player' live_method = 'live_method_q4' @staticmethod def is_displayed(player: Player): player.item_num = (player.round_number -1 ) * 5 + 4 if player.round_number == 1: return True elif player.round_number == 2 and player.item_n_to_play > 5: return True elif player.round_number == 3 and player.item_n_to_play > 10: return True @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_4 = player.item_4, cat_4 = player.cat_4, w_4 = player.w_4, p_4 = player.p_4, checkout_bonus_time = player.in_round(1).checkout_bonus_time, start_time_major = player.in_round(1).start_time_major, end_time_q3 = player.end_time_q3, cashier_time_4 = player.cashier_time_4) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_q4 = (player.end_time_q4 - player.start_time_q4)/1000 class Item5(Page): form_model = 'player' live_method = 'live_method_q5' @staticmethod def is_displayed(player: Player): player.item_num = (player.round_number -1 ) * 5 + 5 if player.round_number == 1: return True elif player.round_number == 2 and player.item_n_to_play > 5: return True elif player.round_number == 3 and player.item_n_to_play > 10: return True @staticmethod def js_vars(player: Player): return dict(round_number = player.round_number, treatment_difficulty = player.treatment_difficulty, treatment_timepressure = player.treatment_timepressure, item_num = player.item_num, item_5 = player.item_5, cat_5 = player.cat_5, w_5 = player.w_5, p_5 = player.p_5, checkout_bonus_time = player.in_round(1).checkout_bonus_time, start_time_major = player.in_round(1).start_time_major, end_time_q4 = player.end_time_q4, cashier_time_5 = player.cashier_time_5) @staticmethod def before_next_page(player: Player, timeout_happened): player.time_spent_q5 = (player.end_time_q5 - player.start_time_q5)/1000 class BeforeSurvey(Page): form_model = 'player' form_fields = ['survey0'] @staticmethod def is_displayed(player: Player): if player.round_number == 3: return True else: return False @staticmethod def error_message(player: Player, values): num_answered_survey = 0 if values["survey0"] > 0: num_answered_survey = num_answered_survey + 1 player.survey0 = values["survey0"] if num_answered_survey < 1: return "The question must be answered to proceed. Please fix." class Survey(Page): form_model = 'player' form_fields = ['survey1', 'survey2', 'survey3', 'survey4', 'survey5', 'survey6', 'survey7', 'survey8', 'survey9', 'surveyage', 'surveygender', 'surveyedu', 'surveydevice'] @staticmethod def is_displayed(player: Player): if player.round_number == 3: return True else: return False @staticmethod def error_message(player: Player, values): num_answered_survey = 0 if values["survey1"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey2"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey3"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey4"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey5"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey6"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey7"] > 0: num_answered_survey = num_answered_survey + 1 if values["survey8"] > 0: num_answered_survey = num_answered_survey + 1 if values["surveyage"] > 0: num_answered_survey = num_answered_survey + 1 if values["surveygender"] > 0: num_answered_survey = num_answered_survey + 1 if values["surveyedu"] > 0: num_answered_survey = num_answered_survey + 1 if values["surveydevice"] > 0: num_answered_survey = num_answered_survey + 1 player.survey1 = values["survey1"] player.survey2 = values["survey2"] player.survey3 = values["survey3"] player.survey4 = values["survey4"] player.survey5 = values["survey5"] player.survey6 = values["survey6"] player.survey7 = values["survey7"] player.survey8 = values["survey8"] player.surveyage = values["surveyage"] player.surveygender = values["surveygender"] player.surveyedu = values["surveyedu"] player.surveydevice = values["surveydevice"] if num_answered_survey < 12: return "All questions must be answered to proceed. Please fix." class MturkCompletionCode(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): if player.round_number == 3: # if sum(filter(None, [player.in_round(1).time_spent_q1, player.in_round(1).time_spent_q2, player.in_round(1).time_spent_q3, player.in_round(1).time_spent_q4, player.in_round(1).time_spent_q5, player.in_round(2).time_spent_q1, player.in_round(2).time_spent_q2, player.in_round(2).time_spent_q3, player.in_round(2).time_spent_q4, player.in_round(2).time_spent_q5, player.time_spent_q1, player.time_spent_q2, player.time_spent_q3, player.time_spent_q4, player.time_spent_q5])) < player.in_round(1).checkout_bonus_time: if max(player.in_round(1).total_time_use, player.in_round(2).total_time_use, player.total_time_use) < player.in_round(1).checkout_bonus_time: player.payoff = 1.99 else: player.payoff = 0.99 return True else: return False @staticmethod def js_vars(player: Player): group = player.group participant = player.participant return dict( participant_label = float(player.id_in_group) ) page_sequence = [AssignParticipantTreatment, ConsentDisclosure, InstructionQuizANDTimeSetup, FailQuiz, PassQuizCongrats, PracticeItem1, PracticeItem2, PracticeItem3, PracticeRoundSummary, WelcometoMainExp, SelectedCheckoutMethod, Item1, Item2, Item3, Item4, Item5, BeforeSurvey, Survey, MturkCompletionCode]