from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, ) class Constants(BaseConstants): name_in_url = 'choice' players_per_group = None num_rounds = 3 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def choices(): choice00000 = (0, 1) #0 is with distractions and 1 is without distractions but with point deducted return choice00000 def budget(): budget00000 = (0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100) return budget00000 def make_field(label): return models.StringField( choices=[0, 1], label=label, widget=widgets.RadioSelectHorizontal ) class Player(BasePlayer): time_spent = models.FloatField() points = models.IntegerField(min=-1000) score_on_display = models.IntegerField(min=-1000) total_green = models.IntegerField() total_gray = models.IntegerField() total_wrong = models.IntegerField() total_right = models.IntegerField() wrong_green = models.IntegerField() #correct should be green wrong_gray = models.IntegerField() #correct should be gray right_green = models.IntegerField() right_gray = models.IntegerField() board_history = models.LongStringField() #if each cell is correct or not (1 for correct color, 0 for wrong color) time_between_moves = models.LongStringField() solve_order = models.LongStringField() total_wrong_adding_no_distraction = models.IntegerField() final_points_no_distraction = models.FloatField(max=30, min=0) final_payoff_no_distraction = models.FloatField(max=30, min=0) game_finished = models.IntegerField() adding_numbers1_correct = models.IntegerField() adding_numbers1_time_spent = models.FloatField() adding_numbers2_correct = models.IntegerField() adding_numbers2_time_spent = models.FloatField() adding_numbers3_correct = models.IntegerField() adding_numbers3_time_spent = models.FloatField() adding_numbers4_correct = models.IntegerField() adding_numbers4_time_spent = models.FloatField() adding_numbers5_correct = models.IntegerField() adding_numbers5_time_spent = models.FloatField() time_spent_podcast = models.FloatField() points_podcast = models.IntegerField(min=-1000) score_on_display_podcast = models.IntegerField(min=-1000) total_green_podcast = models.IntegerField() total_gray_podcast = models.IntegerField() total_wrong_podcast = models.IntegerField() total_right_podcast = models.IntegerField() wrong_green_podcast = models.IntegerField() #correct should be green wrong_gray_podcast = models.IntegerField() #correct should be gray right_green_podcast = models.IntegerField() right_gray_podcast = models.IntegerField() board_history_podcast = models.LongStringField() #if each cell is correct or not (1 for correct color, 0 for wrong color) time_between_moves_podcast = models.LongStringField() solve_order_podcast = models.LongStringField() total_wrong_adding_podcast = models.IntegerField() final_points_podcast = models.FloatField(max=30, min=0) final_payoff_podcast = models.FloatField(max=30, min=0) game_finished_podcast = models.IntegerField() adding_numbers1_correct_podcast = models.IntegerField() adding_numbers1_time_spent_podcast = models.FloatField() adding_numbers2_correct_podcast = models.IntegerField() adding_numbers2_time_spent_podcast = models.FloatField() adding_numbers3_correct_podcast = models.IntegerField() adding_numbers3_time_spent_podcast = models.FloatField() adding_numbers4_correct_podcast = models.IntegerField() adding_numbers4_time_spent_podcast = models.FloatField() adding_numbers5_correct_podcast = models.IntegerField() adding_numbers5_time_spent_podcast = models.FloatField() interruption_time = models.LongStringField() time_spent_total1 = models.FloatField() time_spent_nono1 = models.FloatField() points1 = models.IntegerField(min=-1000) #is the points for current game score_on_display1 = models.IntegerField(min=-1000) #is the total points for all games if a game 2 or 3 is present total_green1 = models.IntegerField() total_gray1 = models.IntegerField() total_wrong1 = models.IntegerField() total_right1 = models.IntegerField() wrong_green1 = models.IntegerField() #correct should be green wrong_gray1 = models.IntegerField() #correct should be gray right_green1 = models.IntegerField() right_gray1 = models.IntegerField() board_history1 = models.LongStringField() #if each cell is correct or not (1 for correct color, 0 for wrong color) time_between_moves1 = models.LongStringField() solve_order1 = models.LongStringField() #number of the tile indicates the order of it being filled (if the 5th tile is filled in the last, it has a number of 100) interruption_time1 = models.LongStringField() gap_history1 = models.LongStringField() #gap history is the time taken to solve each adding numbers task game1_finished = models.IntegerField() time_spent_total2 = models.FloatField() time_spent_nono2 = models.FloatField() points2 = models.IntegerField(min=-1000) #is the points for current game score_on_display2 = models.IntegerField(min=-1000) #is the total points for all games if a game 2 or 3 is present total_green2 = models.IntegerField() total_gray2 = models.IntegerField() total_wrong2 = models.IntegerField() total_right2 = models.IntegerField() wrong_green2 = models.IntegerField() #correct should be green wrong_gray2 = models.IntegerField() #correct should be gray right_green2 = models.IntegerField() right_gray2 = models.IntegerField() board_history2 = models.LongStringField() #if each cell is correct or not (1 for correct color, 0 for wrong color) time_between_moves2 = models.LongStringField() solve_order2 = models.LongStringField() #number of the tile indicates the order of it being filled (if the 5th tile is filled in the last, it has a number of 100) interruption_time2 = models.LongStringField() gap_history2 = models.LongStringField() #gap history is the time taken to solve each adding numbers task game2_finished = models.IntegerField() time_spent_total3 = models.FloatField() time_spent_nono3 = models.FloatField() points3 = models.IntegerField(min=-1000) #is the points for current game score_on_display3 = models.IntegerField(min=-1000) #is the total points for all games if a game 2 or 3 is present total_green3 = models.IntegerField() total_gray3 = models.IntegerField() total_wrong3 = models.IntegerField() total_right3 = models.IntegerField() wrong_green3 = models.IntegerField() #correct should be green wrong_gray3 = models.IntegerField() #correct should be gray right_green3 = models.IntegerField() right_gray3 = models.IntegerField() board_history3 = models.LongStringField() #if each cell is correct or not (1 for correct color, 0 for wrong color) time_between_moves3 = models.LongStringField() solve_order3 = models.LongStringField() #number of the tile indicates the order of it being filled (if the 5th tile is filled in the last, it has a number of 100) interruption_time3 = models.LongStringField() gap_history3 = models.LongStringField() #gap history is the time taken to solve each adding numbers task game3_finished = models.IntegerField() gap_history = models.LongStringField() total_wrong_adding_forced = models.IntegerField() final_points_forced = models.FloatField(max=30, min=0) final_payoff_forced = models.FloatField(max=30, min=0) decision_chosen = models.IntegerField() treatment_assigned = models.IntegerField() final_payoff_choice = models.FloatField(max=30, min=0) forcedchoice1 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[0]) + ' point deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice2 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[1]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice3 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[2]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice4 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[3]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice5 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[4]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice6 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[5]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice7 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[6]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice8 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[7]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice9 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[8]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice10 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[9]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice11 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[10]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice12 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[11]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice13 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[12]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice14 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[13]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice15 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[14]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice16 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[15]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice17 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[16]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice18 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[17]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice19 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[18]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice20 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[19]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) forcedchoice21 = models.StringField( choices=[ [str(choices()[0]), 'Interruptions'], [str(choices()[1]), 'Sequential with ' + str(budget()[20]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice1 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[0]) + ' point deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice2 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[1]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice3 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[2]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice4 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[3]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice5 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[4]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice6 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[5]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice7 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[6]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice8 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[7]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice9 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[8]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice10 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[9]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice11 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[10]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice12 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[11]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice13 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[12]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice14 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[13]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice15 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[14]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice16 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[15]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice17 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[16]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice18 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[17]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice19 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[18]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice20 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[19]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal ) podcastchoice21 = models.StringField( choices=[ [str(choices()[0]), 'Conversation'], [str(choices()[1]), 'Sequential with ' + str(budget()[20]) + ' points deducted'], ], label="", widget=widgets.RadioSelectHorizontal )