#from otree.api import ( # models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, # Currency as c, currency_range #) from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random doc = """ """ class Constants(BaseConstants): name_in_url = 'cs' players_per_group = None # original: num_rounds = 3 num_rounds = 2 min_balls = 0 max_balls = 29 beliefs_01_instructions = 'confidence_stopping/instructions_page.html' b1_instructions = 'confidence_stopping/b1_instructions.html' b_initial_instructions = 'confidence_stopping/b_initial_instructions.html' b2_instructions = 'confidence_stopping/b2_instructions.html' b3_instructions = 'confidence_stopping/b3_instructions.html' dec_instructions = 'confidence_stopping/dec_instructions.html' dec_initial_instructions = 'confidence_stopping/dec_initial_instructions.html' jc_instructions = 'confidence_stopping/jc_instructions.html' uic_instructions = 'confidence_stopping/uic_instructions.html' #prob=50 #prob=80 cost = 3 #cost = 10 endowment = 99 prob_process = 50 #prob_process = 80 threshold = 15 min_conf = 0 max_conf = 100 personality_template = 'de_control/personality_header.html' #show_up_fee = 5 ### CREATING VARIABLES FOR THE PURPOSE OF COMPUTING PERSONALITY AVERAGE SCORES ### num_e = 8 num_a = 9 num_c = 9 num_n = 8 num_o = 10 # instructions_template = 'lemon_market/Instructions.html' #initial_endowment = c(50) #buyer_extra_value = c(5) class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): ### ALGORITHM DRAFT 2 ### ## creating blank vectors for each color and how many red have been drawn so far col_red = [] num_red_drawn_so_far = [] ## filling in the first values as 0 col_red.append(0) num_red_drawn_so_far.append(0) for i in range(0, Constants.max_balls): col_red.append(random.randint(0, 1)) num_red_drawn_so_far.append(sum(col_red)) p.col_red_01 = col_red[0] p.col_red_02 = col_red[1] p.col_red_03 = col_red[2] p.col_red_04 = col_red[3] p.col_red_05 = col_red[4] p.col_red_06 = col_red[5] p.col_red_07 = col_red[6] p.col_red_08 = col_red[7] p.col_red_09 = col_red[8] p.col_red_10 = col_red[9] p.col_red_11 = col_red[10] p.col_red_12 = col_red[11] p.col_red_13 = col_red[12] p.col_red_14 = col_red[13] p.col_red_15 = col_red[14] p.col_red_16 = col_red[15] p.col_red_17 = col_red[16] p.col_red_18 = col_red[17] p.col_red_19 = col_red[18] p.col_red_20 = col_red[19] p.col_red_21 = col_red[20] p.col_red_22 = col_red[21] p.col_red_23 = col_red[22] p.col_red_24 = col_red[23] p.col_red_25 = col_red[24] p.col_red_26 = col_red[25] p.col_red_27 = col_red[26] p.col_red_28 = col_red[27] p.col_red_29 = col_red[28] p.col_red_30 = col_red[29] p.num_red_drawn_so_far_01 = num_red_drawn_so_far[0] p.num_red_drawn_so_far_02 = num_red_drawn_so_far[1] p.num_red_drawn_so_far_03 = num_red_drawn_so_far[2] p.num_red_drawn_so_far_04 = num_red_drawn_so_far[3] p.num_red_drawn_so_far_05 = num_red_drawn_so_far[4] p.num_red_drawn_so_far_06 = num_red_drawn_so_far[5] p.num_red_drawn_so_far_07 = num_red_drawn_so_far[6] p.num_red_drawn_so_far_08 = num_red_drawn_so_far[7] p.num_red_drawn_so_far_09 = num_red_drawn_so_far[8] p.num_red_drawn_so_far_10 = num_red_drawn_so_far[9] p.num_red_drawn_so_far_11 = num_red_drawn_so_far[10] p.num_red_drawn_so_far_12 = num_red_drawn_so_far[11] p.num_red_drawn_so_far_13 = num_red_drawn_so_far[12] p.num_red_drawn_so_far_14 = num_red_drawn_so_far[13] p.num_red_drawn_so_far_15 = num_red_drawn_so_far[14] p.num_red_drawn_so_far_16 = num_red_drawn_so_far[15] p.num_red_drawn_so_far_17 = num_red_drawn_so_far[16] p.num_red_drawn_so_far_18 = num_red_drawn_so_far[17] p.num_red_drawn_so_far_19 = num_red_drawn_so_far[18] p.num_red_drawn_so_far_20 = num_red_drawn_so_far[19] p.num_red_drawn_so_far_21 = num_red_drawn_so_far[20] p.num_red_drawn_so_far_22 = num_red_drawn_so_far[21] p.num_red_drawn_so_far_23 = num_red_drawn_so_far[22] p.num_red_drawn_so_far_24 = num_red_drawn_so_far[23] p.num_red_drawn_so_far_25 = num_red_drawn_so_far[24] p.num_red_drawn_so_far_26 = num_red_drawn_so_far[25] p.num_red_drawn_so_far_27 = num_red_drawn_so_far[26] p.num_red_drawn_so_far_28 = num_red_drawn_so_far[27] p.num_red_drawn_so_far_29 = num_red_drawn_so_far[28] p.num_red_drawn_so_far_30 = num_red_drawn_so_far[29] p.urn = sum(col_red) ### ALGORITHM DRAFT 1 ### ### RANDOMLY SELECT URN ### #p.urn = random.randint(0, 19) # choosing from 0 to 19 red balls #p.urn = random.randint(0,Constants.max_balls) ### SELECTING DRAWS FROM URN ### #draws = [] # this needs to be a loop so that I'm not specifying 20 fucking things #for i in range(Constants.max_balls): #draws.append(random.randint(0, i)) ## draws[0] is chosen from 0 to 0 # draws.append(random.randint(1, Constants.max_balls-i)) ## chooses from 0 to 29, then from 0 to 8,... 0 to 0 # !!! I think the above code actually chooses from 1 to 29, then 1 to 28 ### DEFINING DRAWS FOR PLAYER ### #p.draw_01 = draws[0] ## 1 to 29, if this number is less than or equal to urn size then ball is red(??) #p.draw_02 = draws[1] ## 1 to 28 #p.draw_03 = draws[2] #p.draw_04 = draws[3] ## 1 to 26 #p.draw_05 = draws[4] #p.draw_06 = draws[5] ## 1 to 24 #p.draw_07 = draws[6] #p.draw_08 = draws[7] ## 1 to 22 #p.draw_09 = draws[8] #p.draw_10 = draws[9] #p.draw_11 = draws[10] ## 1 to 19 #p.draw_12 = draws[11] #p.draw_13 = draws[12] #p.draw_14 = draws[13] #p.draw_15 = draws[14] ## 1 to 15 #p.draw_16 = draws[15] #p.draw_17 = draws[16] #p.draw_18 = draws[17] #p.draw_19 = draws[18] #p.draw_20 = draws[19] ## 1 to 10 #p.draw_21 = draws[20] #p.draw_22 = draws[21] #p.draw_23 = draws[22] #p.draw_24 = draws[23] #p.draw_25 = draws[24] ## from 1 to 5 #p.draw_26 = draws[25] #p.draw_27 = draws[26] #p.draw_28 = draws[27] #p.draw_29 = draws[28] ### DEFINING COLOR OF BALL DRAWN, and number of reds left, IN EACH ROUND ### # col_red = [] # num_red_drawn_so_far = [] #num_red_left = [] # for i in range(Constants.max_balls+1): ## filling in the lists with spaceholders # col_red.append(0) # num_red_drawn_so_far.append(0) # num_red_left.append(0) #num_red_left[0] = p.urn # to start with, the number of red balls left is the urn that was selected #draws[0] = 99 # this is just a space filler since there aren't any draws for the first decision #col_red[0] = 0 # this is just a space filler since there's no color drawn for the first decision #if draws[1] <= num_red_left[0]: # col_red[1] = 1 #num_red_drawn_so_far[1] = col_red[0] #num_red_left[1] = p.urn - num_red_drawn_so_far[1] #if draws[2] <= num_red_left[1]: # col_red[1] = 1 #num_red_drawn_so_far[2]=col_red[0]+col_red[1] # num_red_left[2] = p.urn - num_red_drawn_so_far[1] # for i in range(1,Constants.max_balls): # if draws[i] <= num_red_left[i-1]: #this seems to be working if the random number is less than or equal to the number of red left # col_red[i] = 1 #the color is red ## the first values of these are going to correspond to Decision 2 # else: # col_red[i] = 0 #the color is not red # num_red_drawn_so_far[i] = sum(col_red) ## this seems to be correct # num_red_left[i] = p.urn-num_red_drawn_so_far[i] ## going into the next round, it's number of balls we started with minus the number we have left going into the next round ## Walking thru the algorithm above: ## In the first round (round 0), we start with the initial number of red balls in the urn ## If the random draw of an integer (which includes 0) is less than the number of red balls, then the color is red ## If the color is red, then the first value of that list is 1 ## If the color is red, the number of red balls drawn so far in round 1 is 1, ## The number of red balls left in round 1 is how many were in the urn minus 1 ## In the second round (round 1), the number of red balls left in the urn is one less ### DEFINING THESE DUDES AT THE PLAYER LEVEL ### #p.col_red_01 = col_red[0] #p.col_red_02 = col_red[1] #p.col_red_03 = col_red[2] #p.col_red_04 = col_red[3] #p.col_red_05 = col_red[4] #p.col_red_06 = col_red[5] #p.col_red_07 = col_red[6] #p.col_red_08 = col_red[7] #p.col_red_09 = col_red[8] #p.col_red_10 = col_red[9] #p.col_red_11 = col_red[10] #p.col_red_12 = col_red[11] #p.col_red_13 = col_red[12] #p.col_red_14 = col_red[13] #p.col_red_15 = col_red[14] #p.col_red_16 = col_red[15] #p.col_red_17 = col_red[16] #p.col_red_18 = col_red[17] #p.col_red_19 = col_red[18] #p.col_red_20 = col_red[19] #p.col_red_21 = col_red[20] #p.col_red_22 = col_red[21] #p.col_red_23 = col_red[22] #p.col_red_24 = col_red[23] #p.col_red_25 = col_red[24] #p.col_red_26 = col_red[25] #p.col_red_27 = col_red[26] #p.col_red_28 = col_red[27] #p.col_red_29 = col_red[28] # p.num_red_drawn_so_far_01 = num_red_drawn_so_far[0] # p.num_red_drawn_so_far_02 = num_red_drawn_so_far[1] # p.num_red_drawn_so_far_03 = num_red_drawn_so_far[2] # p.num_red_drawn_so_far_04 = num_red_drawn_so_far[3] # p.num_red_drawn_so_far_05 = num_red_drawn_so_far[4] # p.num_red_drawn_so_far_06 = num_red_drawn_so_far[5] # p.num_red_drawn_so_far_07 = num_red_drawn_so_far[6] # p.num_red_drawn_so_far_08 = num_red_drawn_so_far[7] # p.num_red_drawn_so_far_09 = num_red_drawn_so_far[8] # p.num_red_drawn_so_far_10 = num_red_drawn_so_far[9] # p.num_red_drawn_so_far_11 = num_red_drawn_so_far[10] #p.num_red_drawn_so_far_12 = num_red_drawn_so_far[11] # p.num_red_drawn_so_far_13 = num_red_drawn_so_far[12] # p.num_red_drawn_so_far_14 = num_red_drawn_so_far[13] # p.num_red_drawn_so_far_15 = num_red_drawn_so_far[14] # p.num_red_drawn_so_far_16 = num_red_drawn_so_far[15] # p.num_red_drawn_so_far_17 = num_red_drawn_so_far[16] # p.num_red_drawn_so_far_18 = num_red_drawn_so_far[17] # p.num_red_drawn_so_far_19 = num_red_drawn_so_far[18] # p.num_red_drawn_so_far_20 = num_red_drawn_so_far[19] # p.num_red_drawn_so_far_21 = num_red_drawn_so_far[20] # p.num_red_drawn_so_far_22 = num_red_drawn_so_far[21] # p.num_red_drawn_so_far_23 = num_red_drawn_so_far[22] # p.num_red_drawn_so_far_24 = num_red_drawn_so_far[23] #p.num_red_drawn_so_far_25 = num_red_drawn_so_far[24] # p.num_red_drawn_so_far_26 = num_red_drawn_so_far[25] # p.num_red_drawn_so_far_27 = num_red_drawn_so_far[26] # p.num_red_drawn_so_far_28 = num_red_drawn_so_far[27] # p.num_red_drawn_so_far_29 = num_red_drawn_so_far[28] # p.num_red_drawn_so_far_30 = num_red_drawn_so_far[29] # p.num_red_left_01 = num_red_left[0] # p.num_red_left_02 = num_red_left[1] # p.num_red_left_03 = num_red_left[2] # p.num_red_left_04 = num_red_left[3] # p.num_red_left_05 = num_red_left[4] # p.num_red_left_06 = num_red_left[5] # p.num_red_left_07 = num_red_left[6] # p.num_red_left_08 = num_red_left[7] # p.num_red_left_09 = num_red_left[8] # p.num_red_left_10 = num_red_left[9] # p.num_red_left_11 = num_red_left[10] # p.num_red_left_12 = num_red_left[11] #p.num_red_left_13 = num_red_left[12] # p.num_red_left_14 = num_red_left[13] # p.num_red_left_15 = num_red_left[14] # p.num_red_left_16 = num_red_left[15] # p.num_red_left_17 = num_red_left[16] # p.num_red_left_18 = num_red_left[17] # p.num_red_left_19 = num_red_left[18] # p.num_red_left_20 = num_red_left[19] # p.num_red_left_21 = num_red_left[20] # p.num_red_left_22 = num_red_left[21] # p.num_red_left_23 = num_red_left[22] # p.num_red_left_24 = num_red_left[23] # p.num_red_left_25 = num_red_left[24] #p.num_red_left_26 = num_red_left[25] # p.num_red_left_27 = num_red_left[26] # p.num_red_left_28 = num_red_left[27] # p.num_red_left_29 = num_red_left[28] # p.num_red_left_30 = num_red_left[29] #p.col = "blue" # for i in range(20): # if draws[i] <= p.urn: #if the number randomly drawn is less than the number of red balls # col_red[i] = 1 #color is red # else: # col_red[i] = 0 #color is black class Group(BaseGroup): pass class Player(BasePlayer): captcha = models.CharField(blank=True) ### ROUND NUMBER ### ### URN TYPE ### urn = models.IntegerField() ### DECISION NUMBER (ROUND NUMBER) ### decision_number = models.IntegerField( initial=1 ) ### NUMBER OF BALLS DRAWN ### num_balls_drawn = models.IntegerField( initial=0 ) ### COLOR LABEL ### col_label = models.StringField() ### RANDOM NUMBER FOR PAYMENT ### payment_rand = models.IntegerField() ## randomly selects round decision_type_rand = models.IntegerField() ## randomly selects type of thing that gets payed ### INCENTIVIZED BELIEFS ### ## name convention: b_x_y is belief elicitation type x (3 options) and y is round b_01_01_test = models.IntegerField( label="this is testing if the code works. this is form field for b_01_01_test" ) b_01_02_test = models.IntegerField( label="this is testing if the code works. this is form field for b_01_02_test" ) b_01_00 = models.IntegerField( label="", min=Constants.min_balls, max=Constants.max_balls ) b_01_01 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_02 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_03 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_04 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_05 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_06 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_07 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_08 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_09 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_10 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_11 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_12 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_13 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_14 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_15 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_16 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_17 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_18 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_19 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_01_20 = models.IntegerField( label="For this report, overestimation is three times costlier than underestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_02_00 = models.IntegerField( label="", min=Constants.min_balls, max=Constants.max_balls ) b_02_01 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_02 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_03 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_04 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_05 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_06 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_07 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_08 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_09 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_10 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_11 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_12 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_13 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_14 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_15 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_16 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_17 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_18 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_19 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_02_20 = models.IntegerField( label="For this report, overestimation/underestimation of the true value are equally good/bad", min=Constants.min_balls, max=Constants.max_balls ) b_03_00 = models.IntegerField( label="", min=Constants.min_balls, max=Constants.max_balls ) b_03_01 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_02 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_03 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_04 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_05 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_06 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_07 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_08 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_09 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_10 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_11 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_12 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_13 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_14 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_15 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_16 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_17 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_18 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_19 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) b_03_20 = models.IntegerField( label="For this report, underestimation is three times costlier than overestimation.", min=Constants.min_balls, max=Constants.max_balls ) ### UNINCENTIZED CONFIDENCE ### uic = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_01 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_02 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_03 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_04 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_05 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_06 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_07 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_08 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_09 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_10 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_11 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_12 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_13 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_14 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_15 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_16 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_17 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_18 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_19 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) uic_20 = models.FloatField( label="", min=Constants.min_conf, max=Constants.max_conf ) ### PLAYER DECIDED TO MAKE A JUDGMENT CALL ### judgment_call_yes = models.IntegerField( #initial=0 choices=[ [0, 'Yes'], [1, 'No'] ], widget=widgets.RadioSelectHorizontal, label="" ) ### PLAYER DECIDES WHETHER IT'S MORE OR LESS THAN THE THRESHOLD ### judgment_call_threshold = models.IntegerField( choices=[ [1, 'Yes'], [0, 'No'] ], initial=99, widget=widgets.RadioSelectHorizontal, label="Are there more than 14 red balls?" ) more_or_less = models.StringField( initial="" ) ### ROUND DECISION DESCRIPTION ### why_not_fewer = models.StringField( label='Why did you decide not to draw fewer balls?' ) why_not_more = models.StringField( label='Why did you decide not to draw more balls?' ) ### GAME EARNINGS ### game_earnings = models.IntegerField( label='' ) ### URN RANDOM DRAWS ### draw_01 = models.IntegerField() draw_02 = models.IntegerField() draw_03 = models.IntegerField() draw_04 = models.IntegerField() draw_05 = models.IntegerField() draw_06 = models.IntegerField() draw_07 = models.IntegerField() draw_08 = models.IntegerField() draw_09 = models.IntegerField() draw_10 = models.IntegerField() draw_11 = models.IntegerField() draw_12 = models.IntegerField() draw_13 = models.IntegerField() draw_14 = models.IntegerField() draw_15 = models.IntegerField() draw_16 = models.IntegerField() draw_17 = models.IntegerField() draw_18 = models.IntegerField() draw_19 = models.IntegerField() draw_20 = models.IntegerField() draw_21 = models.IntegerField() draw_22 = models.IntegerField() draw_23 = models.IntegerField() draw_24 = models.IntegerField() draw_25 = models.IntegerField() draw_26 = models.IntegerField() draw_27 = models.IntegerField() draw_28 = models.IntegerField() draw_29 = models.IntegerField() ### NUMBER OF RED BALLS DRAWN SO FAR IN EACH ROUND ### num_red_drawn_so_far = models.IntegerField() num_red_drawn_so_far_01 = models.IntegerField() num_red_drawn_so_far_02 = models.IntegerField() num_red_drawn_so_far_03 = models.IntegerField() num_red_drawn_so_far_04 = models.IntegerField() num_red_drawn_so_far_05 = models.IntegerField() num_red_drawn_so_far_06 = models.IntegerField() num_red_drawn_so_far_07 = models.IntegerField() num_red_drawn_so_far_08 = models.IntegerField() num_red_drawn_so_far_09 = models.IntegerField() num_red_drawn_so_far_10 = models.IntegerField() num_red_drawn_so_far_11 = models.IntegerField() num_red_drawn_so_far_12 = models.IntegerField() num_red_drawn_so_far_13 = models.IntegerField() num_red_drawn_so_far_14 = models.IntegerField() num_red_drawn_so_far_15 = models.IntegerField() num_red_drawn_so_far_16 = models.IntegerField() num_red_drawn_so_far_17 = models.IntegerField() num_red_drawn_so_far_18 = models.IntegerField() num_red_drawn_so_far_19 = models.IntegerField() num_red_drawn_so_far_20 = models.IntegerField() num_red_drawn_so_far_21 = models.IntegerField() num_red_drawn_so_far_22 = models.IntegerField() num_red_drawn_so_far_23 = models.IntegerField() num_red_drawn_so_far_24 = models.IntegerField() num_red_drawn_so_far_25 = models.IntegerField() num_red_drawn_so_far_26 = models.IntegerField() num_red_drawn_so_far_27 = models.IntegerField() num_red_drawn_so_far_28 = models.IntegerField() num_red_drawn_so_far_29 = models.IntegerField() num_red_drawn_so_far_30 = models.IntegerField() ### NUMBER OF RED BALLS LEFT IN EACH ROUND ### num_red_left_01 = models.IntegerField() num_red_left_02 = models.IntegerField() num_red_left_03 = models.IntegerField() num_red_left_04 = models.IntegerField() num_red_left_05 = models.IntegerField() num_red_left_06 = models.IntegerField() num_red_left_07 = models.IntegerField() num_red_left_08 = models.IntegerField() num_red_left_09 = models.IntegerField() num_red_left_10 = models.IntegerField() num_red_left_11 = models.IntegerField() num_red_left_12 = models.IntegerField() num_red_left_13 = models.IntegerField() num_red_left_14 = models.IntegerField() num_red_left_15 = models.IntegerField() num_red_left_16 = models.IntegerField() num_red_left_17 = models.IntegerField() num_red_left_18 = models.IntegerField() num_red_left_19 = models.IntegerField() num_red_left_20 = models.IntegerField() num_red_left_21 = models.IntegerField() num_red_left_22 = models.IntegerField() num_red_left_23 = models.IntegerField() num_red_left_24 = models.IntegerField() num_red_left_25 = models.IntegerField() num_red_left_26 = models.IntegerField() num_red_left_27 = models.IntegerField() num_red_left_28 = models.IntegerField() num_red_left_29 = models.IntegerField() num_red_left_30 = models.IntegerField() ### COLOR OF BALL DRAWN IN EACH ROUND ### col_red_01 = models.IntegerField() col_red_02 = models.IntegerField() col_red_03 = models.IntegerField() col_red_04 = models.IntegerField() col_red_05 = models.IntegerField() col_red_06 = models.IntegerField() col_red_07 = models.IntegerField() col_red_08 = models.IntegerField() col_red_09 = models.IntegerField() col_red_10 = models.IntegerField() col_red_11 = models.IntegerField() col_red_12 = models.IntegerField() col_red_13 = models.IntegerField() col_red_14 = models.IntegerField() col_red_15 = models.IntegerField() col_red_16 = models.IntegerField() col_red_17 = models.IntegerField() col_red_18 = models.IntegerField() col_red_19 = models.IntegerField() col_red_20 = models.IntegerField() col_red_21 = models.IntegerField() col_red_22 = models.IntegerField() col_red_23 = models.IntegerField() col_red_24 = models.IntegerField() col_red_25 = models.IntegerField() col_red_26 = models.IntegerField() col_red_27 = models.IntegerField() col_red_28 = models.IntegerField() col_red_29 = models.IntegerField() col_red_30 = models.IntegerField() ### LABEL FOR COLOR DRAWN ### col_label_01 = models.StringField() col_label_02 = models.StringField() col_label_03 = models.StringField() col_label_04 = models.StringField() col_label_05 = models.StringField() col_label_06 = models.StringField() col_label_07 = models.StringField() col_label_08 = models.StringField() col_label_09 = models.StringField() col_label_10 = models.StringField() col_label_11 = models.StringField() col_label_12 = models.StringField() col_label_13 = models.StringField() col_label_14 = models.StringField() col_label_15 = models.StringField() col_label_16 = models.StringField() col_label_17 = models.StringField() col_label_18 = models.StringField() col_label_19 = models.StringField() col_label_20 = models.StringField() col_label_21 = models.StringField() col_label_22 = models.StringField() col_label_23 = models.StringField() col_label_24 = models.StringField() col_label_25 = models.StringField() col_label_26 = models.StringField() col_label_27 = models.StringField() col_label_28 = models.StringField() col_label_29 = models.StringField() col_label_30 = models.StringField() ### STUDENT EXTRA CREDIT ### stud_name = models.StringField( label='What is your name?' ) stud_instructions_comment = models.StringField( label='Do you have any input on instructions? What worked? What didn\'t work? What would you change?' ) stud_other_comments = models.StringField( label='Do you have any additional comments?' ) stud_decision_description = models.StringField( label="Like we do in classroom experiments, please describe how you made your decision." ) potential_earnings = models.IntegerField( initial=Constants.endowment ) ### PERSONALITY AVERAGES ### extra_avg = models.FloatField() open_avg = models.FloatField() agree_avg = models.FloatField() con_avg = models.FloatField() neuro_avg = models.FloatField() ### ECKEL GROSSMAN ### eg_choice = models.IntegerField( choices=[ [1, 'Gamble 1'], [2, 'Gamble 2'], [3, 'Gamble 3'], [4, 'Gamble 4'], [5, 'Gamble 5'] ], widget=widgets.RadioSelectHorizontal, label='Which gamble would you like to take?' ) eg_rand = models.IntegerField() eg_payoff = models.IntegerField(initial=0) ### SURVEY QUESTIONS ### ### AGE ### age = models.IntegerField( min=18, max=120, label='What is your age?' ) ### INCOME ### income = models.IntegerField( choices=[ [1, 'Less than $20,000'], [2, '$20,000-$44,999'], [3, '$45,000-$139,999'], [4, '$140,000-$149,999'], [5, '$150,000-$199,999'], [6, '$200,000+'] ], label='What was your income in 2019? (Or if you are a dependent, the income of the person who claims you as a dependent.)' ) divclass = models.StringField( ) divclass2 = models.StringField() ### INVESTOR EXPERIENCE ### # investor_experience = models.IntegerField( # choices=[ # [1,'None'], # [2, 'A little'], # [3, 'A moderate amount'], # [4, 'A lot'] # ], # widget=widgets.RadioSelect, # label="How much investing experience would you say you have? Examples are the stock market, bond market, housing market, etc." # ) investor_experience = models.IntegerField( choices=[ [1, 'Very inexperienced'], [2, 'Somewhat inexperienced'], [3, 'Somewhat experienced'], [4, 'Very experienced'] ], label='When it comes to investing in stock or bond mutual funds, ETFs (exchange-traded funds), or individual stocks or bonds, how would you describe yourself?' ) investor_comfort = models.IntegerField( choices=[ [1, 'Comfortable'], [2, 'Uncomfortable'], [3, 'No opinion'] ], label='Are you comfortable or uncomfortable with the idea of managing your own investments?' ) ### GAMBLING FREQUENCY ### gambling_frequency = models.IntegerField( choices=[ [1, 'Never'], [2, 'Rarely'], [3, 'Sometimes'], [4, 'Often'] ], # widget=widgets.RadioSelect, label="How frequently would you say you gamble?" ) ### SELF-REPORTED RISK ### risky = models.IntegerField( choices=[ [0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'] ], label='', widget=widgets.RadioSelectHorizontal ) ### GENDER ### gender = models.IntegerField( choices=[ [1, 'female'], [2, 'male'], [3, 'nonbinary'], [4, 'other'] ], # widget=widgets.RadioSelect, label='What is your gender?' ) ### GENDER IF SELECTED 'OTHER' ### gender_other = models.StringField( blank=True, label='If you would like to further specify your gender here, you may:' )