from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random doc = """ """ class Constants(BaseConstants): name_in_url = 'graph_ten' players_per_group = None # original: num_rounds = 3 num_rounds = 1 #I needed to do this in order to not have pages skipped by the program num_prices = 11 expectation_payoff = 20 s = 'Sell' h = 'Hold' # instructions_template = 'lemon_market/Instructions.html' #initial_endowment = c(50) #buyer_extra_value = c(5) ## The first price is randomly selected integer U(a,b) ## The following two lines set the lower and upper limit of that distribution first_price_lower = 90 first_price_upper = 110 ## The following line sets the number of prices shown in the information sequence info_seq_num = 11 ## The following line is the number of direction processes there are direction_process_num = 2 ## The following line is the number of magnitude processes there are magnitude_process_num = 3 ## Defining magnitude process numbers: mag_low = 1 mag_med = 3 mag_high = 5 class Subsession(BaseSubsession): def creating_session(self): for p in self.get_players(): ## I WILL DO THIS LATER # p.inv_dec_binary = 99 ## DOESN'T WORK # if p.inv_dec in ['Sell']: # p.inv_dec_binary = 1 ## THIS DOESN'T WORK EITHER!!! # if p.inv_test == 1: # p.inv_dec_binary = 1 price_seq = [] price_seq_dec = [] price_seq.append(random.randint(Constants.first_price_lower, Constants.first_price_upper)) price_seq_dec.append(random.randint(Constants.first_price_lower, Constants.first_price_upper)) p.price1 = price_seq[0] p.price1_dec = price_seq_dec[0] p.direction_process_type = random.randint(1, Constants.direction_process_num) p.magnitude_process_type = random.randint(1, Constants.magnitude_process_num) direction = [] direction_dec = [] magnitude = [] magnitude_dec = [] direction_random = [] direction_random_dec = [] magnitude_random = [] magnitude_random_dec = [] color_red = [] for i in range(10): magnitude_random.append(random.randint(1, 4)) magnitude.append(11) for i in range(11): magnitude_random_dec.append(random.randint(1, 4)) magnitude_dec.append(11) for i in range(10): direction_random.append(random.randint(1, 100)) direction.append(1) for i in range(11): direction_random_dec.append(random.randint(1, 100)) direction_dec.append(1) for i in range(9): if p.direction_process_type == 1: if direction_random[i] <= 45: direction[i] = 1 else: direction[i] = -1 else: if direction_random[i] <= 45: direction[i] = -1 else: direction[i] = 1 for i in range(10): if p.direction_process_type == 1: if direction_random_dec[i] <= 45: direction_dec[i] = 1 else: direction_dec[i] = -1 else: if direction_random_dec[i] <= 45: direction_dec[i] = -1 else: direction_dec[i] = 1 ## Defining the direction values of the subject' sequence vector p.d1 = direction[0] p.d2 = direction[1] p.d3 = direction[2] p.d4 = direction[3] p.d5 = direction[4] p.d6 = direction[5] p.d7 = direction[6] p.d8 = direction[7] p.d9 = direction[8] p.d10 = direction[9] p.d1_dec = direction_dec[0] p.d2_dec = direction_dec[1] p.d3_dec = direction_dec[2] p.d4_dec = direction_dec[3] p.d5_dec = direction_dec[4] p.d6_dec = direction_dec[5] p.d7_dec = direction_dec[6] p.d8_dec = direction_dec[7] p.d9_dec = direction_dec[8] p.d10_dec = direction_dec[9] p.d11_dec = direction_dec[10] for i in range(10): if p.magnitude_process_type == 1: if magnitude_random[i] == 1: magnitude[i] = Constants.mag_low elif magnitude_random[i] == 2: magnitude[i] = Constants.mag_med elif magnitude_random[i] == 3 or magnitude_random[i] == 4: magnitude[i] = Constants.mag_high elif p.magnitude_process_type == 2: if magnitude_random[i] == 1: magnitude[i] = Constants.mag_low elif magnitude_random[i] == 2 or magnitude_random[i] == 3: magnitude[i] = Constants.mag_med elif magnitude_random[i] == 4: magnitude[i] = Constants.mag_high elif p.magnitude_process_type == 3: if magnitude_random[i] == 1 or magnitude_random[i] == 2: magnitude[i] = Constants.mag_low elif magnitude_random[i] == 3: magnitude[i] = Constants.mag_med elif magnitude_random[i] == 4: magnitude[i] = Constants.mag_high for i in range(11): if p.magnitude_process_type == 1: if magnitude_random_dec[i] == 1: magnitude_dec[i] = Constants.mag_low elif magnitude_random_dec[i] == 2: magnitude_dec[i] = Constants.mag_med elif magnitude_random_dec[i] == 3 or magnitude_random_dec[i] == 4: magnitude_dec[i] = Constants.mag_high elif p.magnitude_process_type == 2: if magnitude_random_dec[i] == 1: magnitude_dec[i] = Constants.mag_low elif magnitude_random_dec[i] == 2 or magnitude_random_dec[i] == 3: magnitude_dec[i] = Constants.mag_med elif magnitude_random_dec[i] == 4: magnitude_dec[i] = Constants.mag_high elif p.magnitude_process_type == 3: if magnitude_random_dec[i] == 1 or magnitude_random_dec[i] == 2: magnitude_dec[i] = Constants.mag_low elif magnitude_random_dec[i] == 3: magnitude_dec[i] = Constants.mag_med elif magnitude_random_dec[i] == 4: magnitude_dec[i] = Constants.mag_high p.m1 = magnitude[0] p.m2 = magnitude[1] p.m3 = magnitude[2] p.m4 = magnitude[3] p.m5 = magnitude[4] p.m6 = magnitude[5] p.m7 = magnitude[6] p.m8 = magnitude[7] p.m9 = magnitude[8] p.m10 = magnitude[9] p.m1_dec = magnitude_dec[0] p.m2_dec = magnitude_dec[1] p.m3_dec = magnitude_dec[2] p.m4_dec = magnitude_dec[3] p.m5_dec = magnitude_dec[4] p.m6_dec = magnitude_dec[5] p.m7_dec = magnitude_dec[6] p.m8_dec = magnitude_dec[7] p.m9_dec = magnitude_dec[8] p.m10_dec = magnitude_dec[9] p.m11_dec = magnitude_dec[10] for i in range(10): price_seq.append(price_seq[i] + direction[i] * magnitude[i]) for i in range(11): price_seq_dec.append(price_seq_dec[i] + direction_dec[i] * magnitude_dec[i]) p.price2 = price_seq[1] p.price3 = price_seq[2] p.price4 = price_seq[3] p.price5 = price_seq[4] p.price6 = price_seq[5] p.price7 = price_seq[6] p.price8 = price_seq[7] p.price9 = price_seq[8] p.price10 = price_seq[9] p.price11 = price_seq[10] p.price2_dec = price_seq_dec[1] p.price3_dec = price_seq_dec[2] p.price4_dec = price_seq_dec[3] p.price5_dec = price_seq_dec[4] p.price6_dec = price_seq_dec[5] p.price7_dec = price_seq_dec[6] p.price8_dec = price_seq_dec[7] p.price9_dec = price_seq_dec[8] p.price10_dec = price_seq_dec[9] p.price11_dec = price_seq_dec[10] p.priceexp_01_01 = p.price10_dec + Constants.mag_high p.priceexp_01_02 = p.price10_dec + Constants.mag_med p.priceexp_01_03 = p.price10_dec + Constants.mag_low p.priceexp_01_04 = p.price10_dec - Constants.mag_low p.priceexp_01_05 = p.price10_dec - Constants.mag_med p.priceexp_01_06 = p.price10_dec - Constants.mag_high color_red.append(1) p.color_red_01 = color_red[0] #if p.price11_dec >= p.price1_dec: # color_red_01 = 0 def vars_for_admin_report(self): # group = self.get_groups()[0] for p in self.get_players(): series = [] ## if the series append stuff is inside the self.get_players it still only uses the last player's values for all for the graph series.append({ 'name': 'Price', 'data': [p.price1, p.price2, p.price3, p.price4, p.price5, p.price6, p.price7, p.price8, p.price9, p.price10] }) series2 = [] series2.append({ 'name': 'Price', 'data': [p.price1_dec, p.price10_dec] }) ## Creating the vector for the x axis of the decision sequence dec_seq_num = [] dec_seq_num.append(1) dec_seq_num.append(10) return { 'highcharts_series': series, 'highcharts_series2': series2, 'color_red_01': p.color_red_01, 'round_numbers': list(range(1, Constants.num_prices + 1)), 'dec_seq_numbers': dec_seq_num, #'nonsense': ['fuck', 'this', 'shit', 'bitch'], 'price_1': p.price1, 'price_10': p.price10, ## The list of numbers generated using the "list(range(min,max))" command will be ## min to max-1 I think, since list, by itself, starts with 0 as the beginning of the index, ## But I think if it's used in a graph, the categories at the bottom will not exceed ## the data } class Group(BaseGroup): #def results_computation(self): # players = self.get_players() # for p in players: # if p.inv_dec_01 == 0: # p.round_earnings = p.price10_dec # elif p.inv_dec_01 == 1: # p.round_earnings = p.price11_dec # if p.exp_1 == p.price11_dec: # p.exp_1 = Constants.expectation_payoff # else: # p.exp_1 = 0 pass class Player(BasePlayer): direction_process_type = models.IntegerField() magnitude_process_type = models.IntegerField() round_earnings = models.IntegerField() inv_dec_01 = models.IntegerField( choices=[ [1, 'Sell'], [0, 'Hold'] ], widget=widgets.RadioSelectHorizontal, label="Would you like to sell or hold the asset?" ) #test_2 = models.IntegerField() ### EXPECTATIONS ### exp_1 = models.IntegerField( min=0, label="What do you think the final (11th) price of this sequence will be?" ) exp_1_payoff = models.IntegerField( ) #def results_computation(self): # #players = self.get_players() # #for p in players: # if self.inv_dec_01 == 0: # self.round_earnings = self.price10_dec # elif self.inv_dec_01 == 1: # self.round_earnings = self.price11_dec ### PERSONALITY QUESTIONS ### pers_01_e_1 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is talkative." ) pers_02_a_1 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who tends to find fault with others." ) pers_03_c_1 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who does a thorough job." ) pers_04_n_1 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is depressed, blue." ) pers_05_o_1 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is original, comes up with new ideas." ) pers_06_e_2 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is reserved." ) pers_07_a_2 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is helpful and unselfish with others." ) pers_08_c_2 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who can be somewhwat careless." ) pers_09_n_2 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is relaxed, handles stress well." ) pers_10_o_2 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is curious about many different things." ) pers_11_e_3 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is full of energy." ) pers_12_a_3 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who starts quarrels with others." ) pers_13_c_3 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is a reliable worker." ) pers_14_n_3 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who can be tense." ) pers_15_o_3 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is ingenious, a deep thinker." ) pers_16_e_4 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who generates a lot of enthusiasm." ) pers_17_a_4 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who has a forgiving nature." ) pers_18_c_4 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who tends to be disorganized." ) pers_19_n_4 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who worries a lot." ) pers_20_o_4 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who has an active imagination." ) pers_21_e_5 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who tends to be quiet." ) pers_22_a_5 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is generally trusting." ) pers_23_c_5 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who tends to be lazy." ) pers_24_n_5 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is emotionally stable, not easily upset." ) pers_25_o_5 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is inventive." ) pers_26_e_6 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who has an assertive personality." ) pers_27_a_6 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who can be cold and aloof." ) pers_28_c_6 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who perseveres until the task is finished." ) pers_29_n_6 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who can be moody." ) pers_30_o_6 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who values artistic, aesthetic experiences." ) pers_31_e_7 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is sometimes shy, inhibited." ) pers_32_a_7 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is considerate and kind to almost everyone." ) pers_33_c_7 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who does things efficiently." ) pers_34_n_7 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who remains calm in tense situations." ) pers_35_o_7 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who prefers work that is routine." ) pers_36_e_8 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is outgoing, sociable." ) pers_37_a_7 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is sometimes rude to others." ) pers_38_c_8 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who makes plans and follows through with them." ) pers_39_n_8 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who gets nervous easily." ) pers_40_o_8 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who likes to reflect, play with ideas." ) pers_41_o_9 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who has few artistic interests." ) pers_42_a_9 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who likes to cooperate with others." ) pers_43_c_9 = models.IntegerField( choices=[ [5, 'Disagree strongly'], [4, 'Disagree a little'], [3, 'Neither agree nor disagree'], [2, 'Agree a little'], [1, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is easily distracted." ) pers_44_o_10 = models.IntegerField( choices=[ [1, 'Disagree strongly'], [2, 'Disagree a little'], [3, 'Neither agree nor disagree'], [4, 'Agree a little'], [5, 'Agree strongly'] ], widget=widgets.RadioSelect, label="I see myself as someone who is sophisticated in art, music, or litrature." ) price10_dec = models.IntegerField() price11_dec = models.IntegerField() d1 = models.IntegerField() d2 = models.IntegerField() d3 = models.IntegerField() d4 = models.IntegerField() d5 = models.IntegerField() d6 = models.IntegerField() d7 = models.IntegerField() d8 = models.IntegerField() d9 = models.IntegerField() d10 = models.IntegerField() d1_dec = models.IntegerField() d2_dec = models.IntegerField() d3_dec = models.IntegerField() d4_dec = models.IntegerField() d5_dec = models.IntegerField() d6_dec = models.IntegerField() d7_dec = models.IntegerField() d8_dec = models.IntegerField() d9_dec = models.IntegerField() d10_dec = models.IntegerField() d11_dec = models.IntegerField() m1 = models.IntegerField() m2 = models.IntegerField() m3 = models.IntegerField() m4 = models.IntegerField() m5 = models.IntegerField() m6 = models.IntegerField() m7 = models.IntegerField() m8 = models.IntegerField() m9 = models.IntegerField() m10 = models.IntegerField() m1_dec = models.IntegerField() m2_dec = models.IntegerField() m3_dec = models.IntegerField() m4_dec = models.IntegerField() m5_dec = models.IntegerField() m6_dec = models.IntegerField() m7_dec = models.IntegerField() m8_dec = models.IntegerField() m9_dec = models.IntegerField() m10_dec = models.IntegerField() m11_dec = models.IntegerField() price1 = models.IntegerField() price2 = models.IntegerField() price3 = models.IntegerField() price4 = models.IntegerField() price5 = models.IntegerField() price6 = models.IntegerField() price7 = models.IntegerField() price8 = models.IntegerField() price9 = models.IntegerField() price10 = models.IntegerField() price11 = models.IntegerField() price1_dec = models.IntegerField() price2_dec = models.IntegerField() price3_dec = models.IntegerField() price4_dec = models.IntegerField() price5_dec = models.IntegerField() price6_dec = models.IntegerField() price7_dec = models.IntegerField() price8_dec = models.IntegerField() price9_dec = models.IntegerField() priceexp_01_01 = models.IntegerField() priceexp_01_02 = models.IntegerField() priceexp_01_03 = models.IntegerField() priceexp_01_04 = models.IntegerField() priceexp_01_05 = models.IntegerField() priceexp_01_06 = models.IntegerField() color_red_01 = models.IntegerField() #expectations = { # # Level: ProductionCost # 'High': 30, # 'Medium': 20, # 'Low': 10 #} #expectations_names = list(expectations.keys()) # exp = models.StringField( # choices=expectations_names, # widget=widgets.RadioSelectHorizontal # ) def exp_ch_11_01(self): return self.price1_dec #def exp_ch_11_02(self): # return self.price9_dec expectation_11 = models.IntegerField( #choices=[ # Constants.first_price_upper, participant.vars['price9_dec'] #], #choices=range(1, {exp_ch_11_01(self)}), widget=widgets.RadioSelect, label="What do you think the final price of this sequence will be?" )