from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = 'School choice experiment' class Constants(BaseConstants): name_in_url = 'school_choice' players_per_group = 5 num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): two_thirds_avg = models.FloatField() num_winners = models.IntegerField() best_guess = models.IntegerField() def Results1(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) SA=0 SB=0 SC=0 SD=0 SE=0 A='A' B='B' C='C' D='D' E='E' N='N' #第一轮志愿筛选 if p2.First_choice == A: p2.L=A SA=2 if p2.First_choice != A and p1.First_choice == A: p1.L=A SA=1 if p2.First_choice != A and p1.First_choice != A and p5.First_choice == A: p5.L=A SA=5 if p2.First_choice != A and p1.First_choice !=A and p5.First_choice != A and p4.First_choice == A: p4.L=A SA=4 if p2.First_choice !=A and p1.First_choice !=A and p5.First_choice != A and p4.First_choice !=A and p3.First_choice ==A: p3.L=A SA=3 if p3.First_choice == B: p3.L=B SB=3 if p3.First_choice !=B and p5.First_choice ==B: p5.L=B SB=5 if p3.First_choice !=B and p5.First_choice !=B and p4.First_choice ==B: p4.L=B SB=4 if p3.First_choice !=B and p5.First_choice !=B and p4.First_choice !=B and p1.First_choice ==B: p1.L=B SB=1 if p3.First_choice !=B and p5.First_choice !=B and p4.First_choice !=B and p1.First_choice !=B and p2.First_choice ==B: p2.L=B SB=2 if p4.First_choice==C: p4.L=C SC=4 if p4.First_choice !=C and p5.First_choice ==C: p5.L=C SC=5 if p4.First_choice !=C and p5.First_choice !=C and p2.First_choice ==C: p2.L=C SC=2 if p4.First_choice !=C and p5.First_choice !=C and p2.First_choice !=C and p3.First_choice ==C: p3.L=C SC=3 if p4.First_choice !=C and p5.First_choice !=C and p2.First_choice !=C and p3.First_choice !=C and p1.First_choice ==C: p1.L=C SC=1 if p2.First_choice==D: p2.L=D SD=2 if p2.First_choice !=D and p5.First_choice ==D: p5.L=D SC=5 if p2.First_choice !=D and p5.First_choice !=D and p1.First_choice ==D: p1.L=D SD=1 if p2.First_choice !=D and p5.First_choice !=D and p1.First_choice !=D and p4.First_choice ==D: p4.L=D SD=4 if p2.First_choice !=D and p5.First_choice !=D and p1.First_choice !=D and p4.First_choice !=D and p3.First_choice ==D: p3.L=D SD=3 if p3.First_choice==E: p3.L=E SE=3 if p3.First_choice !=E and p2.First_choice ==E: p2.L=E SE=2 if p3.First_choice !=E and p2.First_choice !=E and p5.First_choice ==E: p5.L=E SE=5 if p3.First_choice !=E and p2.First_choice !=E and p5.First_choice !=E and p4.First_choice ==E: p4.L=E SE=4 if p3.First_choice !=E and p2.First_choice !=E and p5.First_choice !=E and p4.First_choice !=E and p1.First_choice ==E: p1.L=E SE=1 #第二轮志愿筛选 if SA==0: if p2.Second_choice !=A or p2.L != N: if p1.Second_choice !=A or p1.L !=N: if p5.Second_choice !=A or p5.L!=N: if p4.Second_choice !=A or p4.L !=N: if p3.Second_choice ==A and p3.L==N: p3.L=A SA=3 if p4.Second_choice ==A and p4.L ==N: p4.L=A SA=4 if p5.Second_choice ==A and p5.L==N: p5.L=A SA=5 if p1.Second_choice ==A and p1.L ==N: p1.L=A SA=1 if p2.Second_choice==A and p2.L==N: p2.L=A SA=2 if SB==0: if p3.Second_choice !=B or p3.L !=N: if p5.Second_choice !=B or p5.L!=N: if p4.Second_choice ==B and p4.L==N: if p1.Second_choice !=B or p1.L!=N: if p2.Second_choice ==B and p2.L==N: p2.L=B SB=2 if p1.Second_choice ==B and p1.L==N: p1.L=B SB=1 if p4.Second_choice ==B and p4.L==N: p4.L=B SB=4 if p5.Second_choice ==B and p5.L==N: p5.L=B SB=5 if p3.Second_choice==B and p3.L==N: p3.L=B SB=3 if SC==0: if p4.Second_choice !=C or p4.L !=N: if p5.Second_choice !=C or p5.L != N: if p2.Second_choice !=C or p2.L !=N: if p3.Second_choice !=C or p3.L != N: if p1.Second_choice ==C and p1.L==N: p1.L=C SC=1 if p3.Second_choice ==C and p3.L==N: p3.L=C SC=3 if p2.Second_choice ==C and p2.L==N: p2.L=C SC=2 if p5.Second_choice ==C and p5.L==N: p5.L=C SC=5 if p4.Second_choice==C and p4.L==N: p4.L=C SC=4 if SD==0: if p2.Second_choice !=D or p2.L!=N: if p5.Second_choice !=D or p5.L !=N: if p1.Second_choice !=D or p1.L!=N: if p4.Second_choice !=D or p4.L!=N: if p3.Second_choice ==D and p3.L==N: p3.L=D SD=3 if p4.Second_choice ==D and p4.L==N: p4.L=D SD=4 if p1.Second_choice ==D and p1.L==N: p1.L=D SD=1 if p5.Second_choice ==D and p5.L==N: p5.L=D SD=5 if p2.Second_choice==D and p2.L==N: p2.L=D SD=2 if SE==0: if p3.Second_choice !=E or p3.L != N: if p2.Second_choice !=E or p2.L != N: if p5.Second_choice !=E or p5.L !=N: if p4.Second_choice !=E or p4.L !=N: if p1.Second_choice ==E and p1.L==N: p1.L=E SE=1 if p4.Second_choice ==E and p4.L==N: p4.L=E SE=4 if p5.Second_choice ==E and p5.L==N: p5.L=E SE=5 if p2.Second_choice ==E and p2.L==N: p2.L=E SE=2 if p3.Second_choice==E and p3.L==N: p3.L=E SE=3 #第三轮志愿筛选 if SA==0: if p2.Third_choice !=A or p2.L != N: if p1.Third_choice !=A or p1.L !=N: if p5.Third_choice !=A or p5.L!=N: if p4.Third_choice !=A or p4.L !=N: if p3.Third_choice ==A and p3.L==N: p3.L=A SA=3 if p4.Third_choice ==A and p4.L ==N: p4.L=A SA=4 if p5.Third_choice ==A and p5.L==N: p5.L=A SA=5 if p1.Third_choice ==A and p1.L ==N: p1.L=A SA=1 if p2.Third_choice==A and p2.L==N: p2.L=A SA=2 if SB==0: if p3.Third_choice !=B or p3.L !=N: if p5.Third_choice !=B or p5.L!=N: if p4.Third_choice ==B and p4.L==N: if p1.Third_choice !=B or p1.L!=N: if p2.Third_choice ==B and p2.L==N: p2.L=B SB=2 if p1.Third_choice ==B and p1.L==N: p1.L=B SB=1 if p4.Third_choice ==B and p4.L==N: p4.L=B SB=4 if p5.Third_choice ==B and p5.L==N: p5.L=B SB=5 if p3.Third_choice==B and p3.L==N: p3.L=B SB=3 if SC==0: if p4.Third_choice !=C or p4.L !=N: if p5.Third_choice !=C or p5.L != N: if p2.Third_choice !=C or p2.L !=N: if p3.Third_choice !=C or p3.L != N: if p1.Third_choice ==C and p1.L==N: p1.L=C SC=1 if p3.Third_choice ==C and p3.L==N: p3.L=C SC=3 if p2.Third_choice ==C and p2.L==N: p2.L=C SC=2 if p5.Third_choice ==C and p5.L==N: p5.L=C SC=5 if p4.Third_choice==C and p4.L==N: p4.L=C SC=4 if SD==0: if p2.Third_choice !=D or p2.L!=N: if p5.Third_choice !=D or p5.L !=N: if p1.Third_choice !=D or p1.L!=N: if p4.Third_choice !=D or p4.L!=N: if p3.Third_choice ==D and p3.L==N: p3.L=D SD=3 if p4.Third_choice ==D and p4.L==N: p4.L=D SD=4 if p1.Third_choice ==D and p1.L==N: p1.L=D SD=1 if p5.Third_choice ==D and p5.L==N: p5.L=D SD=5 if p2.Third_choice==D and p2.L==N: p2.L=D SD=2 if SE==0: if p3.Third_choice !=E or p3.L != N: if p2.Third_choice !=E or p2.L != N: if p5.Third_choice !=E or p5.L !=N: if p4.Third_choice !=E or p4.L !=N: if p1.Third_choice ==E and p1.L==N: p1.L=E SE=1 if p4.Third_choice ==E and p4.L==N: p4.L=E SE=4 if p5.Third_choice ==E and p5.L==N: p5.L=E SE=5 if p2.Third_choice ==E and p2.L==N: p2.L=E SE=2 if p3.Third_choice==E and p3.L==N: p3.L=E SE=3 #第四轮志愿筛选 if SA==0: if p2.Fourth_choice !=A or p2.L != N: if p1.Fourth_choice !=A or p1.L !=N: if p5.Fourth_choice !=A or p5.L!=N: if p4.Fourth_choice !=A or p4.L !=N: if p3.Fourth_choice ==A and p3.L==N: p3.L=A SA=3 if p4.Fourth_choice ==A and p4.L ==N: p4.L=A SA=4 if p5.Fourth_choice ==A and p5.L==N: p5.L=A SA=5 if p1.Fourth_choice ==A and p1.L ==N: p1.L=A SA=1 if p2.Fourth_choice==A and p2.L==N: p2.L=A SA=2 if SB==0: if p3.Fourth_choice !=B or p3.L !=N: if p5.Fourth_choice !=B or p5.L!=N: if p4.Fourth_choice ==B and p4.L==N: if p1.Fourth_choice !=B or p1.L!=N: if p2.Fourth_choice ==B and p2.L==N: p2.L=B SB=2 if p1.Fourth_choice ==B and p1.L==N: p1.L=B SB=1 if p4.Fourth_choice ==B and p4.L==N: p4.L=B SB=4 if p5.Fourth_choice ==B and p5.L==N: p1.L=B SB=1 if p3.Fourth_choice==B and p3.L==N: p3.L=B SB=3 if SC==0: if p4.Fourth_choice !=C or p4.L !=N: if p5.Fourth_choice !=C or p5.L != N: if p2.Fourth_choice !=C or p2.L !=N: if p3.Fourth_choice !=C or p3.L != N: if p1.Fourth_choice ==C and p1.L==N: p1.L=C SC=1 if p3.Fourth_choice ==C and p3.L==N: p3.L=C SC=3 if p2.Fourth_choice ==C and p2.L==N: p2.L=C SC=2 if p5.Fourth_choice ==C and p5.L==N: p5.L=C SC=5 if p4.Fourth_choice==C and p4.L==N: p4.L=C SC=4 if SD==0: if p2.Fourth_choice !=D or p2.L!=N: if p5.Fourth_choice !=D or p5.L !=N: if p2.Fourth_choice !=D or p2.L!=N: if p4.Fourth_choice !=D or p4.L!=N: if p3.Fourth_choice ==D and p3.L==N: p3.L=D SD=3 if p4.Fourth_choice ==D and p4.L==N: p4.L=D SD=4 if p1.Fourth_choice ==D and p1.L==N: p1.L=D SD=21 if p5.Fourth_choice ==D and p5.L==N: p5.L=D SD=5 if p2.Fourth_choice==D and p2.L==N: p2.L=D SD=2 if SE==0: if p3.Fourth_choice !=E or p3.L != N: if p2.Fourth_choice !=E or p2.L != N: if p5.Fourth_choice !=E or p5.L !=N: if p4.Fourth_choice !=E or p4.L !=N: if p1.Fourth_choice ==E and p1.L==N: p1.L=E SE=1 if p4.Fourth_choice ==E and p4.L==N: p4.L=E SE=4 if p5.Fourth_choice ==E and p5.L==N: p5.L=E SE=5 if p2.Fourth_choice ==E and p2.L==N: p2.L=E SE=2 if p3.Fourth_choice==E and p3.L==N: p3.L=E SE=3 #第五轮志愿筛选 if SA==0: if p2.Fifth_choice !=A or p2.L != N: if p1.Fifth_choice !=A or p1.L !=N: if p5.Fifth_choice !=A or p5.L!=N: if p4.Fifth_choice !=A or p4.L !=N: if p3.Fifth_choice ==A and p3.L==N: p3.L=A SA=3 if p4.Fifth_choice ==A and p4.L ==N: p4.L=A SA=4 if p5.Fifth_choice ==A and p5.L==N: p5.L=A SA=5 if p1.Fifth_choice ==A and p1.L ==N: p1.L=A SA=1 if p2.Fifth_choice==A and p2.L==N: p2.L=A SA=2 if SB==0: if p3.Fifth_choice !=B or p3.L !=N: if p5.Fifth_choice !=B or p5.L!=N: if p4.Fifth_choice ==B and p4.L==N: if p1.Fifth_choice !=B or p1.L!=N: if p2.Fifth_choice ==B and p2.L==N: p2.L=B SB=2 if p1.Fifth_choice ==B and p1.L==N: p1.L=B SB=1 if p4.Fifth_choice ==B and p4.L==N: p4.L=B SB=4 if p5.Fifth_choice ==B and p5.L==N: p5.L=B SB=5 if p3.Fifth_choice==B and p3.L==N: p3.L=B SB=3 if SC==0: if p4.Fifth_choice !=C or p4.L !=N: if p5.Fifth_choice !=C or p5.L != N: if p2.Fifth_choice !=C or p2.L !=N: if p3.Fifth_choice !=C or p3.L != N: if p1.Fifth_choice ==C and p1.L==N: p1.L=C SC=1 if p3.Fifth_choice ==C and p3.L==N: p3.L=C SC=3 if p2.Fifth_choice ==C and p2.L==N: p2.L=C SC=2 if p5.Fifth_choice ==C and p5.L==N: p5.L=C SC=5 if p4.Fifth_choice==C and p4.L==N: p4.L=C SC=4 if SD==0: if p2.Fifth_choice !=D or p2.L!=N: if p5.Fifth_choice !=D or p5.L !=N: if p1.Fifth_choice !=D or p1.L!=N: if p4.Fifth_choice !=D or p4.L!=N: if p3.Fifth_choice ==D and p3.L==N: p3.L=D SD=3 if p4.Fifth_choice ==D and p4.L==N: p4.L=D SD=4 if p1.Fifth_choice ==D and p1.L==N: p1.L=D SD=1 if p5.Fifth_choice ==D and p5.L==N: p5.L=D SD=5 if p2.Fifth_choice==D and p2.L==N: p2.L=D SD=2 if SE==0: if p3.Fifth_choice !=E or p3.L != N: if p2.Fifth_choice !=E or p2.L != N: if p5.Fifth_choice !=E or p5.L !=N: if p4.Fifth_choice !=E or p4.L !=N: if p1.Fifth_choice ==E and p1.L==N: p1.L=E SE=1 if p4.Fifth_choice ==E and p4.L==N: p4.L=E SE=4 if p5.Fifth_choice ==E and p5.L==N: p5.L=E SE=5 if p2.Fifth_choice ==E and p2.L==N: p2.L=E SE=2 if p3.Fifth_choice==E and p3.L==N: p3.L=E SE=3 def Payoff1(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) if p5.L=='A': p5.pc=100 if p5.L=='B': p5.pc=80 if p5.L=='C': p5.pc=60 if p5.L=='D': p5.pc=40 if p5.L=='E': p5.pc=20 if p1.L=='A': p1.pc=100 if p1.L=='B': p1.pc=40 if p1.L=='C': p1.pc=80 if p1.L=='D': p1.pc=60 if p1.L=='E': p1.pc=20 if p2.L=='A': p2.pc=60 if p2.L=='B': p2.pc=40 if p2.L=='C': p2.pc=100 if p2.L=='D': p2.pc=80 if p3.L=='E': p2.pc=20 if p3.L=='A': p3.pc=60 if p3.L=='B': p3.pc=80 if p3.L=='C': p3.pc=100 if p3.L=='D': p3.pc=40 if p3.L=='E': p3.pc=20 if p4.L=='A': p4.pc=100 if p4.L=='B': p4.pc=80 if p4.L=='C': p4.pc=60 if p4.L=='D': p4.pc=40 if p4.L=='E': p4.pc=20 if p1.First_guess==p2.First_choice: p1.pg=p1.pg+10 p1.Right_guess = p1.Right_guess+1 if p1.Second_guess==p3.First_choice: p1.pg=p1.pg+10 p1.Right_guess = p1.Right_guess+1 if p1.Third_guess==p4.First_choice: p1.pg=p1.pg+10 p1.Right_guess = p1.Right_guess+1 if p1.Fourth_guess==p5.First_choice: p1.pg=p1.pg+10 p1.Right_guess = p1.Right_guess+1 if p2.First_guess==p1.First_choice: p2.pg=p2.pg+10 p2.Right_guess = p2.Right_guess+1 if p2.Second_guess==p3.First_choice: p2.pg=p2.pg+10 p2.Right_guess = p2.Right_guess+1 if p2.Third_guess==p4.First_choice: p2.pg=p2.pg+10 p2.Right_guess = p2.Right_guess+1 if p2.Fourth_guess==p5.First_choice: p2.pg=p2.pg+10 p2.Right_guess = p2.Right_guess+1 if p3.First_guess==p1.First_choice: p3.pg=p3.pg+10 p3.Right_guess = p3.Right_guess+1 if p3.Second_guess==p2.First_choice: p3.pg=p3.pg+10 p3.Right_guess = p3.Right_guess+1 if p3.Third_guess==p4.First_choice: p3.pg=p3.pg+10 p3.Right_guess = p3.Right_guess+1 if p3.Fourth_guess==p5.First_choice: p3.pg=p3.pg+10 p3.Right_guess = p3.Right_guess+1 if p4.First_guess==p1.First_choice: p4.pg=p4.pg+10 p4.Right_guess = p4.Right_guess+1 if p4.Second_guess==p2.First_choice: p4.pg=p4.pg+10 p4.Right_guess = p4.Right_guess+1 if p4.Third_guess==p3.First_choice: p4.pg=p4.pg+10 p4.Right_guess = p4.Right_guess+1 if p4.Fourth_guess==p5.First_choice: p4.pg=p4.pg+10 p4.Right_guess = p4.Right_guess+1 if p5.First_guess==p1.First_choice: p5.pg=p5.pg+10 p5.Right_guess = p5.Right_guess+1 if p5.Second_guess==p2.First_choice: p5.pg=p5.pg+10 p5.Right_guess = p5.Right_guess+1 if p5.Third_guess==p3.First_choice: p5.pg=p5.pg+10 p5.Right_guess = p5.Right_guess+1 if p5.Fourth_guess==p4.First_choice: p5.pg=p5.pg+10 p5.Right_guess = p5.Right_guess+1 p1.payoff1=p1.pc+p1.pg p2.payoff1=p2.pc+p2.pg p3.payoff1=p3.pc+p3.pg p4.payoff1=p4.pc+p4.pg p5.payoff1=p5.pc+p5.pg def Q11_20(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) if p1.q11_20-p2.q11_20 == 1: p1.payoff11_20=p1.q11_20+20 p2.payoff11_20=p2.q11_20 if p2.q11_20-p1.q11_20 == 1: p1.payoff11_20=p1.q11_20 p2.payoff11_20=p2.q11_20+20 if p2.q11_20 == p1.q11_20: p1.payoff11_20=p1.q11_20+10 p2.payoff11_20=p2.q11_20+10 if p1.q11_20-p2.q11_20 != 1 and p2.q11_20-p1.q11_20 != 1 and p2.q11_20 != p1.q11_20: p1.payoff11_20=p1.q11_20 p2.payoff11_20=p2.q11_20 if p3.q11_20-p4.q11_20 == 1: p3.payoff11_20=p3.q11_20+20 p4.payoff11_20=p4.q11_20 if p4.q11_20-p3.q11_20 == 1: p3.payoff11_20=p3.q11_20 p4.payoff11_20=p4.q11_20+20 if p4.q11_20 == p3.q11_20: p3.payoff11_20=p3.q11_20+10 p4.payoff11_20=p4.q11_20+10 if p3.q11_20-p4.q11_20 != 1 and p4.q11_20-p3.q11_20 != 1 and p4.q11_20 != p3.q11_20: p3.payoff11_20=p3.q11_20 p4.payoff11_20=p4.q11_20 if p5.q11_20-15 == 1: p5.payoff11_20=p5.q11_20+20 if p5.q11_20 == 15: p5.payoff11_20=p3.q11_20+10 if p5.q11_20-15 != 1 and p5.q11_20 != 15: p5.payoff11_20=p5.q11_20 def Beauty_con(self): players = self.get_players() guesses = [p.guess for p in players] self.two_thirds_avg = (0.7) * sum(guesses) / len(players) self.best_guess = min( guesses, key=lambda guess: abs(guess - self.two_thirds_avg) ) winners = [p for p in players if p.guess == self.best_guess] self.num_winners = len(winners) for p in winners: p.is_winner = True p.payoffB = 20 / self.num_winners def Results2(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) SA2=0 SB2=0 SC2=0 SD2=0 SE2=0 A='A' B='B' C='C' D='D' E='E' N='N' #第一轮志愿筛选 if p1.First_choice2 == A: p1.L2=A SA2=1 if p1.First_choice2 != A and p2.First_choice2 == A: p2.L2=A SA2=2 if p1.First_choice2 != A and p2.First_choice2 != A and p4.First_choice2 == A: p4.L2=A SA2=4 if p1.First_choice2 != A and p2.First_choice2 !=A and p4.First_choice2 != A and p5.First_choice2 == A: p5.L2=A SA2=5 if p1.First_choice2 !=A and p2.First_choice2 !=A and p4.First_choice2 != A and p5.First_choice2 !=A and p3.First_choice2 ==A: p3.L2=A SA2=3 if p1.First_choice2 == B: p1.L2=B SB2=1 if p1.First_choice2 !=B and p2.First_choice2 ==B: p2.L2=B SB2=2 if p1.First_choice2 !=B and p2.First_choice2 !=B and p5.First_choice2 ==B: p5.L2=B SB2=5 if p1.First_choice2 !=B and p2.First_choice2 !=B and p5.First_choice2 !=B and p3.First_choice2 ==B: p3.L2=B SB2=3 if p1.First_choice2 !=B and p2.First_choice2 !=B and p5.First_choice2 !=B and p3.First_choice2 !=B and p4.First_choice2 ==B: p4.L2=B SB2=4 if p3.First_choice2==C: p3.L2=C SC2=3 if p3.First_choice2 !=C and p4.First_choice2 ==C: p4.L2=C SC2=4 if p3.First_choice2 !=C and p4.First_choice2 !=C and p5.First_choice2 ==C: p5.L2=C SC2=3 if p3.First_choice2 !=C and p4.First_choice2 !=C and p5.First_choice2 !=C and p2.First_choice2 ==C: p2.L2=C SC2=2 if p3.First_choice2 !=C and p4.First_choice2 !=C and p5.First_choice2 !=C and p2.First_choice2 !=C and p1.First_choice2 ==C: p1.L2=C SC2=2 if p3.First_choice2==D: p3.L2=D SD2=3 if p3.First_choice2 !=D and p4.First_choice2 ==D: p4.L2=D SD2=4 if p3.First_choice2 !=D and p4.First_choice2 !=D and p5.First_choice2 ==D: p5.L2=D SD2=5 if p3.First_choice2 !=D and p4.First_choice2 !=D and p5.First_choice2 !=D and p1.First_choice2 ==D: p1.L2=D SD2=1 if p3.First_choice2 !=D and p4.First_choice2 !=D and p5.First_choice2 !=D and p1.First_choice2 !=D and p2.First_choice2 ==D: p2.L2=D SD2=2 if p2.First_choice2==E: p2.L2=E SE2=2 if p2.First_choice2 !=E and p5.First_choice2 ==E: p5.L2=E SE2=5 if p2.First_choice2 !=E and p5.First_choice2 !=E and p3.First_choice2 ==E: p3.L2=E SE2=3 if p2.First_choice2 !=E and p5.First_choice2 !=E and p3.First_choice2 !=E and p4.First_choice2 ==E: p4.L2=E SE2=4 if p2.First_choice2 !=E and p5.First_choice2 !=E and p3.First_choice2 !=E and p4.First_choice2 !=E and p1.First_choice2 ==E: p1.L2=E SE2=1 #第二轮志愿筛选 if SA2==0: if p1.Second_choice2 !=A or p3.L2 != N: if p2.Second_choice2 !=A or p2.L2 !=N: if p4.Second_choice2 !=A or p4.L2!=N: if p5.Second_choice2 !=A or p5.L2 !=N: if p3.Second_choice2 ==A and p3.L2==N: p3.L2=A SA2=3 if p5.Second_choice2 ==A and p5.L2 ==N: p5.L2=A SA2=5 if p4.Second_choice2 ==A and p4.L2==N: p4.L2=A SA2=4 if p2.Second_choice2 ==A and p2.L2 ==N: p2.L2=A SA2=2 if p1.Second_choice2==A and p1.L2==N: p1.L2=A SA2=1 if SB2==0: if p1.Second_choice2 !=B or p1.L2 !=N: if p2.Second_choice2 !=B or p2.L2!=N: if p5.Second_choice2 ==B and p5.L2==N: if p3.Second_choice2 !=B or p3.L2!=N: if p4.Second_choice2 ==B and p4.L2==N: p4.L2=B SB2=4 if p3.Second_choice2 ==B and p3.L2==N: p3.L2=B SB2=3 if p5.Second_choice2 ==B and p5.L2==N: p5.L2=B SB2=5 if p2.Second_choice2 ==B and p2.L2==N: p2.L2=B SB2=2 if p1.Second_choice2==B and p1.L2==N: p1.L2=B SB2=1 if SC2==0: if p3.Second_choice2 !=C or p3.L2 !=N: if p4.Second_choice2 !=C or p4.L2 != N: if p5.Second_choice2 !=C or p5.L2 !=N: if p2.Second_choice2 !=C or p2.L2 != N: if p1.Second_choice2 ==C and p1.L2==N: p1.L2=C SC2=1 if p2.Second_choice2 ==C and p2.L2==N: p2.L2=C SC2=2 if p5.Second_choice2 ==C and p5.L2==N: p5.L2=C SC2=5 if p4.Second_choice2 ==C and p4.L2==N: p4.L2=C SC2=4 if p3.Second_choice2==C and p3.L2==N: p3.L2=C SC2=3 if SD2==0: if p3.Second_choice2 !=D or p3.L2!=N: if p4.Second_choice2 !=D or p4.L2 !=N: if p5.Second_choice2 !=D or p5.L2!=N: if p1.Second_choice2 !=D or p1.L2!=N: if p2.Second_choice2 ==D and p2.L2==N: p2.L2=D SD2=2 if p1.Second_choice2 ==D and p1.L2==N: p1.L2=D SD2=1 if p5.Second_choice2 ==D and p5.L2==N: p5.L2=D SD2=5 if p4.Second_choice2 ==D and p4.L2==N: p4.L2=D SD2=4 if p3.Second_choice2==D and p3.L2==N: p3.L2=D SD2=3 if SE2==0: if p2.Second_choice2 !=E or p2.L2 != N: if p5.Second_choice2 !=E or p5.L2 != N: if p3.Second_choice2 !=E or p3.L2 !=N: if p4.Second_choice2 !=E or p4.L2 !=N: if p1.Second_choice2 ==E and p1.L2==N: p1.L2=E SE2=1 if p4.Second_choice2 ==E and p4.L2==N: p4.L2=E SE2=4 if p3.Second_choice2 ==E and p3.L2==N: p3.L2=E SE2=3 if p5.Second_choice2 ==E and p5.L2==N: p5.L2=E SE2=5 if p2.Second_choice2==E and p2.L2==N: p2.L2=E SE2=2 #第三轮志愿筛选 if SA2==0: if p1.Third_choice2 !=A or p3.L2 != N: if p2.Third_choice2 !=A or p2.L2 !=N: if p4.Third_choice2 !=A or p4.L2!=N: if p5.Third_choice2 !=A or p5.L2 !=N: if p3.Third_choice2 ==A and p3.L2==N: p3.L2=A SA2=3 if p5.Third_choice2 ==A and p5.L2 ==N: p5.L2=A SA2=5 if p4.Third_choice2 ==A and p4.L2==N: p4.L2=A SA2=4 if p2.Third_choice2 ==A and p2.L2 ==N: p2.L2=A SA2=2 if p1.Third_choice2==A and p1.L2==N: p1.L2=A SA2=1 if SB2==0: if p1.Third_choice2 !=B or p1.L2 !=N: if p2.Third_choice2 !=B or p2.L2!=N: if p5.Third_choice2 ==B and p5.L2==N: if p3.Third_choice2 !=B or p3.L2!=N: if p4.Third_choice2 ==B and p4.L2==N: p4.L2=B SB2=4 if p3.Third_choice2 ==B and p3.L2==N: p3.L2=B SB2=3 if p5.Third_choice2 ==B and p5.L2==N: p5.L2=B SB2=5 if p2.Third_choice2 ==B and p2.L2==N: p2.L2=B SB2=2 if p1.Third_choice2==B and p1.L2==N: p1.L2=B SB2=1 if SC2==0: if p3.Third_choice2 !=C or p3.L2 !=N: if p4.Third_choice2 !=C or p4.L2 != N: if p5.Third_choice2 !=C or p5.L2 !=N: if p2.Third_choice2 !=C or p2.L2 != N: if p1.Third_choice2 ==C and p1.L2==N: p1.L2=C SC2=1 if p2.Third_choice2 ==C and p2.L2==N: p2.L2=C SC2=2 if p5.Third_choice2 ==C and p5.L2==N: p5.L2=C SC2=5 if p4.Third_choice2 ==C and p4.L2==N: p4.L2=C SC2=4 if p3.Third_choice2==C and p3.L2==N: p3.L2=C SC2=3 if SD2==0: if p3.Third_choice2 !=D or p3.L2!=N: if p4.Third_choice2 !=D or p4.L2 !=N: if p5.Third_choice2 !=D or p5.L2!=N: if p1.Third_choice2 !=D or p1.L2!=N: if p2.Third_choice2 ==D and p2.L2==N: p2.L2=D SD2=2 if p1.Third_choice2 ==D and p1.L2==N: p1.L2=D SD2=1 if p5.Third_choice2 ==D and p5.L2==N: p5.L2=D SD2=5 if p4.Third_choice2 ==D and p4.L2==N: p4.L2=D SD2=4 if p3.Third_choice2==D and p3.L2==N: p3.L2=D SD2=3 if SE2==0: if p2.Third_choice2 !=E or p2.L2 != N: if p5.Third_choice2 !=E or p5.L2 != N: if p3.Third_choice2 !=E or p3.L2 !=N: if p4.Third_choice2 !=E or p4.L2 !=N: if p1.Third_choice2 ==E and p1.L2==N: p1.L2=E SE2=1 if p4.Third_choice2 ==E and p4.L2==N: p4.L2=E SE2=4 if p3.Third_choice2 ==E and p3.L2==N: p3.L2=E SE2=3 if p5.Third_choice2 ==E and p5.L2==N: p5.L2=E SE2=5 if p2.Third_choice2==E and p2.L2==N: p2.L2=E SE2=2 #第四轮志愿筛选 if SA2==0: if p1.Fourth_choice2 !=A or p3.L2 != N: if p2.Fourth_choice2 !=A or p2.L2 !=N: if p4.Fourth_choice2 !=A or p4.L2!=N: if p5.Fourth_choice2 !=A or p5.L2 !=N: if p3.Fourth_choice2 ==A and p3.L2==N: p3.L2=A SA2=3 if p5.Fourth_choice2 ==A and p5.L2 ==N: p5.L2=A SA2=5 if p4.Fourth_choice2 ==A and p4.L2==N: p4.L2=A SA2=4 if p2.Fourth_choice2 ==A and p2.L2 ==N: p2.L2=A SA2=2 if p1.Fourth_choice2==A and p1.L2==N: p1.L2=A SA2=1 if SB2==0: if p1.Fourth_choice2 !=B or p1.L2 !=N: if p2.Fourth_choice2 !=B or p2.L2!=N: if p5.Fourth_choice2 ==B and p5.L2==N: if p3.Fourth_choice2 !=B or p3.L2!=N: if p4.Fourth_choice2 ==B and p4.L2==N: p4.L2=B SB2=4 if p3.Fourth_choice2 ==B and p3.L2==N: p3.L2=B SB2=3 if p5.Fourth_choice2 ==B and p5.L2==N: p5.L2=B SB2=5 if p2.Fourth_choice2 ==B and p2.L2==N: p2.L2=B SB2=2 if p1.Fourth_choice2==B and p1.L2==N: p1.L2=B SB2=1 if SC2==0: if p3.Fourth_choice2 !=C or p3.L2 !=N: if p4.Fourth_choice2 !=C or p4.L2 != N: if p5.Fourth_choice2 !=C or p5.L2 !=N: if p2.Fourth_choice2 !=C or p2.L2 != N: if p1.Fourth_choice2 ==C and p1.L2==N: p1.L2=C SC2=1 if p2.Fourth_choice2 ==C and p2.L2==N: p2.L2=C SC2=2 if p5.Fourth_choice2 ==C and p5.L2==N: p5.L2=C SC2=5 if p4.Fourth_choice2 ==C and p4.L2==N: p4.L2=C SC2=4 if p3.Fourth_choice2==C and p3.L2==N: p3.L2=C SC2=3 if SD2==0: if p3.Fourth_choice2 !=D or p3.L2!=N: if p4.Fourth_choice2 !=D or p4.L2 !=N: if p5.Fourth_choice2 !=D or p5.L2!=N: if p1.Fourth_choice2 !=D or p1.L2!=N: if p2.Fourth_choice2 ==D and p2.L2==N: p2.L2=D SD2=2 if p1.Fourth_choice2 ==D and p1.L2==N: p1.L2=D SD2=1 if p5.Fourth_choice2 ==D and p5.L2==N: p5.L2=D SD2=5 if p4.Fourth_choice2 ==D and p4.L2==N: p4.L2=D SD2=4 if p3.Fourth_choice2==D and p3.L2==N: p3.L2=D SD2=3 if SE2==0: if p2.Fourth_choice2 !=E or p2.L2 != N: if p5.Fourth_choice2 !=E or p5.L2 != N: if p3.Fourth_choice2 !=E or p3.L2 !=N: if p4.Fourth_choice2 !=E or p4.L2 !=N: if p1.Fourth_choice2 ==E and p1.L2==N: p1.L2=E SE2=1 if p4.Fourth_choice2 ==E and p4.L2==N: p4.L2=E SE2=4 if p3.Fourth_choice2 ==E and p3.L2==N: p3.L2=E SE2=3 if p5.Fourth_choice2 ==E and p5.L2==N: p5.L2=E SE2=5 if p2.Fourth_choice2==E and p2.L2==N: p2.L2=E SE2=2 #第五轮志愿筛选 if SA2==0: if p1.Fifth_choice2 !=A or p3.L2 != N: if p2.Fifth_choice2 !=A or p2.L2 !=N: if p4.Fifth_choice2 !=A or p4.L2!=N: if p5.Fifth_choice2 !=A or p5.L2 !=N: if p3.Fifth_choice2 ==A and p3.L2==N: p3.L2=A SA2=3 if p5.Fifth_choice2 ==A and p5.L2 ==N: p5.L2=A SA2=5 if p4.Fifth_choice2 ==A and p4.L2==N: p4.L2=A SA2=4 if p2.Fifth_choice2 ==A and p2.L2 ==N: p2.L2=A SA2=2 if p1.Fifth_choice2==A and p1.L2==N: p1.L2=A SA2=1 if SB2==0: if p1.Fifth_choice2 !=B or p1.L2 !=N: if p2.Fifth_choice2 !=B or p2.L2!=N: if p5.Fifth_choice2 ==B and p5.L2==N: if p3.Fifth_choice2 !=B or p3.L2!=N: if p4.Fifth_choice2 ==B and p4.L2==N: p4.L2=B SB2=4 if p3.Fifth_choice2 ==B and p3.L2==N: p3.L2=B SB2=3 if p5.Fifth_choice2 ==B and p5.L2==N: p5.L2=B SB2=5 if p2.Fifth_choice2 ==B and p2.L2==N: p2.L2=B SB2=2 if p1.Fifth_choice2==B and p1.L2==N: p1.L2=B SB2=1 if SC2==0: if p3.Fifth_choice2 !=C or p3.L2 !=N: if p4.Fifth_choice2 !=C or p4.L2 != N: if p5.Fifth_choice2 !=C or p5.L2 !=N: if p2.Fifth_choice2 !=C or p2.L2 != N: if p1.Fifth_choice2 ==C and p1.L2==N: p1.L2=C SC2=1 if p2.Fifth_choice2 ==C and p2.L2==N: p2.L2=C SC2=2 if p5.Fifth_choice2 ==C and p5.L2==N: p5.L2=C SC2=5 if p4.Fifth_choice2 ==C and p4.L2==N: p4.L2=C SC2=4 if p3.Fifth_choice2==C and p3.L2==N: p3.L2=C SC2=3 if SD2==0: if p3.Fifth_choice2 !=D or p3.L2!=N: if p4.Fifth_choice2 !=D or p4.L2 !=N: if p5.Fifth_choice2 !=D or p5.L2!=N: if p1.Fifth_choice2 !=D or p1.L2!=N: if p2.Fifth_choice2 ==D and p2.L2==N: p2.L2=D SD2=2 if p1.Fifth_choice2 ==D and p1.L2==N: p1.L2=D SD2=1 if p5.Fifth_choice2 ==D and p5.L2==N: p5.L2=D SD2=5 if p4.Fifth_choice2 ==D and p4.L2==N: p4.L2=D SD2=4 if p3.Fifth_choice2==D and p3.L2==N: p3.L2=D SD2=3 if SE2==0: if p2.Fifth_choice2 !=E or p2.L2 != N: if p5.Fifth_choice2 !=E or p5.L2 != N: if p3.Fifth_choice2 !=E or p3.L2 !=N: if p4.Fifth_choice2 !=E or p4.L2 !=N: if p1.Fifth_choice2 ==E and p1.L2==N: p1.L2=E SE2=1 if p4.Fifth_choice2 ==E and p4.L2==N: p4.L2=E SE2=4 if p3.Fifth_choice2 ==E and p3.L2==N: p3.L2=E SE2=3 if p5.Fifth_choice2 ==E and p5.L2==N: p5.L2=E SE2=5 if p2.Fifth_choice2==E and p2.L2==N: p2.L2=E SE2=2 def Payoff2(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) if p1.L2=='A': p1.pc2=100 if p1.L2=='B': p1.pc2=80 if p1.L2=='C': p1.pc2=60 if p1.L2=='D': p1.pc2=40 if p1.L2=='E': p1.pc2=20 if p2.L2=='A': p2.pc2=100 if p2.L2=='B': p2.pc2=80 if p2.L2=='C': p2.pc2=60 if p2.L2=='D': p2.pc2=40 if p2.L2=='E': p2.pc2=20 if p3.L2=='A': p3.pc2=100 if p3.L2=='B': p3.pc2=80 if p3.L2=='C': p3.pc2=60 if p3.L2=='D': p3.pc2=40 if p3.L2=='E': p3.pc2=20 if p4.L2=='A': p4.pc2=100 if p4.L2=='B': p4.pc2=80 if p4.L2=='C': p4.pc2=60 if p4.L2=='D': p4.pc2=40 if p4.L2=='E': p4.pc2=20 if p5.L2=='A': p5.pc2=100 if p5.L2=='B': p5.pc2=80 if p5.L2=='C': p5.pc2=60 if p5.L2=='D': p5.pc2=40 if p5.L2=='E': p5.pc2=20 if p1.First_guess2==p2.First_choice2: p1.pg2=p1.pg2+10 p1.Right_guess2 = p1.Right_guess2+1 if p1.Second_guess2==p3.First_choice2: p1.pg2=p1.pg2+10 p1.Right_guess2 = p1.Right_guess2+1 if p1.Third_guess2==p4.First_choice2: p1.pg2=p1.pg2+10 p1.Right_guess2 = p1.Right_guess2+1 if p1.Fourth_guess2==p5.First_choice2: p1.pg2=p1.pg2+10 p1.Right_guess2 = p1.Right_guess2+1 if p2.First_guess2==p1.First_choice2: p2.pg2=p2.pg2+10 p2.Right_guess2 = p2.Right_guess2+1 if p2.Second_guess2==p3.First_choice2: p2.pg2=p2.pg2+10 p2.Right_guess2 = p2.Right_guess2+1 if p2.Third_guess2==p4.First_choice2: p2.pg2=p2.pg2+10 p2.Right_guess2 = p2.Right_guess2+1 if p2.Fourth_guess2==p5.First_choice2: p2.pg2=p2.pg2+10 p2.Right_guess2 = p2.Right_guess2+1 if p3.First_guess2==p1.First_choice2: p3.pg2=p3.pg2+10 p3.Right_guess2 = p3.Right_guess2+1 if p3.Second_guess2==p2.First_choice2: p3.pg2=p3.pg2+10 p3.Right_guess2 = p3.Right_guess2+1 if p3.Third_guess2==p4.First_choice2: p3.pg2=p3.pg2+10 p3.Right_guess2 = p3.Right_guess2+1 if p3.Fourth_guess2==p5.First_choice2: p3.pg2=p3.pg2+10 p3.Right_guess2 = p3.Right_guess2+1 if p4.First_guess2==p1.First_choice2: p4.pg2=p4.pg2+10 p4.Right_guess2 = p4.Right_guess2+1 if p4.Second_guess2==p2.First_choice2: p4.pg2=p4.pg2+10 p4.Right_guess2 = p4.Right_guess2+1 if p4.Third_guess2==p3.First_choice2: p4.pg2=p4.pg2+10 p4.Right_guess2 = p4.Right_guess2+1 if p4.Fourth_guess2==p5.First_choice2: p4.pg2=p4.pg2+10 p4.Right_guess2 = p4.Right_guess2+1 if p5.First_guess2==p1.First_choice2: p5.pg2=p5.pg2+10 p5.Right_guess2 = p5.Right_guess2+1 if p5.Second_guess2==p2.First_choice2: p5.pg2=p5.pg2+10 p5.Right_guess2 = p5.Right_guess2+1 if p5.Third_guess2==p3.First_choice2: p5.pg2=p5.pg2+10 p5.Right_guess2 = p5.Right_guess2+1 if p5.Fourth_guess2==p4.First_choice2: p5.pg2=p5.pg2+10 p5.Right_guess2 = p5.Right_guess2+1 p1.payoff2=p1.pc2+p1.pg2 p2.payoff2=p2.pc2+p2.pg2 p3.payoff2=p3.pc2+p3.pg2 p4.payoff2=p4.pc2+p4.pg2 p5.payoff2=p5.pc2+p5.pg2 def Set_payoff(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) p1.pfinal=p1.payoff1+p1.payoff2+p1.payoff11_20+p1.payoffB+p1.payoff_risk p2.pfinal=p2.payoff1+p2.payoff2+p2.payoff11_20+p2.payoffB+p2.payoff_risk p3.pfinal=p3.payoff1+p3.payoff2+p3.payoff11_20+p3.payoffB+p3.payoff_risk p4.pfinal=p4.payoff1+p4.payoff2+p4.payoff11_20+p4.payoffB+p4.payoff_risk p5.pfinal=p5.payoff1+p5.payoff2+p5.payoff11_20+p5.payoffB+p5.payoff_risk def EG_risk(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) import random rnd = random.randint(1, 100) if p1.EGrisk==1: p1.payoff_risk=16 if p1.EGrisk==2 and rnd<=50: p1.payoff_risk=12 if p1.EGrisk==2 and rnd>50: p1.payoff_risk=24 if p1.EGrisk==3 and rnd<=50: p1.payoff_risk=8 if p1.EGrisk==3 and rnd>50: p1.payoff_risk=32 if p1.EGrisk==4 and rnd<=50: p1.payoff_risk=4 if p1.EGrisk==4 and rnd>50: p1.payoff_risk=40 if p1.EGrisk==5 and rnd<=50: p1.payoff_risk=0 if p1.EGrisk==4 and rnd>50: p1.payoff_risk=48 if p2.EGrisk==1: p2.payoff_risk=16 if p2.EGrisk==2 and rnd<=50: p2.payoff_risk=12 if p2.EGrisk==2 and rnd>50: p2.payoff_risk=24 if p2.EGrisk==3 and rnd<=50: p2.payoff_risk=8 if p2.EGrisk==3 and rnd>50: p2.payoff_risk=32 if p2.EGrisk==4 and rnd<=50: p2.payoff_risk=4 if p2.EGrisk==4 and rnd>50: p2.payoff_risk=40 if p2.EGrisk==5 and rnd<=50: p2.payoff_risk=0 if p2.EGrisk==4 and rnd>50: p2.payoff_risk=48 if p3.EGrisk==1: p3.payoff_risk=16 if p3.EGrisk==2 and rnd<=50: p3.payoff_risk=12 if p3.EGrisk==2 and rnd>50: p3.payoff_risk=24 if p3.EGrisk==3 and rnd<=50: p3.payoff_risk=8 if p3.EGrisk==3 and rnd>50: p3.payoff_risk=32 if p3.EGrisk==4 and rnd<=50: p3.payoff_risk=4 if p3.EGrisk==4 and rnd>50: p3.payoff_risk=40 if p3.EGrisk==5 and rnd<=50: p3.payoff_risk=0 if p3.EGrisk==4 and rnd>50: p3.payoff_risk=48 if p4.EGrisk==1: p4.payoff_risk=16 if p4.EGrisk==2 and rnd<=50: p4.payoff_risk=12 if p4.EGrisk==2 and rnd>50: p4.payoff_risk=24 if p4.EGrisk==3 and rnd<=50: p4.payoff_risk=8 if p4.EGrisk==3 and rnd>50: p4.payoff_risk=32 if p4.EGrisk==4 and rnd<=50: p4.payoff_risk=4 if p4.EGrisk==4 and rnd>50: p4.payoff_risk=40 if p4.EGrisk==5 and rnd<=50: p4.payoff_risk=0 if p4.EGrisk==4 and rnd>50: p4.payoff_risk=48 if p5.EGrisk==1: p5.payoff_risk=16 if p5.EGrisk==2 and rnd<=50: p5.payoff_risk=12 if p5.EGrisk==2 and rnd>50: p5.payoff_risk=24 if p5.EGrisk==3 and rnd<=50: p5.payoff_risk=8 if p5.EGrisk==3 and rnd>50: p5.payoff_risk=32 if p5.EGrisk==4 and rnd<=50: p5.payoff_risk=4 if p5.EGrisk==4 and rnd>50: p5.payoff_risk=40 if p5.EGrisk==5 and rnd<=50: p5.payoff_risk=0 if p5.EGrisk==4 and rnd>50: p5.payoff_risk=48 class Player(BasePlayer): First_choice = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第一志愿') Second_choice = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第二志愿') Third_choice = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第三志愿') Fourth_choice = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第四志愿') Fifth_choice = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第五志愿') L = models.StringField(initial='N') First_guess = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) Second_guess = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) Third_guess = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) Fourth_guess = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) pc = models.IntegerField(initial=0) pg = models.IntegerField(initial=0) Right_guess = models.IntegerField(initial=0) payoff1 = models.FloatField(initial=0) q11_20 = models.IntegerField(label='请在11至20中选取一个整数', max=20, min=11) guess = models.IntegerField(label='您会选择哪个数字?', max=100, min=0) is_winner = models.BooleanField(initial=False) Quiz1 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请问学生1会被那个学校录取?') Quiz2 = models.StringField(choices=[['A', '学生A'], ['B', '学生B'], ['C', '学生C'], ['D', '学生D'], ['E', '学生E']], label='请问学生2会被哪个学校录取?') Quiz3 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请问学生3会被哪个学校录取?') Quiz4 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请问学生4会被哪个学校录取?') Quiz5 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请问学生5会被哪个学校录取?') First_choice2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第一志愿') Second_choice2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第二志愿') Third_choice2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第三志愿') Fourth_choice2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第四志愿') Fifth_choice2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='请选择你的第五志愿') L2 = models.StringField(initial='N') First_guess2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], initial='', label='', widget=widgets.RadioSelectHorizontal) Second_guess2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) Third_guess2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) Fourth_guess2 = models.StringField(choices=[['A', '学校A'], ['B', '学校B'], ['C', '学校C'], ['D', '学校D'], ['E', '学校E']], label='', widget=widgets.RadioSelectHorizontal) pc2 = models.FloatField(initial=0) pg2 = models.FloatField(initial=0) Right_guess2 = models.FloatField(initial=0) payoff2 = models.FloatField(initial=0) payoffB = models.FloatField(initial=0) pfinal = models.FloatField(initial=0) Quiz1_2 = models.IntegerField(choices=[[1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5']], label='1、你在小组内的编号是', widget=widgets.RadioSelectHorizontal) EGrisk = models.IntegerField(choices=[[1, '100%得16点'], [2, '50%得12点, 50%得24点'], [3, '50%得8点,50%得32点'], [4, '50%得4点,50%得40点'], [5, '50%得0点,50%得48点']], label='请从以下五个彩票中选择一个你最喜欢的', widget=widgets.RadioSelect) payoff_risk = models.IntegerField(initial=0) ID_e = models.IntegerField(label='您的实验代码(计算机座位上的编号)是?') Age = models.FloatField(label='您的年龄是?') Grade = models.IntegerField(choices=[[1, '大一'], [2, '大二'], [3, '大三'], [4, '大四'], [5, '研一'], [6, '研二'], [7, '研三']], label='您的年级是?') Major = models.StringField(initial='', label='您的专业是?') Female = models.FloatField(choices=[[1, '男'], [2, '女']], label='您的性别是?') Province = models.StringField(choices=[['河北省', '河北省'], ['山西省', '山西省'], ['辽宁省', '辽宁省'], ['吉林省', '吉林省'], ['黑龙江省', '黑龙江省'], ['江苏省', '江苏省'], ['浙江省', '浙江省'], ['安徽省', '安徽省'], ['福建省', '福建省'], ['江西省', '江西省'], ['山东省', '山东省'], ['河南省', '河南省'], ['湖北省', '湖北省'], ['湖南省', '湖南省'], ['广东省', '广东省'], ['海南省', '海南省'], ['四川省', '四川省'], ['贵州省', '贵州省'], ['云南省', '云南省'], ['陕西省', '陕西省'], ['甘肃省', '甘肃省'], ['青海省', '青海省'], ['台湾省', '台湾省'], ['内蒙古自治区', '内蒙古自治区'], ['广西壮族自治区', '广西壮族自治区'], ['西藏自治区', '西藏自治区'], ['宁夏回族自治区', '宁夏回族自治区'], ['新疆维吾尔自治区', '新疆维吾尔自治区'], ['北京市', '北京市'], ['天津市', '天津市'], ['上海市', '上海市'], ['重庆市', '重庆市'], ['香港特别行政区', '香港特别行政区'], ['澳门特别行政区', '澳门特别行政区']], label='您参与高考的省份?') CRT1 = models.FloatField(label='一支网球拍和一个网球价格一共是是1.10元。球拍的价格比球高1元。那么,球的价格是多少?') CRT2 = models.FloatField(label='湖里有一小片睡莲,睡莲的面积每天成倍增加。假设睡莲覆盖整个湖面需要48天的时间,覆盖一半的湖面需要多长时间?') CRT3 = models.FloatField(label='如果5台机器需要5分钟来制作5个小零件,用100台机器制造100个小部件需要用多长时间?') payoff11_20 = models.FloatField(initial=0)