import random
import time
from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
Currency as c, currency_range
)
author = 'Your name here'
doc = """
Your app description
"""
class Constants(BaseConstants):
name_in_url = 'Competition_control'
players_per_group = 8
num_rounds = 1
paymentprob = random.randint(1,100)
gambleprob = random.randint(1,100)
#donateprob = random.randint(1,100)
#determine which one's choice to use as the group choice
choiceprob1 = random.randint(1, 100)
choiceprob2 = random.randint(1, 100)
choiceprob3 = random.randint(1, 100)
choiceprob4 = random.randint(1, 100)
choiceprob5 = random.randint(1, 100)
choiceprob6 = random.randint(1, 100)
choiceprob7 = random.randint(1, 100)
choiceprob8 = random.randint(1, 100)
donateprob1 = random.randint(1, 100)
donateprob2 = random.randint(1, 100)
donateprob3 = random.randint(1, 100)
donateprob4 = random.randint(1, 100)
donateprob5 = random.randint(1, 100)
donateprob6 = random.randint(1, 100)
donateprob7 = random.randint(1, 100)
donateprob8 = random.randint(1, 100)
roleprob1 = random.randint(1,100)
roleprob2 = random.randint(1,100)
roleprob3 = random.randint(1,100)
roleprob4 = random.randint(1,100)
roleprob5 = random.randint(1,100)
roleprob6 = random.randint(1,100)
roleprob7 = random.randint(1,100)
roleprob8 = random.randint(1,100)
########################### TASK 1 ########################################
#generating random numbers for question 1 task 1
n1_q1_t1 = random.randint(10, 99)
n2_q1_t1 = random.randint(10, 99)
n3_q1_t1 = random.randint(10, 99)
n4_q1_t1 = random.randint(10, 99)
n5_q1_t1 = random.randint(10, 99)
#the total of the numbers for question 1 task 1
total_q1_t1 = n1_q1_t1 + n2_q1_t1 + n3_q1_t1 + n4_q1_t1 + n5_q1_t1
#generating random numbers for question 2 task 1
n1_q2_t1 = random.randint(10, 99)
n2_q2_t1 = random.randint(10, 99)
n3_q2_t1 = random.randint(10, 99)
n4_q2_t1 = random.randint(10, 99)
n5_q2_t1 = random.randint(10, 99)
#the total of the numbers for question 2 task1
total_q2_t1 = n1_q2_t1 + n2_q2_t1 + n3_q2_t1 + n4_q2_t1 + n5_q2_t1
#generating random numbers for question3 task 1
n1_q3_t1 = random.randint(10, 99)
n2_q3_t1 = random.randint(10, 99)
n3_q3_t1 = random.randint(10, 99)
n4_q3_t1 = random.randint(10, 99)
n5_q3_t1 = random.randint(10, 99)
#the total of the numbers for question 3 task1
total_q3_t1 = n1_q3_t1 + n2_q3_t1 + n3_q3_t1 + n4_q3_t1 + n5_q3_t1
#generating random numbers for question 4 task 1
n1_q4_t1 = random.randint(10, 99)
n2_q4_t1 = random.randint(10, 99)
n3_q4_t1 = random.randint(10, 99)
n4_q4_t1 = random.randint(10, 99)
n5_q4_t1 = random.randint(10, 99)
#the total of the numbers for question 4 task1
total_q4_t1 = n1_q4_t1 + n2_q4_t1 + n3_q4_t1 + n4_q4_t1 + n5_q4_t1
#generating random numbers for question 5 task 1
n1_q5_t1 = random.randint(10, 99)
n2_q5_t1 = random.randint(10, 99)
n3_q5_t1 = random.randint(10, 99)
n4_q5_t1 = random.randint(10, 99)
n5_q5_t1 = random.randint(10, 99)
#the total of the numbers for question 5 task1
total_q5_t1 = n1_q5_t1 + n2_q5_t1 + n3_q5_t1 + n4_q5_t1 + n5_q5_t1
#generating random numbers for question 6 task 1
n1_q6_t1 = random.randint(10, 99)
n2_q6_t1 = random.randint(10, 99)
n3_q6_t1 = random.randint(10, 99)
n4_q6_t1 = random.randint(10, 99)
n5_q6_t1 = random.randint(10, 99)
#the total of the numbers for question 6 task1
total_q6_t1 = n1_q6_t1 + n2_q6_t1 + n3_q6_t1 + n4_q6_t1 + n5_q6_t1
#generating random numbers for question 7 task 1
n1_q7_t1 = random.randint(10, 99)
n2_q7_t1 = random.randint(10, 99)
n3_q7_t1 = random.randint(10, 99)
n4_q7_t1 = random.randint(10, 99)
n5_q7_t1 = random.randint(10, 99)
#the total of the numbers for question 7 task1
total_q7_t1 = n1_q7_t1 + n2_q7_t1 + n3_q7_t1 + n4_q7_t1 + n5_q7_t1
#generating random numbers for question 8 task 1
n1_q8_t1 = random.randint(10, 99)
n2_q8_t1 = random.randint(10, 99)
n3_q8_t1 = random.randint(10, 99)
n4_q8_t1 = random.randint(10, 99)
n5_q8_t1 = random.randint(10, 99)
#the total of the numbers for question 8 task1
total_q8_t1 = n1_q8_t1 + n2_q8_t1 + n3_q8_t1 + n4_q8_t1 + n5_q8_t1
#generating random numbers for question 9 task 1
n1_q9_t1 = random.randint(10, 99)
n2_q9_t1 = random.randint(10, 99)
n3_q9_t1 = random.randint(10, 99)
n4_q9_t1 = random.randint(10, 99)
n5_q9_t1 = random.randint(10, 99)
#the total of the numbers for question 9 task1
total_q9_t1 = n1_q9_t1 + n2_q9_t1 + n3_q9_t1 + n4_q9_t1 + n5_q9_t1
#generating random numbers for question 10 task 1
n1_q10_t1 = random.randint(10, 99)
n2_q10_t1 = random.randint(10, 99)
n3_q10_t1 = random.randint(10, 99)
n4_q10_t1 = random.randint(10, 99)
n5_q10_t1 = random.randint(10, 99)
#the total of the numbers for question 10 task1
total_q10_t1 = n1_q10_t1 + n2_q10_t1 + n3_q10_t1 + n4_q10_t1 + n5_q10_t1
#generating random numbers for question 11 task 1
n1_q11_t1 = random.randint(10, 99)
n2_q11_t1 = random.randint(10, 99)
n3_q11_t1 = random.randint(10, 99)
n4_q11_t1 = random.randint(10, 99)
n5_q11_t1 = random.randint(10, 99)
#the total of the numbers for question 11 task1
total_q11_t1 = n1_q11_t1 + n2_q11_t1 + n3_q11_t1 + n4_q11_t1 + n5_q11_t1
#generating random numbers for question 12 task 1
n1_q12_t1 = random.randint(10, 99)
n2_q12_t1 = random.randint(10, 99)
n3_q12_t1 = random.randint(10, 99)
n4_q12_t1 = random.randint(10, 99)
n5_q12_t1 = random.randint(10, 99)
#the total of the numbers for question 12 task1
total_q12_t1 = n1_q12_t1 + n2_q12_t1 + n3_q12_t1 + n4_q12_t1 + n5_q12_t1
#generating random numbers for question 13 task 1
n1_q13_t1 = random.randint(10, 99)
n2_q13_t1 = random.randint(10, 99)
n3_q13_t1 = random.randint(10, 99)
n4_q13_t1 = random.randint(10, 99)
n5_q13_t1 = random.randint(10, 99)
#the total of the numbers for question 13 task1
total_q13_t1 = n1_q13_t1 + n2_q13_t1 + n3_q13_t1 + n4_q13_t1 + n5_q13_t1
#generating random numbers for question 14 task 1
n1_q14_t1 = random.randint(10, 99)
n2_q14_t1 = random.randint(10, 99)
n3_q14_t1 = random.randint(10, 99)
n4_q14_t1 = random.randint(10, 99)
n5_q14_t1 = random.randint(10, 99)
#the total of the numbers for question 14 task1
total_q14_t1 = n1_q14_t1 + n2_q14_t1 + n3_q14_t1 + n4_q14_t1 + n5_q14_t1
#generating random numbers for question 15 task 1
n1_q15_t1 = random.randint(10, 99)
n2_q15_t1 = random.randint(10, 99)
n3_q15_t1 = random.randint(10, 99)
n4_q15_t1 = random.randint(10, 99)
n5_q15_t1 = random.randint(10, 99)
#the total of the numbers for question 15 task1
total_q15_t1 = n1_q15_t1 + n2_q15_t1 + n3_q15_t1 + n4_q15_t1 + n5_q15_t1
#generating random numbers for question 16 task 1
n1_q16_t1 = random.randint(10, 99)
n2_q16_t1 = random.randint(10, 99)
n3_q16_t1 = random.randint(10, 99)
n4_q16_t1 = random.randint(10, 99)
n5_q16_t1 = random.randint(10, 99)
#the total of the numbers for question 16 task1
total_q16_t1 = n1_q16_t1 + n2_q16_t1 + n3_q16_t1 + n4_q16_t1 + n5_q16_t1
#generating random numbers for question 17 task 1
n1_q17_t1 = random.randint(10, 99)
n2_q17_t1 = random.randint(10, 99)
n3_q17_t1 = random.randint(10, 99)
n4_q17_t1 = random.randint(10, 99)
n5_q17_t1 = random.randint(10, 99)
#the total of the numbers for question 17 task1
total_q17_t1 = n1_q17_t1 + n2_q17_t1 + n3_q17_t1 + n4_q17_t1 + n5_q17_t1
#generating random numbers for question 18 task 1
n1_q18_t1 = random.randint(10, 99)
n2_q18_t1 = random.randint(10, 99)
n3_q18_t1 = random.randint(10, 99)
n4_q18_t1 = random.randint(10, 99)
n5_q18_t1 = random.randint(10, 99)
#the total of the numbers for question 18 task1
total_q18_t1 = n1_q18_t1 + n2_q18_t1 + n3_q18_t1 + n4_q18_t1 + n5_q18_t1
#generating random numbers for question 19 task 1
n1_q19_t1 = random.randint(10, 99)
n2_q19_t1 = random.randint(10, 99)
n3_q19_t1 = random.randint(10, 99)
n4_q19_t1 = random.randint(10, 99)
n5_q19_t1 = random.randint(10, 99)
#the total of the numbers for question 19 task1
total_q19_t1 = n1_q19_t1 + n2_q19_t1 + n3_q19_t1 + n4_q19_t1 + n5_q19_t1
#generating random numbers for question 20 task 1
n1_q20_t1 = random.randint(10, 99)
n2_q20_t1 = random.randint(10, 99)
n3_q20_t1 = random.randint(10, 99)
n4_q20_t1 = random.randint(10, 99)
n5_q20_t1 = random.randint(10, 99)
#the total of the numbers for question 20 task1
total_q20_t1 = n1_q20_t1 + n2_q20_t1 + n3_q20_t1 + n4_q20_t1 + n5_q20_t1
########################## TASK 2 #########################################
#generating random numbers for question 1 task 2
n1_q1_t2 = random.randint(10, 99)
n2_q1_t2 = random.randint(10, 99)
n3_q1_t2 = random.randint(10, 99)
n4_q1_t2 = random.randint(10, 99)
n5_q1_t2 = random.randint(10, 99)
#the total of the numbers for question 1 task 2
total_q1_t2 = n1_q1_t2 + n2_q1_t2 + n3_q1_t2 + n4_q1_t2 + n5_q1_t2
#generating random numbers for question 2 task 2
n1_q2_t2 = random.randint(10, 99)
n2_q2_t2 = random.randint(10, 99)
n3_q2_t2 = random.randint(10, 99)
n4_q2_t2 = random.randint(10, 99)
n5_q2_t2 = random.randint(10, 99)
#the total of the numbers for question 2 task2
total_q2_t2 = n1_q2_t2 + n2_q2_t2 + n3_q2_t2 + n4_q2_t2 + n5_q2_t2
#generating random numbers for question3 task 2
n1_q3_t2 = random.randint(10, 99)
n2_q3_t2 = random.randint(10, 99)
n3_q3_t2 = random.randint(10, 99)
n4_q3_t2 = random.randint(10, 99)
n5_q3_t2 = random.randint(10, 99)
#the total of the numbers for question 3 task1
total_q3_t2 = n1_q3_t2 + n2_q3_t2 + n3_q3_t2 + n4_q3_t2 + n5_q3_t2
#generating random numbers for question 4 task 2
n1_q4_t2 = random.randint(10, 99)
n2_q4_t2 = random.randint(10, 99)
n3_q4_t2 = random.randint(10, 99)
n4_q4_t2 = random.randint(10, 99)
n5_q4_t2 = random.randint(10, 99)
#the total of the numbers for question 4 task1
total_q4_t2 = n1_q4_t2 + n2_q4_t2 + n3_q4_t2 + n4_q4_t2 + n5_q4_t2
#generating random numbers for question 5 task 2
n1_q5_t2 = random.randint(10, 99)
n2_q5_t2 = random.randint(10, 99)
n3_q5_t2 = random.randint(10, 99)
n4_q5_t2 = random.randint(10, 99)
n5_q5_t2 = random.randint(10, 99)
#the total of the numbers for question 5 task1
total_q5_t2 = n1_q5_t2 + n2_q5_t2 + n3_q5_t2 + n4_q5_t2 + n5_q5_t2
#generating random numbers for question 6 task 2
n1_q6_t2 = random.randint(10, 99)
n2_q6_t2 = random.randint(10, 99)
n3_q6_t2 = random.randint(10, 99)
n4_q6_t2 = random.randint(10, 99)
n5_q6_t2 = random.randint(10, 99)
#the total of the numbers for question 6 task1
total_q6_t2 = n1_q6_t2 + n2_q6_t2 + n3_q6_t2 + n4_q6_t2 + n5_q6_t2
#generating random numbers for question 7 task 2
n1_q7_t2 = random.randint(10, 99)
n2_q7_t2 = random.randint(10, 99)
n3_q7_t2 = random.randint(10, 99)
n4_q7_t2 = random.randint(10, 99)
n5_q7_t2 = random.randint(10, 99)
#the total of the numbers for question 7 task1
total_q7_t2 = n1_q7_t2 + n2_q7_t2 + n3_q7_t2 + n4_q7_t2 + n5_q7_t2
#generating random numbers for question 8 task 2
n1_q8_t2 = random.randint(10, 99)
n2_q8_t2 = random.randint(10, 99)
n3_q8_t2 = random.randint(10, 99)
n4_q8_t2 = random.randint(10, 99)
n5_q8_t2 = random.randint(10, 99)
#the total of the numbers for question 8 task1
total_q8_t2 = n1_q8_t2 + n2_q8_t2 + n3_q8_t2 + n4_q8_t2 + n5_q8_t2
#generating random numbers for question 9 task 2
n1_q9_t2 = random.randint(10, 99)
n2_q9_t2 = random.randint(10, 99)
n3_q9_t2 = random.randint(10, 99)
n4_q9_t2 = random.randint(10, 99)
n5_q9_t2 = random.randint(10, 99)
#the total of the numbers for question 9 task1
total_q9_t2 = n1_q9_t2 + n2_q9_t2 + n3_q9_t2 + n4_q9_t2 + n5_q9_t2
#generating random numbers for question 10 task 2
n1_q10_t2 = random.randint(10, 99)
n2_q10_t2 = random.randint(10, 99)
n3_q10_t2 = random.randint(10, 99)
n4_q10_t2 = random.randint(10, 99)
n5_q10_t2 = random.randint(10, 99)
#the total of the numbers for question 10 task1
total_q10_t2 = n1_q10_t2 + n2_q10_t2 + n3_q10_t2 + n4_q10_t2 + n5_q10_t2
#generating random numbers for question 11 task 2
n1_q11_t2 = random.randint(10, 99)
n2_q11_t2 = random.randint(10, 99)
n3_q11_t2 = random.randint(10, 99)
n4_q11_t2 = random.randint(10, 99)
n5_q11_t2 = random.randint(10, 99)
#the total of the numbers for question 11 task1
total_q11_t2 = n1_q11_t2 + n2_q11_t2 + n3_q11_t2 + n4_q11_t2 + n5_q11_t2
#generating random numbers for question 12 task 2
n1_q12_t2 = random.randint(10, 99)
n2_q12_t2 = random.randint(10, 99)
n3_q12_t2 = random.randint(10, 99)
n4_q12_t2 = random.randint(10, 99)
n5_q12_t2 = random.randint(10, 99)
#the total of the numbers for question 12 task1
total_q12_t2 = n1_q12_t2 + n2_q12_t2 + n3_q12_t2 + n4_q12_t2 + n5_q12_t2
#generating random numbers for question 13 task 2
n1_q13_t2 = random.randint(10, 99)
n2_q13_t2 = random.randint(10, 99)
n3_q13_t2 = random.randint(10, 99)
n4_q13_t2 = random.randint(10, 99)
n5_q13_t2 = random.randint(10, 99)
#the total of the numbers for question 13 task1
total_q13_t2 = n1_q13_t2 + n2_q13_t2 + n3_q13_t2 + n4_q13_t2 + n5_q13_t2
#generating random numbers for question 14 task 2
n1_q14_t2 = random.randint(10, 99)
n2_q14_t2 = random.randint(10, 99)
n3_q14_t2 = random.randint(10, 99)
n4_q14_t2 = random.randint(10, 99)
n5_q14_t2 = random.randint(10, 99)
#the total of the numbers for question 14 task1
total_q14_t2 = n1_q14_t2 + n2_q14_t2 + n3_q14_t2 + n4_q14_t2 + n5_q14_t2
#generating random numbers for question 15 task 2
n1_q15_t2 = random.randint(10, 99)
n2_q15_t2 = random.randint(10, 99)
n3_q15_t2 = random.randint(10, 99)
n4_q15_t2 = random.randint(10, 99)
n5_q15_t2 = random.randint(10, 99)
#the total of the numbers for question 15 task1
total_q15_t2 = n1_q15_t2 + n2_q15_t2 + n3_q15_t2 + n4_q15_t2 + n5_q15_t2
#generating random numbers for question 16 task 2
n1_q16_t2 = random.randint(10, 99)
n2_q16_t2 = random.randint(10, 99)
n3_q16_t2 = random.randint(10, 99)
n4_q16_t2 = random.randint(10, 99)
n5_q16_t2 = random.randint(10, 99)
#the total of the numbers for question 16 task1
total_q16_t2 = n1_q16_t2 + n2_q16_t2 + n3_q16_t2 + n4_q16_t2 + n5_q16_t2
#generating random numbers for question 17 task 2
n1_q17_t2 = random.randint(10, 99)
n2_q17_t2 = random.randint(10, 99)
n3_q17_t2 = random.randint(10, 99)
n4_q17_t2 = random.randint(10, 99)
n5_q17_t2 = random.randint(10, 99)
#the total of the numbers for question 17 task1
total_q17_t2 = n1_q17_t2 + n2_q17_t2 + n3_q17_t2 + n4_q17_t2 + n5_q17_t2
#generating random numbers for question 18 task 2
n1_q18_t2 = random.randint(10, 99)
n2_q18_t2 = random.randint(10, 99)
n3_q18_t2 = random.randint(10, 99)
n4_q18_t2 = random.randint(10, 99)
n5_q18_t2 = random.randint(10, 99)
#the total of the numbers for question 18 task1
total_q18_t2 = n1_q18_t2 + n2_q18_t2 + n3_q18_t2 + n4_q18_t2 + n5_q18_t2
#generating random numbers for question 19 task 2
n1_q19_t2 = random.randint(10, 99)
n2_q19_t2 = random.randint(10, 99)
n3_q19_t2 = random.randint(10, 99)
n4_q19_t2 = random.randint(10, 99)
n5_q19_t2 = random.randint(10, 99)
#the total of the numbers for question 19 task1
total_q19_t2 = n1_q19_t2 + n2_q19_t2 + n3_q19_t2 + n4_q19_t2 + n5_q19_t2
#generating random numbers for question 20 task 2
n1_q20_t2 = random.randint(10, 99)
n2_q20_t2 = random.randint(10, 99)
n3_q20_t2 = random.randint(10, 99)
n4_q20_t2 = random.randint(10, 99)
n5_q20_t2 = random.randint(10, 99)
#the total of the numbers for question 20 task1
total_q20_t2 = n1_q20_t2 + n2_q20_t2 + n3_q20_t2 + n4_q20_t2 + n5_q20_t2
winprob1 = random.randint(1,100)
winprob2 = random.randint(1,100)
winprob3 = random.randint(1,100)
winprob4 = random.randint(1,100)
winprob5 = random.randint(1,100)
winprob6 = random.randint(1,100)
winprob7 = random.randint(1,100)
winprob8 = random.randint(1,100)
class Subsession(BaseSubsession):
pass
class Group(BaseGroup):
payoff_group = models.FloatField()
#Choice of payment scheme in task 2 for player 1-8
choice_p1 = models.IntegerField()
choice_p2 = models.IntegerField()
choice_p3 = models.IntegerField()
choice_p4 = models.IntegerField()
choice_p5 = models.IntegerField()
choice_p6 = models.IntegerField()
choice_p7 = models.IntegerField()
choice_p8 = models.IntegerField()
#The number of questions answered correctly by group 1-4 in task 2 (decimal)
payoff_g1 = models.FloatField()
payoff_g2 = models.FloatField()
payoff_g3 = models.FloatField()
payoff_g4 = models.FloatField()
#The number of questions answered correctly by group 1-4 in task 2 (whole number)
num_checkg1 = models.IntegerField()
num_checkg2 = models.IntegerField()
num_checkg3 = models.IntegerField()
num_checkg4 = models.IntegerField()
check = models.IntegerField()
#The highest number the winning group got correct in task 2
max2 = models.IntegerField()
#donation role for players 1-8
donate_p1 = models.IntegerField()
donate_p2 = models.IntegerField()
donate_p3 = models.IntegerField()
donate_p4 = models.IntegerField()
donate_p5 = models.IntegerField()
donate_p6 = models.IntegerField()
donate_p7 = models.IntegerField()
donate_p8 = models.IntegerField()
#role for players 1-8
role_p1 = models.IntegerField()
role_p2 = models.IntegerField()
role_p3 = models.IntegerField()
role_p4 = models.IntegerField()
role_p5 = models.IntegerField()
role_p6 = models.IntegerField()
role_p7 = models.IntegerField()
role_p8 = models.IntegerField()
maxwin = models.IntegerField()
wintotal = models.IntegerField(initial=0)
#social norm
sums11 = models.IntegerField(initial=0)
sums12 = models.IntegerField(initial=0)
sums13 = models.IntegerField(initial=0)
sums14 = models.IntegerField(initial=0)
sums15 = models.IntegerField(initial=0)
maxnorm1 = models.IntegerField(initial=0)
sums21 = models.IntegerField(initial=0)
sums22 = models.IntegerField(initial=0)
sums23 = models.IntegerField(initial=0)
sums24 = models.IntegerField(initial=0)
sums25 = models.IntegerField(initial=0)
maxnorm2 = models.IntegerField(initial=0)
sums31 = models.IntegerField(initial=0)
sums32 = models.IntegerField(initial=0)
sums33 = models.IntegerField(initial=0)
sums34 = models.IntegerField(initial=0)
sums35 = models.IntegerField(initial=0)
maxnorm3 = models.IntegerField(initial=0)
sums41 = models.IntegerField(initial=0)
sums42 = models.IntegerField(initial=0)
sums43 = models.IntegerField(initial=0)
sums44 = models.IntegerField(initial=0)
sums45 = models.IntegerField(initial=0)
maxnorm4 = models.IntegerField(initial=0)
sums51 = models.IntegerField(initial=0)
sums52 = models.IntegerField(initial=0)
sums53 = models.IntegerField(initial=0)
sums54 = models.IntegerField(initial=0)
sums55 = models.IntegerField(initial=0)
maxnorm5 = models.IntegerField(initial=0)
sums61 = models.IntegerField(initial=0)
sums62 = models.IntegerField(initial=0)
sums63 = models.IntegerField(initial=0)
sums64 = models.IntegerField(initial=0)
sums65 = models.IntegerField(initial=0)
maxnorm6 = models.IntegerField(initial=0)
sums71 = models.IntegerField(initial=0)
sums72 = models.IntegerField(initial=0)
sums73 = models.IntegerField(initial=0)
sums74 = models.IntegerField(initial=0)
sums75 = models.IntegerField(initial=0)
maxnorm7 = models.IntegerField(initial=0)
sums81 = models.IntegerField(initial=0)
sums82 = models.IntegerField(initial=0)
sums83 = models.IntegerField(initial=0)
sums84 = models.IntegerField(initial=0)
sums85 = models.IntegerField(initial=0)
maxnorm8 = models.IntegerField(initial=0)
def group_pay(self): # for payoff
p1=self.get_player_by_id(1)
p2=self.get_player_by_id(2)
p3=self.get_player_by_id(3)
p4=self.get_player_by_id(4)
self.payoff_g1 = p1.num_task2 + p2.num_task2
self.payoff_g2 = p3.num_task2 + p4.num_task2
p1.numtotal_task2 = p1.num_task2 + p2.num_task2
p2.numtotal_task2 = p1.num_task2 + p2.num_task2
p3.numtotal_task2 = p3.num_task2 + p4.num_task2
p4.numtotal_task2 = p3.num_task2 + p4.num_task2
p5=self.get_player_by_id(5)
p6=self.get_player_by_id(6)
p7=self.get_player_by_id(7)
p8=self.get_player_by_id(8)
self.payoff_g3 = p5.num_task2 + p6.num_task2
self.payoff_g4 = p7.num_task2 + p8.num_task2
p5.numtotal_task2 = p5.num_task2 + p6.num_task2
p6.numtotal_task2 = p5.num_task2 + p6.num_task2
p7.numtotal_task2 = p7.num_task2 + p8.num_task2
p8.numtotal_task2 = p7.num_task2 + p8.num_task2
p1.winprob = Constants.winprob1
p2.winprob = Constants.winprob2
p3.winprob = Constants.winprob3
p4.winprob = Constants.winprob4
p5.winprob = Constants.winprob5
p6.winprob = Constants.winprob6
p7.winprob = Constants.winprob7
p8.winprob = Constants.winprob8
def group_check(self): # integer
p1=self.get_player_by_id(1)
p2=self.get_player_by_id(2)
p3=self.get_player_by_id(3)
p4=self.get_player_by_id(4)
self.num_checkg1 = p1.num_check + p2.num_check
self.num_checkg2 = p3.num_check + p4.num_check
p1.numtotal_check = p1.num_check + p2.num_check
p2.numtotal_check = p1.num_check + p2.num_check
p3.numtotal_check = p3.num_check + p4.num_check
p4.numtotal_check = p3.num_check + p4.num_check
p5=self.get_player_by_id(5)
p6=self.get_player_by_id(6)
p7=self.get_player_by_id(7)
p8=self.get_player_by_id(8)
self.num_checkg3 = p5.num_check + p6.num_check
self.num_checkg4 = p7.num_check + p8.num_check
p5.numtotal_check = p5.num_check + p6.num_check
p6.numtotal_check = p5.num_check + p6.num_check
p7.numtotal_check = p7.num_check + p8.num_check
p8.numtotal_check = p7.num_check + p8.num_check
def group_choice(self):
p1=self.get_player_by_id(1)
p2=self.get_player_by_id(2)
p3=self.get_player_by_id(3)
p4=self.get_player_by_id(4)
p5=self.get_player_by_id(5)
p6=self.get_player_by_id(6)
p7=self.get_player_by_id(7)
p8=self.get_player_by_id(8)
self.choice_p1 = p1.choice
self.choice_p2 = p2.choice
self.choice_p3 = p3.choice
self.choice_p4 = p4.choice
self.choice_p5 = p5.choice
self.choice_p6 = p6.choice
self.choice_p7 = p7.choice
self.choice_p8 = p8.choice
#determine which player's choice to use
if Constants.choiceprob1 <= Constants.choiceprob2:
p1.choice2 = p1.choice
p2.choice2 = p1.choice
else:
p1.choice2 = p2.choice
p2.choice2 = p2.choice
if Constants.choiceprob3 <= Constants.choiceprob4:
p3.choice2 = p3.choice
p4.choice2 = p3.choice
else:
p3.choice2 = p4.choice
p4.choice2 = p4.choice
if Constants.choiceprob5 <= Constants.choiceprob6:
p5.choice2 = p5.choice
p6.choice2 = p5.choice
else:
p5.choice2 = p6.choice
p6.choice2 = p6.choice
if Constants.choiceprob7 <= Constants.choiceprob8:
p7.choice2 = p7.choice
p8.choice2 = p7.choice
else:
p7.choice2 = p8.choice
p8.choice2 = p8.choice
#determine which donation role the subject will see
if Constants.donateprob1 <= Constants.donateprob2:
p1.donate = 1
p2.donate = 0
else:
p1.donate = 0
p2.donate = 1
if Constants.donateprob3 <= Constants.donateprob4:
p3.donate = 1
p4.donate = 0
else:
p3.donate = 0
p4.donate = 1
if Constants.donateprob5 <= Constants.donateprob6:
p5.donate = 1
p6.donate = 0
else:
p5.donate = 0
p6.donate = 1
if Constants.donateprob7 <= Constants.donateprob8:
p7.donate = 1
p8.donate = 0
else:
p7.donate = 0
p8.donate = 1
self.donate_p1 = p1.donate
self.donate_p2 = p2.donate
self.donate_p3 = p3.donate
self.donate_p4 = p4.donate
self.donate_p5 = p5.donate
self.donate_p6 = p6.donate
self.donate_p7 = p7.donate
self.donate_p8 = p8.donate
def group_role(self):
p1=self.get_player_by_id(1)
p2=self.get_player_by_id(2)
p3=self.get_player_by_id(3)
p4=self.get_player_by_id(4)
p5=self.get_player_by_id(5)
p6=self.get_player_by_id(6)
p7=self.get_player_by_id(7)
p8=self.get_player_by_id(8)
#determine which role the subject will be
if Constants.roleprob1 <= Constants.roleprob2:
p1.roles = 1
p2.roles = 0
else:
p1.roles = 0
p2.roles = 1
if Constants.roleprob3 <= Constants.roleprob4:
p3.roles = 1
p4.roles = 0
else:
p3.roles = 0
p4.roles = 1
if Constants.roleprob5 <= Constants.roleprob6:
p5.roles = 1
p6.roles = 0
else:
p5.roles = 0
p6.roles = 1
if Constants.roleprob7 <= Constants.roleprob8:
p7.roles = 1
p8.roles = 0
else:
p7.roles = 0
p8.roles = 1
self.role_p1 = p1.roles
self.role_p2 = p2.roles
self.role_p3 = p3.roles
self.role_p4 = p4.roles
self.role_p5 = p5.roles
self.role_p6 = p6.roles
self.role_p7 = p7.roles
self.role_p8 = p8.roles
def max_value(self):
p1=self.get_player_by_id(1)
p2=self.get_player_by_id(2)
p3=self.get_player_by_id(3)
p4=self.get_player_by_id(4)
p5=self.get_player_by_id(5)
p6=self.get_player_by_id(6)
p7=self.get_player_by_id(7)
p8=self.get_player_by_id(8)
self.max2 = max([p1.num_check + p2.num_check, p3.num_check + p4.num_check, p5.num_check + p6.num_check, p7.num_check + p8.num_check])
def group_winner(self):
p1=self.get_player_by_id(1)
p2=self.get_player_by_id(2)
p3=self.get_player_by_id(3)
p4=self.get_player_by_id(4)
p5=self.get_player_by_id(5)
p6=self.get_player_by_id(6)
p7=self.get_player_by_id(7)
p8=self.get_player_by_id(8)
self.wintotal = p1.winner + p2.winner + p3.winner + p4.winner + p5.winner + p6.winner + p7.winner + p8.winner
if p1.winner == 0:
p1.winprob2 = 0
p2.winprob2 = 0
else:
p1.winprob2 = p1.winprob
p2.winprob2 = p1.winprob
if p3.winner == 0:
p3.winprob2 = 0
p4.winprob2 = 0
else:
p3.winprob2 = p3.winprob
p4.winprob2 = p3.winprob
if p5.winner == 0:
p5.winprob2 = 0
p6.winprob2 = 0
else:
p5.winprob2 = p5.winprob
p6.winprob2 = p5.winprob
if p7.winner == 0:
p7.winprob2 = 0
p8.winprob2 = 0
else:
p7.winprob2 = p7.winprob
p8.winprob2 = p7.winprob
self.maxwin = max(p1.winprob2, p3.winprob2, p5.winprob2, p7.winprob2)
## for p in self.get_players():
## if p.winprob2 == 0:
## p.task2_payoff = p.payoff_task2
## elif p.winprob2 == self.maxwin:
## p.task2_payoff = p.payoff_task2 * 4
## elif p.winprob2 < self.maxwin:
## p.task2_payoff = 0.0
def group_sum(self):
self.sums11 = sum ([p.s11count for p in self.get_players()])
self.sums12 = sum ([p.s12count for p in self.get_players()])
self.sums13 = sum ([p.s13count for p in self.get_players()])
self.sums14 = sum ([p.s14count for p in self.get_players()])
self.sums15 = sum ([p.s15count for p in self.get_players()])
self.maxnorm1 = max(sum ([p.s11count for p in self.get_players()]), sum ([p.s12count for p in self.get_players()]), sum ([p.s13count for p in self.get_players()]), sum ([p.s14count for p in self.get_players()]), sum ([p.s15count for p in self.get_players()]))
self.sums21 = sum ([p.s21count for p in self.get_players()])
self.sums22 = sum ([p.s22count for p in self.get_players()])
self.sums23 = sum ([p.s23count for p in self.get_players()])
self.sums24 = sum ([p.s24count for p in self.get_players()])
self.sums25 = sum ([p.s25count for p in self.get_players()])
self.maxnorm2 = max(sum ([p.s21count for p in self.get_players()]), sum ([p.s22count for p in self.get_players()]), sum ([p.s23count for p in self.get_players()]), sum ([p.s24count for p in self.get_players()]), sum ([p.s25count for p in self.get_players()]))
self.sums31 = sum ([p.s31count for p in self.get_players()])
self.sums32 = sum ([p.s32count for p in self.get_players()])
self.sums33 = sum ([p.s33count for p in self.get_players()])
self.sums34 = sum ([p.s34count for p in self.get_players()])
self.sums35 = sum ([p.s35count for p in self.get_players()])
self.maxnorm3 = max(sum ([p.s31count for p in self.get_players()]), sum ([p.s32count for p in self.get_players()]), sum ([p.s33count for p in self.get_players()]), sum ([p.s34count for p in self.get_players()]), sum ([p.s35count for p in self.get_players()]))
self.sums41 = sum ([p.s41count for p in self.get_players()])
self.sums42 = sum ([p.s42count for p in self.get_players()])
self.sums43 = sum ([p.s43count for p in self.get_players()])
self.sums44 = sum ([p.s44count for p in self.get_players()])
self.sums45 = sum ([p.s45count for p in self.get_players()])
self.maxnorm4 = max(sum ([p.s41count for p in self.get_players()]), sum ([p.s42count for p in self.get_players()]), sum ([p.s43count for p in self.get_players()]), sum ([p.s44count for p in self.get_players()]), sum ([p.s45count for p in self.get_players()]))
self.sums51 = sum ([p.s51count for p in self.get_players()])
self.sums52 = sum ([p.s52count for p in self.get_players()])
self.sums53 = sum ([p.s53count for p in self.get_players()])
self.sums54 = sum ([p.s54count for p in self.get_players()])
self.sums55 = sum ([p.s55count for p in self.get_players()])
self.maxnorm5 = max(sum ([p.s51count for p in self.get_players()]), sum ([p.s52count for p in self.get_players()]), sum ([p.s53count for p in self.get_players()]), sum ([p.s54count for p in self.get_players()]), sum ([p.s55count for p in self.get_players()]))
self.sums61 = sum ([p.s61count for p in self.get_players()])
self.sums62 = sum ([p.s62count for p in self.get_players()])
self.sums63 = sum ([p.s63count for p in self.get_players()])
self.sums64 = sum ([p.s64count for p in self.get_players()])
self.sums65 = sum ([p.s65count for p in self.get_players()])
self.maxnorm6 = max(sum ([p.s61count for p in self.get_players()]), sum ([p.s62count for p in self.get_players()]), sum ([p.s63count for p in self.get_players()]), sum ([p.s64count for p in self.get_players()]), sum ([p.s65count for p in self.get_players()]))
self.sums71 = sum ([p.s71count for p in self.get_players()])
self.sums72 = sum ([p.s72count for p in self.get_players()])
self.sums73 = sum ([p.s73count for p in self.get_players()])
self.sums74 = sum ([p.s74count for p in self.get_players()])
self.sums75 = sum ([p.s75count for p in self.get_players()])
self.maxnorm7 = max(sum ([p.s71count for p in self.get_players()]), sum ([p.s72count for p in self.get_players()]), sum ([p.s73count for p in self.get_players()]), sum ([p.s74count for p in self.get_players()]), sum ([p.s75count for p in self.get_players()]))
self.sums81 = sum ([p.s81count for p in self.get_players()])
self.sums82 = sum ([p.s82count for p in self.get_players()])
self.sums83 = sum ([p.s83count for p in self.get_players()])
self.sums84 = sum ([p.s84count for p in self.get_players()])
self.sums85 = sum ([p.s85count for p in self.get_players()])
self.maxnorm8 = max(sum ([p.s81count for p in self.get_players()]), sum ([p.s82count for p in self.get_players()]), sum ([p.s83count for p in self.get_players()]), sum ([p.s84count for p in self.get_players()]), sum ([p.s85count for p in self.get_players()]))
class Player(BasePlayer):
########################## TASK 1 #####################################
#their answers to questions in task 1
q1_t1 = models.IntegerField(label= " ")
q2_t1 = models.IntegerField(label= " ")
q3_t1 = models.IntegerField(label= " ")
q4_t1 = models.IntegerField(label= " ")
q5_t1 = models.IntegerField(label= " ")
q6_t1 = models.IntegerField(label= " ")
q7_t1 = models.IntegerField(label= " ")
q8_t1 = models.IntegerField(label= " ")
q9_t1 = models.IntegerField(label= " ")
q10_t1 = models.IntegerField(label= " ")
q11_t1 = models.IntegerField(label= " ")
q12_t1 = models.IntegerField(label= " ")
q13_t1 = models.IntegerField(label= " ")
q14_t1 = models.IntegerField(label= " ")
q15_t1 = models.IntegerField(label= " ")
q16_t1 = models.IntegerField(label= " ")
q17_t1 = models.IntegerField(label= " ")
q18_t1 = models.IntegerField(label= " ")
q19_t1 = models.IntegerField(label= " ")
q20_t1 = models.IntegerField(label= " ")
#tells if their answers are correct in task 1
correct_q1_t1 = models.IntegerField(initial=0)
correct_q2_t1 = models.IntegerField(initial=0)
correct_q3_t1 = models.IntegerField(initial=0)
correct_q4_t1 = models.IntegerField(initial=0)
correct_q5_t1 = models.IntegerField(initial=0)
correct_q6_t1 = models.IntegerField(initial=0)
correct_q7_t1 = models.IntegerField(initial=0)
correct_q8_t1 = models.IntegerField(initial=0)
correct_q9_t1 = models.IntegerField(initial=0)
correct_q10_t1 = models.IntegerField(initial=0)
correct_q11_t1 = models.IntegerField(initial=0)
correct_q12_t1 = models.IntegerField(initial=0)
correct_q13_t1 = models.IntegerField(initial=0)
correct_q14_t1 = models.IntegerField(initial=0)
correct_q15_t1 = models.IntegerField(initial=0)
correct_q16_t1 = models.IntegerField(initial=0)
correct_q17_t1 = models.IntegerField(initial=0)
correct_q18_t1 = models.IntegerField(initial=0)
correct_q19_t1 = models.IntegerField(initial=0)
correct_q20_t1 = models.IntegerField(initial=0)
#payoff for Task1
payoff_task1 = models.FloatField() #payoff task 1
total_task1 = models.IntegerField() #number correct task 1
########################## TASK 2 #####################################
#their answers for question 1 and question 2 task 2
q1_t2 = models.IntegerField(label= " ")
q2_t2 = models.IntegerField(label= " ")
q3_t2 = models.IntegerField(label= " ")
q4_t2 = models.IntegerField(label= " ")
q5_t2 = models.IntegerField(label= " ")
q6_t2 = models.IntegerField(label= " ")
q7_t2 = models.IntegerField(label= " ")
q8_t2 = models.IntegerField(label= " ")
q9_t2 = models.IntegerField(label= " ")
q10_t2 = models.IntegerField(label= " ")
q11_t2 = models.IntegerField(label= " ")
q12_t2 = models.IntegerField(label= " ")
q13_t2 = models.IntegerField(label= " ")
q14_t2 = models.IntegerField(label= " ")
q15_t2 = models.IntegerField(label= " ")
q16_t2 = models.IntegerField(label= " ")
q17_t2 = models.IntegerField(label= " ")
q18_t2 = models.IntegerField(label= " ")
q19_t2 = models.IntegerField(label= " ")
q20_t2 = models.IntegerField(label= " ")
#tells if their answers are correct in task 2
correct_q1_t2 = models.IntegerField(initial=0)
correct_q2_t2 = models.IntegerField(initial=0)
correct_q3_t2 = models.IntegerField(initial=0)
correct_q4_t2 = models.IntegerField(initial=0)
correct_q5_t2 = models.IntegerField(initial=0)
correct_q6_t2 = models.IntegerField(initial=0)
correct_q7_t2 = models.IntegerField(initial=0)
correct_q8_t2 = models.IntegerField(initial=0)
correct_q9_t2 = models.IntegerField(initial=0)
correct_q10_t2 = models.IntegerField(initial=0)
correct_q11_t2 = models.IntegerField(initial=0)
correct_q12_t2 = models.IntegerField(initial=0)
correct_q13_t2 = models.IntegerField(initial=0)
correct_q14_t2 = models.IntegerField(initial=0)
correct_q15_t2 = models.IntegerField(initial=0)
correct_q16_t2 = models.IntegerField(initial=0)
correct_q17_t2 = models.IntegerField(initial=0)
correct_q18_t2 = models.IntegerField(initial=0)
correct_q19_t2 = models.IntegerField(initial=0)
correct_q20_t2 = models.IntegerField(initial=0)
#PAYMENT
#number correct for player for payoff
num_task2 = models.FloatField(initial=0)
#number total group correct for if statement
num_check = models.IntegerField(initial=0)
#number correct for group for payment
numtotal_task2= models.FloatField(initial=0)
#number total group correct for if statment
numtotal_check = models.IntegerField(initial=0)
#probability of recieving payment type
paymentprob = models.IntegerField(initial = Constants.paymentprob)
gambleprob = models.IntegerField(initial = Constants.gambleprob)
#payment for task 2
payoff_task2 = models.FloatField(initial=0)
#max number correct
max = models.IntegerField(initial=0)
#final payment
final_pay = models.FloatField(initial=0)
#1 if they see role; 0 if they see gender
donate = models.IntegerField()
#1 if breadwinner; 0 if supporter
roles = models.IntegerField()
winner = models.IntegerField()
winprob = models.IntegerField()
winprob2 = models.IntegerField()
## task2_payoff = models.FloatField()
#answer to what payment type they choose
choice = models.IntegerField(initial=0,
choices=[
[0, '0: Piece Rate'],
[1, '1: Entering the Tournament with probability 20%.'],
[2, '2: Entering the Tournament with probability 40%.'],
[3, '3: Entering the Tournament with probability 60%.'],
[4, '4: Entering the Tournament with probability 80%.'],
[5, '5: Entering the Tournament for sure.'],
]
)
choice2 = models.IntegerField()
# social norm
payoff_s = models.FloatField(initial=0)
payoff_s1 = models.FloatField(initial=0)
payoff_s2 = models.FloatField(initial=0)
payoff_s3 = models.FloatField(initial=0)
payoff_s4 = models.FloatField(initial=0)
payoff_s5 = models.FloatField(initial=0)
payoff_s6 = models.FloatField(initial=0)
payoff_s7 = models.FloatField(initial=0)
payoff_s8 = models.FloatField(initial=0)
#################### Survey #################################
donation1 = models.FloatField(min = 0, label = "Allocation to this group member")
donation2 = models.FloatField(min=0, label ="Allocation to this group member")
payoff_gc = models.FloatField()
s11count = models.IntegerField(initial=0)
s12count = models.IntegerField(initial=0)
s13count = models.IntegerField(initial=0)
s14count = models.IntegerField(initial=0)
s15count = models.IntegerField(initial=0)
s21count = models.IntegerField(initial=0)
s22count = models.IntegerField(initial=0)
s23count = models.IntegerField(initial=0)
s24count = models.IntegerField(initial=0)
s25count = models.IntegerField(initial=0)
s31count = models.IntegerField(initial=0)
s32count = models.IntegerField(initial=0)
s33count = models.IntegerField(initial=0)
s34count = models.IntegerField(initial=0)
s35count = models.IntegerField(initial=0)
s41count = models.IntegerField(initial=0)
s42count = models.IntegerField(initial=0)
s43count = models.IntegerField(initial=0)
s44count = models.IntegerField(initial=0)
s45count = models.IntegerField(initial=0)
s51count = models.IntegerField(initial=0)
s52count = models.IntegerField(initial=0)
s53count = models.IntegerField(initial=0)
s54count = models.IntegerField(initial=0)
s55count = models.IntegerField(initial=0)
s61count = models.IntegerField(initial=0)
s62count = models.IntegerField(initial=0)
s63count = models.IntegerField(initial=0)
s64count = models.IntegerField(initial=0)
s65count = models.IntegerField(initial=0)
s71count = models.IntegerField(initial=0)
s72count = models.IntegerField(initial=0)
s73count = models.IntegerField(initial=0)
s74count = models.IntegerField(initial=0)
s75count = models.IntegerField(initial=0)
s81count = models.IntegerField(initial=0)
s82count = models.IntegerField(initial=0)
s83count = models.IntegerField(initial=0)
s84count = models.IntegerField(initial=0)
s85count = models.IntegerField(initial=0)
s1 = models.IntegerField(label = "1. Please indicate in the five-scale how competitive do you think a woman should be if she is the supporter in her household? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s2 = models.IntegerField(label = "2. Please indicate in the five-scale how competitive do you think a woman should be if she is the breadwinner in a household? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s3 = models.IntegerField(label = "3. Please indicate in the five-scale how competitive do you think a woman should be? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s4 = models.IntegerField(label = "4. Please indicate in the five-scale how competitive do you think a breadwinner of a household should be? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s5 = models.IntegerField(label = "5. Please indicate in the five-scale how competitive do you think a man should be if he is the supporter in a household? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s6 = models.IntegerField(label = "6. Please indicate in the five-scale how competitive do you think a supporter of a household should be? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s7 = models.IntegerField(label = "7. Please indicate in the five-scale how competitive do you think a man should be? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
s8 = models.IntegerField(label = "8. Please indicate in the five-scale how competitive do you think a man should be if he is the breadwinner in a household? If your answer is the same as the most frequent answer for this question in today's experiment, then you will get extra 10 cents.",
choices =[
[1, '1 (Not competitive at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5 (Very competitive)'],
], widget = widgets.RadioSelectHorizontal
)
choicegc = models.IntegerField(label = 'Gambel Choice',
choices =[
[1, 'Gamble 1: A: 50% chance of earning 28 cents, B: 50% chance of earning 28 cents'],
[2, 'Gamble 2: A: 50% chance of earning 24 cents, B: 50% chance of earning 36 cents'],
[3, 'Gamble 3: A: 50% chance of earning 20 cents, B: 50% chance of earning 44 cents'],
[4, 'Gamble 4: A: 50% chance of earning 16 cents, B: 50% chance of earning 52 cents'],
[5, 'Gamble 5: A: 50% chance of earning 12 cents, B: 50% chance of earning 60 cents'],
[6, 'Gamble 6: A: 50% chance of earning 2 cents, B: 50% chance of earning 70 cents'],
], widget = widgets.RadioSelectHorizontal
)
s9 = models.IntegerField(label = "10. Do you think that your performance in Task 1 is better than your partner? If your guess is correct, then you will get extra 10 cents.",
choices =[
[0, 'No'],
[1, 'Yes'],
], widget = widgets.RadioSelect
)
rank1 = models.IntegerField(label = "11. Please estimate the rank of your performance relative to the rest of the participants in Task 1? For example, if you check 1, you consider your group as better than all other 7 participants. If your guess is correct, then you will get extra 10 cents.",
choices =[
[1, '1'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5'],
[6, '6'],
[7, '7'],
[8, '8'],
], widget = widgets.RadioSelectHorizontal
)
s10 = models.IntegerField(label = "12. Please estimate the rank of your group performance relative to the rest of the groups in Task 1? For example, if you check 1, you consider your group as better than all other three groups. If your guess is correct, then you will get extra 10 cents.",
choices =[
[1, '1'],
[2, '2'],
[3, '3'],
[4, '4'],
], widget = widgets.RadioSelectHorizontal
)
s11 = models.IntegerField(label = "13. If you were given $100 and had an opportunity to invest in a risky asset which has a 50% chance of earning 2.5 times of your investment and 50% of earning zero, how much of the $100 will you invest?")
s12 = models.IntegerField(label = "14. If you can choose your role in a household, what is your option? (Breadwinner or Supporter)",
choices =[
[1, "Breadwinner"],
[2, "Supporter"],
], widget = widgets.RadioSelect
)
s14 = models.IntegerField(label = "15. Do you think men or women generally do better in the math problem-task that you just did?",
choices =[
[0, 'No'],
[1, 'Yes'],
[2, 'Equal'],
], widget = widgets.RadioSelect
)
s15 = models.IntegerField(label = "16. How do you see yourself: Are you generally a person who is fully prepared to take risks or do you try to avoid taking risks?",
choices =[
[1, '1 (Not at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5'],
[6, '6'],
[7, '7'],
[8, '8'],
[9, '9'],
[10, '10 (Very willing)'],
], widget = widgets.RadioSelectHorizontal
)
s16 = models.IntegerField(label = "17. Do you consider yourself a competitive person? Please rate on a scale of 1 to 10",
choices =[
[1, '1 (Not at all)'],
[2, '2'],
[3, '3'],
[4, '4'],
[5, '5'],
[6, '6'],
[7, '7'],
[8, '8'],
[9, '9'],
[10, '10 (Extremely)'],
], widget = widgets.RadioSelectHorizontal
)
s17 = models.StringField(label = "18. Was there any part of the experiment that confused you? If yes, please explain. If no, type N/A.")
s18 = models.IntegerField(label = "19. Do you agree that husband and wife should both contribute to income?",
choices =[
[0, 'No'],
[1, 'Yes'],
], widget = widgets.RadioSelect
)
s19 = models.IntegerField(label = "20. Do you agree that if a woman earns more money than her husband, it's almost certain to cause problems?",
choices =[
[0, 'No'],
[1, 'Yes'],
], widget = widgets.RadioSelect
)
s20 = models.IntegerField(label = "21. What is your gender?",
choices =[
[0, 'Female'],
[1, 'Male'],
], widget = widgets.RadioSelect
)
s21 = models.IntegerField(label = "22. What is your age?")
s22 = models.IntegerField(label = "23. What is the total number of persons living in your household?")
s23 = models.StringField(label = "24. Your occupation? (Please list all of them, if you are enrolling more than one job)")
s24 = models.IntegerField(label = "25. Your education",
choices =[
[1, 'Some High School or less'],
[2, 'High School Diploma'],
[3, 'Some College'],
[4, '2 year/Associates Degree'],
[5, '4 year/Bachelor’s Degree'],
[6, 'Some Graduate School'],
[7, 'Graduate Degree'],
], widget = widgets.RadioSelect
)
s25 = models.StringField(label = "26. Your nationality?")
s26 = models.StringField(label = "27. Your race?")
s27 = models.IntegerField(label = "28. Please indicate your last year family income?",
choices =[
[1, '<50,000'],
[2, '50,000-100,000'],
[3, '>100,000'],
], widget = widgets.RadioSelect
)
s28 = models.IntegerField(label = "Have you used a calculator during the experiment?",
choices =[
[0, 'No'],
[1, 'Yes'],
], widget = widgets.RadioSelect
)