from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) doc = '' class Constants(BaseConstants): name_in_url = 'HumanUmpire' players_per_group = 4 num_rounds = 2 Endowment = c(14) multiplier = 2 Infocost = 1 instructionsgeneric_template = 'HumanUmpire/instructionsgeneric.html' instructionsumpire_template = 'HumanUmpire/instructionsumpire.html' instructionsplayer_template = 'HumanUmpire/instructionsplayer.html' class Subsession(BaseSubsession): def creating_session(self): self.group_randomly(fixed_id_in_group=True) class Group(BaseGroup): contributions = models.IntegerField() partecipanti = models.IntegerField() total_contribution = models.CurrencyField() individual_share = models.CurrencyField() umpirelastgroup = models.IntegerField() def after_all_players_arrive(self): #creation string fields 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) for p in self.get_players(): p.exit0 = 0 if p2.contribution == 99: p2.exit0 = p.exit0 + 1 if p3.contribution == 99: p3.exit0 = p.exit0 + 1 if p4.contribution == 99: p4.exit0 = p.exit0 + 1 else: p.exit0 = p.exit0 p.exitpl2 = 0 if p2.exit0 == 1: p1.exitpl2 = p.exitpl2 + 1 p2.exitpl2 = p.exitpl2 + 1 p3.exitpl2 = p.exitpl2 + 1 p4.exitpl2 = p.exitpl2 + 1 if p2.exit0 == 0: p.exitpl2 = p.exitpl2 + 0 p.exitpl3 = 0 if p3.exit0 == 1: p1.exitpl3 = p.exitpl3 + 1 p2.exitpl3 = p.exitpl3 + 1 p3.exitpl3 = p.exitpl3 + 1 p4.exitpl3 = p.exitpl3 + 1 if p3.exit0 == 0: p.exitpl3 = p.exitpl3 + 0 p.exitpl4 = 0 if p4.exit0 == 1: p1.exitpl4 = p.exitpl4 + 1 p2.exitpl4 = p.exitpl4 + 1 p3.exitpl4 = p.exitpl4 + 1 p4.exitpl4 = p.exitpl4 + 1 if p4.exit0 == 0: p.exitpl4 = p.exitpl4 + 0 # stinghe x pagine punishment arbitro/accettaz bribe p.contributionplayer2 = 0 p1.contributionplayer2 = p2.contribution p.contributionplayer3 = 0 p1.contributionplayer3 = p3.contribution p.contributionplayer4 = 0 p1.contributionplayer4 = p4.contribution #stringhe x arbitro e x comprare info p.progettocomune = None if p.contribution == None: pass if p.contribution == 99: p.progettocomune = "Exit" if p.contribution == 0: p.progettocomune = "0 points" if p.contribution == 3: p.progettocomune = "3 points" if p.contribution == 6: p.progettocomune = "6 points" if p.contribution == 9: p.progettocomune = "9 points" if p.contribution == 100: p.progettocomune = "0 points and 2 points to the umpire" if p.contribution == 300: p.progettocomune = "3 points and 1 point to the umpire" #stringhe x feedback da mostrare al player 2 (non faccio vedere le bribe) p.progettocomunepl3 = None if p3.progettocomune == "Exit": p2.progettocomunepl3 = "Exit" p1.progettocomunepl3 = "Exit" if p3.progettocomune == "0 points": p2.progettocomunepl3 = "0 points" p1.progettocomunepl3 = "0 points" if p3.progettocomune == "3 points": p2.progettocomunepl3 = "3 points" p1.progettocomunepl3 = "3 points" if p3.progettocomune == "6 points": p2.progettocomunepl3 = "6 points" p1.progettocomunepl3 = "6 points" if p3.progettocomune == "9 points": p2.progettocomunepl3 = "9 points" p1.progettocomunepl3 = "9 points" if p3.progettocomune == "0 points and 2 points to the umpire": p2.progettocomunepl3 = "0 points" p1.progettocomunepl3 = "0 points and 2 points to the umpire" if p3.progettocomune == "3 points and 1 point to the umpire": p2.progettocomunepl3 = "3 points" p1.progettocomunepl3 = "3 points and 1 point to the umpire" p.progettocomunepl4 = None if p4.progettocomune == "Exit": p2.progettocomunepl4 = "Exit" p1.progettocomunepl4 = "Exit" if p4.progettocomune == "0 points": p2.progettocomunepl4 = "0 points" p1.progettocomunepl4 = "0 points" if p4.progettocomune == "3 points": p2.progettocomunepl4 = "3 points" p1.progettocomunepl4 = "3 points" if p4.progettocomune == "6 points": p2.progettocomunepl4 = "6 points" p1.progettocomunepl4 = "6 points" if p4.progettocomune == "9 points": p2.progettocomunepl4 = "9 points" p1.progettocomunepl4 = "9 points" if p4.progettocomune == "0 points and 2 points to the umpire": p2.progettocomunepl4 = "0 points" p1.progettocomunepl4 = "0 points and 2 points to the umpire" if p4.progettocomune == "3 points and 1 point to the umpire": p2.progettocomunepl4 = "3 points" p1.progettocomunepl4 = "3 points and 1 point to the umpire" #stringhe x feedback da mostrare al player 3 (non faccio vedere le bribe) p.progettocomunepl2 = None if p2.progettocomune == "Exit": p3.progettocomunepl2 = "Exit" p1.progettocomunepl2 = "Exit" if p2.progettocomune == "0 points": p3.progettocomunepl2 = "0 points" p1.progettocomunepl2 = "0 points" if p2.progettocomune == "3 points": p3.progettocomunepl2 = "3 points" p1.progettocomunepl2 = "3 points" if p2.progettocomune == "6 points": p3.progettocomunepl2 = "6 points" p1.progettocomunepl2 = "6 points" if p2.progettocomune == "9 points": p3.progettocomunepl2 = "9 points" p1.progettocomunepl2 = "9 points" if p2.progettocomune == "0 points and 2 points to the umpire": p3.progettocomunepl2 = "0 points" p1.progettocomunepl2 = "0 points and 2 points to the umpire" if p2.progettocomune == "3 points and 1 point to the umpire": p3.progettocomunepl2 = "3 points" p1.progettocomunepl2 = "3 points and 1 point to the umpire" p.progettocomunepl4 = None if p4.progettocomune == "Exit": p3.progettocomunepl4 = "Exit" p1.progettocomunepl4 = "Exit" if p4.progettocomune == "0 points": p3.progettocomunepl4 = "0 points" p1.progettocomunepl4 = "0 points" if p4.progettocomune == "3 points": p3.progettocomunepl4 = "3 points" p1.progettocomunepl4 = "3 points" if p4.progettocomune == "6 points": p3.progettocomunepl4 = "6 points" p1.progettocomunepl4 = "6 points" if p4.progettocomune == "9 points": p3.progettocomunepl4 = "9 points" p1.progettocomunepl4 = "9 points" if p4.progettocomune == "0 points and 2 points to the umpire": p3.progettocomunepl4 = "0 points" p1.progettocomunepl4 = "0 points and 2 points to the umpire" if p4.progettocomune == "3 points and 1 point to the umpire": p3.progettocomunepl4 = "3 points" p1.progettocomunepl4 = "3 points and 1 point to the umpire" #stringhe x feedback da mostrare al player 4 (non faccio vedere le bribe) p.progettocomunepl2 = None if p2.progettocomune == "Exit": p4.progettocomunepl2 = "Exit" p1.progettocomunepl2 = "Exit" if p2.progettocomune == "0 points": p4.progettocomunepl2 = "0 points" p1.progettocomunepl2 = "0 points" if p2.progettocomune == "3 points": p4.progettocomunepl2 = "3 points" p1.progettocomunepl2 = "3 points" if p2.progettocomune == "6 points": p4.progettocomunepl2 = "6 points" p1.progettocomunepl2 = "6 points" if p2.progettocomune == "9 points": p4.progettocomunepl2 = "9 points" p1.progettocomunepl2 = "9 points" if p2.progettocomune == "0 points and 2 points to the umpire": p4.progettocomunepl2 = "0 points" p1.progettocomunepl2 = "0 points and 2 points to the umpire" if p2.progettocomune == "3 points and 1 point to the umpire": p4.progettocomunepl2 = "3 points" p1.progettocomunepl2 = "3 points and 1 point to the umpire" p.progettocomunepl3 = None if p3.progettocomune == "Exit": p4.progettocomunepl3 = "Exit" p1.progettocomunepl3 = "Exit" if p3.progettocomune == "0 points": p4.progettocomunepl3 = "0 points" p1.progettocomunepl3 = "0 points" if p3.progettocomune == "3 points": p4.progettocomunepl3 = "3 points" p1.progettocomunepl3 = "3 points" if p3.progettocomune == "6 points": p4.progettocomunepl3 = "6 points" p1.progettocomunepl3 = "6 points" if p3.progettocomune == "9 points": p4.progettocomunepl3 = "9 points" p1.progettocomunepl3 = "9 points" if p3.progettocomune == "0 points and 2 points to the umpire": p4.progettocomunepl3 = "0 points" p1.progettocomunepl3 = "0 points and 2 points to the umpire" if p3.progettocomune == "3 points and 1 point to the umpire": p4.progettocomunepl3 = "3 points" p1.progettocomunepl3 = "3 points and 1 point to the umpire" #group number if self.id_in_subsession == 1: p1.numberg = 1 p2.numberg = 1 p3.numberg = 1 p4.numberg = 1 elif self.id_in_subsession == 2: p1.numberg = 2 p2.numberg = 2 p3.numberg = 2 p4.numberg = 2 elif self.id_in_subsession == 3: p1.numberg = 3 p2.numberg = 3 p3.numberg = 3 p4.numberg = 3 elif self.id_in_subsession == 4: p1.numberg = 4 p2.numberg = 4 p3.numberg = 4 p4.numberg = 4 elif self.id_in_subsession == 5: p1.numberg = 5 p2.numberg = 5 p3.numberg = 5 p4.numberg = 5 elif self.id_in_subsession == 6: p1.numberg = 6 p2.numberg = 6 p3.numberg = 6 p4.numberg = 6 if p.Info == None: p.infostringa = "-" if p.Info == True: p.infostringa = "Si" else: p.infostringa = "No" partecipanti= 0 for p in self.get_players(): if p.contribution == 99: pass elif p.contribution == None: pass else: partecipanti = partecipanti + 1 p1.partecipantipg = partecipanti p2.partecipantipg = partecipanti p3.partecipantipg = partecipanti p4.partecipantipg = partecipanti def set_payoff1(self): #eliminazione giocatori che escono, conversione variabili 100 e 300 in "0 e 2 bribe" e "3 e 1 bribe" contributions = 0 partecipanti= 0 bribe= 0 for p in self.get_players(): if p.contribution == 99: pass elif p.contribution == None: pass elif p.contribution == 100: partecipanti = partecipanti + 1 contributions = contributions + 0 bribe = bribe + 2 elif p.contribution == 300: partecipanti = partecipanti + 1 contributions = contributions + 3 bribe = bribe + 1 else: partecipanti = partecipanti + 1 contributions = contributions + p.contribution if partecipanti > 0: self.total_contribution= contributions * 2 self.individual_share = self.total_contribution / partecipanti if partecipanti == 1: self.total_contribution = 0 self.individual_share = 0 if partecipanti == 0: self.total_contribution= 0 self.individual_share = 0 #modifica variabile punizione ai fini del calcolo payoff (la variabile punishment è al livllo del player, ma l'arbitro punisce con ogni variabile un solo giocatore: devo perciò "cancellare" i casi vuoti for p in self.get_players(): 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) p1.mazzetta = bribe p.punizione2 = 0 if p1.punishment2 == None: p1.punizione2 = 0 # pass else: p.punizione2 = p.punizione2 + p1.punishment2 p.punizione3 = 0 if p1.punishment3 == None: p1.punizione3 = 0 #pass else: p.punizione3 = p.punizione3 + p1.punishment3 p.punizione4 = 0 if p1.punishment4 == None: p1.punizione4 = 0 # pass else: p.punizione4 = p.punizione4 + p1.punishment4 p1.punizione2 = p4.punizione2 p1.punizione3 = p4.punizione3 p1.punizione4 = p4.punizione4 p.punizione = 0 if p1.punishment2 == None: p2.punizione = 0 else: p2.punizione = p.punizione2 if p1.punishment3 == None: p3.punizione = 0 else: p3.punizione = p.punizione + p.punizione3 if p1.punishment4 == None: p4.punizione = 0 else: p4.punizione = p.punizione + p.punizione4 if p.punishment2 == None: p1.punishment2 = 0 if p.punishment3 == None: p1.punishment3 = 0 if p.punishment4 == None: p1.punishment4 = 0 for p in self.get_players(): if partecipanti > 1: if p2.contribution == 99: p2.payoff = Constants.Endowment elif p2.contribution == 100: p2.payoff = Constants.Endowment + self.individual_share - 2 - p2.punizione elif p2.contribution == 300: p2.payoff = Constants.Endowment + self.individual_share - 4 - p2.punizione else: p2.payoff = Constants.Endowment - p2.contribution + self.individual_share - p2.punizione else: p2.payoff = Constants.Endowment for p in self.get_players(): if partecipanti > 1: if p3.contribution == 99: p3.payoff = Constants.Endowment elif p3.contribution == 100: p3.payoff = Constants.Endowment + self.individual_share - 2 - p3.punizione elif p3.contribution == 300: p3.payoff = Constants.Endowment + self.individual_share - 4 - p3.punizione else: p3.payoff = Constants.Endowment - p3.contribution + self.individual_share - p3.punizione else: p3.payoff = Constants.Endowment for p in self.get_players(): if partecipanti > 1: if p4.contribution == 99: p4.payoff = Constants.Endowment elif p4.contribution == 100: p4.payoff = Constants.Endowment + self.individual_share - 2 - p4.punizione elif p4.contribution == 300: p4.payoff = Constants.Endowment + self.individual_share - 4 - p4.punizione else: p4.payoff = Constants.Endowment - p4.contribution + self.individual_share - p4.punizione else: p4.payoff = Constants.Endowment corruzione = 0 if partecipanti > 1: if p1.bribe2 == 1: corruzione = corruzione + 1 else: corruzione = corruzione + 0 if p1.bribe3 == 1: corruzione = corruzione + 1 else: corruzione = corruzione + 0 if p1.bribe4 == 1: corruzione = corruzione + 1 else: corruzione = corruzione + 0 else: corruzione = corruzione + 0 p1.corruzione = corruzione p2.corruzione = corruzione p3.corruzione = corruzione p4.corruzione = corruzione p.bribepl2 = 0 if p1.bribe2 == None: p2.bribepl2 = 0 # pass else: p2.bribepl2 = p.bribepl2 + p1.bribe2 p.bribepl3 = 0 if p1.bribe3 == None: p3.bribepl3 = 0 # pass else: p3.bribepl3 = p.bribepl3 + p1.bribe3 p.bribepl4 = 0 if p1.bribe4 == None: p4.bribepl4 = 0 # pass else: p4.bribepl4 = p.bribepl4 + p1.bribe4 p1.bribepl2 = p4.bribepl2 p1.bribepl3 = p4.bribepl3 p1.bribepl4 = p4.bribepl4 p.valoremazzetta = 0 if p2.bribepl2 == 1 and p2.contribution == 100: p.valoremazzetta = p.valoremazzetta + 2 elif p2.bribepl2 == 1 and p2.contribution == 300: p.valoremazzetta = p.valoremazzetta + 1 if p3.bribepl3 == 1 and p3.contribution == 100: p.valoremazzetta = p.valoremazzetta + 2 elif p3.bribepl3 == 1 and p3.contribution == 300: p.valoremazzetta = p.valoremazzetta + 1 if p4.bribepl4 == 1 and p4.contribution == 100: p.valoremazzetta = p.valoremazzetta + 2 elif p4.bribepl4 == 1 and p4.contribution == 300: p.valoremazzetta = p.valoremazzetta + 1 p1.valoremazzetta = p4.valoremazzetta corruttori = 0 for p in self.get_players(): if partecipanti > 1: if p.contribution == None: pass if p.contribution == 100: corruttori = corruttori + 1 if p.contribution == 300: corruttori = corruttori + 1 if p.contribution == 3: corruttori = corruttori + 0 if p.contribution == 6: corruttori = corruttori + 0 if p.contribution == 9: corruttori = corruttori + 0 if p.contribution == 99: corruttori = corruttori + 0 else: corruttori = corruttori + 0 p1.corruttori = corruttori p2.corruttori = corruttori p3.corruttori = corruttori p4.corruttori = corruttori #payoff arbitro if partecipanti > 0: if self.total_contribution >= 24: p1.payoff = 17 + 2 + p.valoremazzetta p1.bonus = 2 else: p1.payoff = 17 + p.valoremazzetta p1.bonus = 0 else: p1.payoff = 17 + p.valoremazzetta p1.bonus = 0 def set_payoff2(self): #payoff round > 1 contributions = 0 partecipanti= 0 bribe = 0 for p in self.get_players(): if p.contribution == 99: pass elif p.contribution == None: pass elif p.contribution == 100: partecipanti = partecipanti + 1 contributions = contributions + 0 bribe = bribe + 2 elif p.contribution == 300: partecipanti = partecipanti + 1 contributions = contributions + 3 bribe = bribe + 1 else: partecipanti = partecipanti + 1 contributions = contributions + p.contribution if partecipanti > 0: self.total_contribution= contributions * 2 self.individual_share = self.total_contribution / partecipanti if partecipanti == 1: self.total_contribution = contributions self.individual_share = contributions if partecipanti == 0: self.total_contribution= 0 self.individual_share = 0 for p in self.get_players(): 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) p1.partecipantipg = partecipanti p2.partecipantipg = partecipanti p3.partecipantipg = partecipanti p4.partecipantipg = partecipanti p1.mazzetta = bribe p.punizione2 = 0 if p1.punishment2 == None: p1.punizione2 = 0 #pass else: p.punizione2 = p.punizione2 + p1.punishment2 #p1.punizione2 = p.punizione2 + p1.punishment2 p.punizione3 = 0 if p1.punishment3 == None: p1.punizione3 = 0 #pass else: p.punizione3 = p.punizione3 + p1.punishment3 # p1.punizione3 = p.punizione3 + p1.punishment3 p.punizione4 = 0 if p1.punishment4 == None: p1.punizione4 = 0 #pass else: p.punizione4 = p.punizione4 + p1.punishment4 # p1.punizione4 = p.punizione4 + p1.punishment4 p.punizione = 0 if p1.punishment2 == None: p2.punizione = 0 else: p2.punizione = p.punizione2 if p1.punishment3 == None: p3.punizione = 0 else: p3.punizione = p.punizione + p.punizione3 if p1.punishment4 == None: p4.punizione = 0 else: p4.punizione = p.punizione + p.punizione4 if p.punishment2 == None: p1.punishment2 = 0 if p.punishment3 == None: p1.punishment3 = 0 if p.punishment4 == None: p1.punishment4 = 0 p1.punizione2 = p4.punizione2 p1.punizione3 = p4.punizione3 p1.punizione4 = p4.punizione4 for p in self.get_players(): if partecipanti > 1: if p2.contribution == 99 and p2.Info == True : p2.payoff = Constants.Endowment - Constants.Infocost elif p2.contribution == 99 and p2.Info == False: p2.payoff = Constants.Endowment elif p2.contribution == 100 and p2.Info == True: p2.payoff = Constants.Endowment + self.individual_share - 2 - p2.punizione - Constants.Infocost elif p2.contribution == 100 and p2.Info == False: p2.payoff = Constants.Endowment + self.individual_share - 2 - p2.punizione elif p2.contribution == 300 and p2.Info == True: p2.payoff = Constants.Endowment + self.individual_share - 4 - p2.punizione - Constants.Infocost elif p2.contribution == 300 and p2.Info == False: p2.payoff = Constants.Endowment + self.individual_share - 4 - p2.punizione elif p2.Info == True: p2.payoff = Constants.Endowment + self.individual_share - p2.contribution - p2.punizione - Constants.Infocost else: p2.payoff = Constants.Endowment + self.individual_share - p2.contribution - p2.punizione else: if p2.Info == True: p2.payoff = Constants.Endowment - Constants.Infocost else: p2.payoff = Constants.Endowment for p in self.get_players(): if partecipanti > 1: if p3.contribution == 99 and p3.Info == True : p3.payoff = Constants.Endowment - Constants.Infocost elif p3.contribution == 99 and p3.Info == False: p3.payoff = Constants.Endowment elif p3.contribution == 100 and p3.Info == True: p3.payoff = Constants.Endowment + self.individual_share - 2 - p3.punizione - Constants.Infocost elif p3.contribution == 100 and p3.Info == False: p3.payoff = Constants.Endowment + self.individual_share - 2 - p3.punizione elif p3.contribution == 300 and p3.Info == True: p3.payoff = Constants.Endowment + self.individual_share - 4 - p3.punizione - Constants.Infocost elif p3.contribution == 300 and p3.Info == False: p3.payoff = Constants.Endowment + self.individual_share - 4 - p3.punizione elif p3.Info == True: p3.payoff = Constants.Endowment + self.individual_share - p3.contribution - p3.punizione - Constants.Infocost else: p3.payoff = Constants.Endowment + self.individual_share - p3.contribution - p3.punizione else: if p3.Info == True: p3.payoff = Constants.Endowment - Constants.Infocost else: p3.payoff = Constants.Endowment for p in self.get_players(): if partecipanti > 1: if p4.contribution == 99 and p4.Info == True : p4.payoff = Constants.Endowment - Constants.Infocost elif p4.contribution == 99 and p4.Info == False: p4.payoff = Constants.Endowment elif p4.contribution == 100 and p4.Info == True: p4.payoff = Constants.Endowment + self.individual_share - 2 - p4.punizione - Constants.Infocost elif p4.contribution == 100 and p4.Info == False: p4.payoff = Constants.Endowment + self.individual_share - 2 - p4.punizione elif p4.contribution == 300 and p4.Info == True: p4.payoff = Constants.Endowment + self.individual_share - 4 - p4.punizione - Constants.Infocost elif p4.contribution == 300 and p4.Info == False: p4.payoff = Constants.Endowment + self.individual_share - 4 - p4.punizione elif p4.Info == True: p4.payoff = Constants.Endowment + self.individual_share - p4.contribution - p4.punizione - Constants.Infocost else: p4.payoff = Constants.Endowment + self.individual_share - p4.contribution - p4.punizione else: if p4.Info == True: p4.payoff = Constants.Endowment - Constants.Infocost else: p4.payoff = Constants.Endowment corruzione = 0 if partecipanti > 1: if p1.bribe2 == 1: corruzione = corruzione + 1 else: corruzione = corruzione + 0 if p1.bribe3 == 1: corruzione = corruzione + 1 else: corruzione = corruzione + 0 if p1.bribe4 == 1: corruzione = corruzione + 1 else: corruzione = corruzione + 0 else: corruzione = corruzione + 0 p1.corruzione = corruzione p2.corruzione = corruzione p3.corruzione = corruzione p4.corruzione = corruzione p.bribepl2 = 0 if p1.bribe2 == None: p2.bribepl2 = 0 else: p2.bribepl2 = p.bribepl2 + p1.bribe2 p.bribepl3 = 0 if p1.bribe3 == None: p3.bribepl3 = 0 else: p3.bribepl3 = p.bribepl3 + p1.bribe3 p.bribepl4 = 0 if p1.bribe4 == None: p4.bribepl4 = 0 else: p4.bribepl4 = p.bribepl4 + p1.bribe4 p1.bribepl2 = p4.bribepl2 p1.bribepl3 = p4.bribepl3 p1.bribepl4 = p4.bribepl4 p.valoremazzetta = 0 if p2.bribepl2 == 1 and p2.contribution == 100: p.valoremazzetta = p.valoremazzetta + 2 elif p2.bribepl2 == 1 and p2.contribution == 300: p.valoremazzetta = p.valoremazzetta + 1 if p3.bribepl3 == 1 and p3.contribution == 100: p.valoremazzetta = p.valoremazzetta + 2 elif p3.bribepl3 == 1 and p3.contribution == 300: p.valoremazzetta = p.valoremazzetta + 1 if p4.bribepl4 == 1 and p4.contribution == 100: p.valoremazzetta = p.valoremazzetta + 2 elif p4.bribepl4 == 1 and p4.contribution == 300: p.valoremazzetta = p.valoremazzetta + 1 p1.valoremazzetta = p4.valoremazzetta corruttori = 0 for p in self.get_players(): if partecipanti > 1: if p.contribution == None: pass if p.contribution == 100: corruttori = corruttori + 1 if p.contribution == 300: corruttori = corruttori + 1 if p.contribution == 3: corruttori = corruttori + 0 if p.contribution == 6: corruttori = corruttori + 0 if p.contribution == 9: corruttori = corruttori + 0 if p.contribution == 99: corruttori = corruttori + 0 else: corruttori = corruttori + 0 p1.corruttori = corruttori p2.corruttori = corruttori p3.corruttori = corruttori p4.corruttori = corruttori #payoff arbitro if partecipanti > 0: if self.total_contribution >= 24: p1.payoff= 17 + 2 + p.valoremazzetta p1.bonus = 2 else: p1.payoff = 17 + p.valoremazzetta p1.bonus = 0 else: p1.payoff = 17 + p.valoremazzetta p1.bonus = 0 def corruzione_prima(self): #group number p1 = self.get_player_by_id(1) for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruzione == 0: p.corruzioneprima = "0 times" if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruzione == 1: p.corruzioneprima = "1 time" if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruzione == 2: p.corruzioneprima = "2 times" if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruzione == 3: p.corruzioneprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruzione == 0: p.corruzioneprima = "0 times" if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruzione == 1: p.corruzioneprima = "1 time" if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruzione == 2: p.corruzioneprima = "2 times" if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruzione == 3: p.corruzioneprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruzione == 0: p.corruzioneprima = "0 times" if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruzione == 1: p.corruzioneprima = "1 time" if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruzione == 2: p.corruzioneprima = "2 times" if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruzione == 3: p.corruzioneprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruzione == 0: p.corruzioneprima = "0 times" if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruzione == 1: p.corruzioneprima = "1 time" if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruzione == 2: p.corruzioneprima = "2 times" if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruzione == 3: p.corruzioneprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruzione == 0: p.corruzioneprima = "0 times" if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruzione == 1: p.corruzioneprima = "1 time" if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruzione == 2: p.corruzioneprima = "2 times" if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruzione == 3: p.corruzioneprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruzione == 0: p.corruzioneprima = "0 times" if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruzione == 1: p.corruzioneprima = "1 time" if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruzione == 2: p.corruzioneprima = "2 times" if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruzione == 3: p.corruzioneprima = "3 times" def corruttori_prima(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) for p in self.get_players(): if self.id_in_subsession == 1: p1.numberg = 1 p2.numberg = 1 p3.numberg = 1 p4.numberg = 1 elif self.id_in_subsession == 2: p1.numberg = 2 p2.numberg = 2 p3.numberg = 2 p4.numberg = 2 elif self.id_in_subsession == 3: p1.numberg = 3 p2.numberg = 3 p3.numberg = 3 p4.numberg = 3 elif self.id_in_subsession == 4: p1.numberg = 4 p2.numberg = 4 p3.numberg = 4 p4.numberg = 4 elif self.id_in_subsession == 5: p1.numberg = 5 p2.numberg = 5 p3.numberg = 5 p4.numberg = 5 elif self.id_in_subsession == 6: p1.numberg = 6 p2.numberg = 6 p3.numberg = 6 p4.numberg = 6 for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruttori == 0: p.corruttoriprima = "0 times" if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruttori == 1: p.corruttoriprima = "1 time" if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruttori == 2: p.corruttoriprima = "2 times" if p.in_round(self.round_number - 1).numberg == 1 and p1.in_round(self.round_number - 1).corruttori == 3: p.corruttoriprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruttori == 0: p.corruttoriprima = "0 times" if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruttori == 1: p.corruttoriprima = "1 time" if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruttori == 2: p.corruttoriprima = "2 times" if p.in_round(self.round_number - 1).numberg == 2 and p1.in_round(self.round_number - 1).corruttori == 3: p.corruttoriprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruttori == 0: p.corruttoriprima = "0 times" if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruttori == 1: p.corruttoriprima = "1 time" if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruttori == 2: p.corruttoriprima = "2 times" if p.in_round(self.round_number - 1).numberg == 3 and p1.in_round(self.round_number - 1).corruttori == 3: p.corruttoriprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruttori == 0: p.corruttoriprima = "0 times" if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruttori == 1: p.corruttoriprima = "1 time" if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruttori == 2: p.corruttoriprima = "2 times" if p.in_round(self.round_number - 1).numberg == 4 and p1.in_round(self.round_number - 1).corruttori == 3: p.corruttoriprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruttori == 0: p.corruttoriprima = "0 times" if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruttori == 1: p.corruttoriprima = "1 time" if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruttori == 2: p.corruttoriprima = "2 times" if p.in_round(self.round_number - 1).numberg == 5 and p1.in_round(self.round_number - 1).corruttori == 3: p.corruttoriprima = "3 times" for p in self.get_players(): if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruttori == 0: p.corruttoriprima = "0 times" if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruttori == 1: p.corruttoriprima = "1 time" if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruttori == 2: p.corruttoriprima = "2 times" if p.in_round(self.round_number - 1).numberg == 6 and p1.in_round(self.round_number - 1).corruttori == 3: p.corruttoriprima = "3 times" def contribuzioni_gruppo_precedente_arbitro(self): p2 = self.get_player_by_id(2) p3 = self.get_player_by_id(3) p4 = self.get_player_by_id(4) p1 = self.get_player_by_id(1) for p in self.get_players(): if p1.in_round(self.round_number - 1).numberg == 1: p.umpirelastgroup = 1 if p1.in_round(self.round_number - 1).numberg == 2: p.umpirelastgroup = 2 if p1.in_round(self.round_number - 1).numberg == 3: p.umpirelastgroup = 3 if p1.in_round(self.round_number - 1).numberg == 4: p.umpirelastgroup = 4 if p1.in_round(self.round_number - 1).numberg == 5: p.umpirelastgroup = 5 if p1.in_round(self.round_number - 1).numberg == 6: p.umpirelastgroup = 6 # giocate precedenti del gruppo dell'arbitro (registrate nel id dell'arbitro) for p in self.get_players(): if p.umpirelastgroup == 1: p2.g1pl2 = p1.in_round(self.round_number - 1).gruppo1pl2 p3.g1pl2 = p1.in_round(self.round_number - 1).gruppo1pl2 p4.g1pl2 = p1.in_round(self.round_number - 1).gruppo1pl2 p2.g1pl3 = p1.in_round(self.round_number - 1).gruppo1pl3 p3.g1pl3 = p1.in_round(self.round_number - 1).gruppo1pl3 p4.g1pl3 = p1.in_round(self.round_number - 1).gruppo1pl3 p2.g1pl4 = p1.in_round(self.round_number - 1).gruppo1pl4 p3.g1pl4 = p1.in_round(self.round_number - 1).gruppo1pl4 p4.g1pl4 = p1.in_round(self.round_number - 1).gruppo1pl4 p2.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg1 p3.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg1 p4.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg1 p1.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg1 for p in self.get_players(): if p.umpirelastgroup == 2: p2.g2pl2 = p1.in_round(self.round_number - 1).gruppo2pl2 p3.g2pl2 = p1.in_round(self.round_number - 1).gruppo2pl2 p4.g2pl2 = p1.in_round(self.round_number - 1).gruppo2pl2 p2.g2pl3 = p1.in_round(self.round_number - 1).gruppo2pl3 p3.g2pl3 = p1.in_round(self.round_number - 1).gruppo2pl3 p4.g2pl3 = p1.in_round(self.round_number - 1).gruppo2pl3 p2.g2pl4 = p1.in_round(self.round_number - 1).gruppo2pl4 p3.g2pl4 = p1.in_round(self.round_number - 1).gruppo2pl4 p4.g2pl4 = p1.in_round(self.round_number - 1).gruppo2pl4 p2.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg2 p3.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg2 p4.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg2 p1.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg2 for p in self.get_players(): if p.umpirelastgroup == 3: p2.g3pl2 = p1.in_round(self.round_number - 1).gruppo3pl2 p3.g3pl2 = p1.in_round(self.round_number - 1).gruppo3pl2 p4.g3pl2 = p1.in_round(self.round_number - 1).gruppo3pl2 p2.g3pl3 = p1.in_round(self.round_number - 1).gruppo3pl3 p3.g3pl3 = p1.in_round(self.round_number - 1).gruppo3pl3 p4.g3pl3 = p1.in_round(self.round_number - 1).gruppo3pl3 p2.g3pl4 = p1.in_round(self.round_number - 1).gruppo3pl4 p3.g3pl4 = p1.in_round(self.round_number - 1).gruppo3pl4 p4.g3pl4 = p1.in_round(self.round_number - 1).gruppo3pl4 p2.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg3 p3.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg3 p4.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg3 p1.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg3 for p in self.get_players(): if p.umpirelastgroup == 4: p2.g4pl2 = p1.in_round(self.round_number - 1).gruppo4pl2 p3.g4pl2 = p1.in_round(self.round_number - 1).gruppo4pl2 p4.g4pl2 = p1.in_round(self.round_number - 1).gruppo4pl2 p2.g4pl3 = p1.in_round(self.round_number - 1).gruppo4pl3 p3.g4pl3 = p1.in_round(self.round_number - 1).gruppo4pl3 p4.g4pl3 = p1.in_round(self.round_number - 1).gruppo4pl3 p2.g4pl4 = p1.in_round(self.round_number - 1).gruppo4pl4 p3.g4pl4 = p1.in_round(self.round_number - 1).gruppo4pl4 p4.g4pl4 = p1.in_round(self.round_number - 1).gruppo4pl4 p2.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg4 p3.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg4 p4.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg4 p1.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg4 for p in self.get_players(): if p.umpirelastgroup == 5: p2.g5pl2 = p1.in_round(self.round_number - 1).gruppo5pl2 p3.g5pl2 = p1.in_round(self.round_number - 1).gruppo5pl2 p4.g5pl2 = p1.in_round(self.round_number - 1).gruppo5pl2 p2.g5pl3 = p1.in_round(self.round_number - 1).gruppo5pl3 p3.g5pl3 = p1.in_round(self.round_number - 1).gruppo5pl3 p4.g5pl3 = p1.in_round(self.round_number - 1).gruppo5pl3 p2.g5pl4 = p1.in_round(self.round_number - 1).gruppo5pl4 p3.g5pl4 = p1.in_round(self.round_number - 1).gruppo5pl4 p4.g5pl4 = p1.in_round(self.round_number - 1).gruppo5pl4 p2.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg5 p3.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg5 p4.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg5 p1.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg5 for p in self.get_players(): if p.umpirelastgroup == 6: p2.g6pl2 = p1.in_round(self.round_number - 1).gruppo6pl2 p3.g6pl2 = p1.in_round(self.round_number - 1).gruppo6pl2 p4.g6pl2 = p1.in_round(self.round_number - 1).gruppo6pl2 p2.g6pl3 = p1.in_round(self.round_number - 1).gruppo6pl3 p3.g6pl3 = p1.in_round(self.round_number - 1).gruppo6pl3 p4.g6pl3 = p1.in_round(self.round_number - 1).gruppo6pl3 p2.g6pl4 = p1.in_round(self.round_number - 1).gruppo6pl4 p3.g6pl4 = p1.in_round(self.round_number - 1).gruppo6pl4 p4.g6pl4 = p1.in_round(self.round_number - 1).gruppo6pl4 p2.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg6 p3.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg6 p4.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg6 p1.partecipantiprima = p1.in_round(self.round_number - 1).partecipantipg6 def punizioni_gruppo_precedente_arbitro(self): p2 = self.get_player_by_id(2) p3 = self.get_player_by_id(3) p4 = self.get_player_by_id(4) p1 = self.get_player_by_id(1) #puizioni passate gruppo 1 for p in self.get_players(): if p.umpirelastgroup == 1: p2.p1pl2 = p1.in_round(self.round_number - 1).punizgruppo1pl2 p3.p1pl2 = p1.in_round(self.round_number - 1).punizgruppo1pl2 p4.p1pl2 = p1.in_round(self.round_number - 1).punizgruppo1pl2 p2.p1pl3 = p1.in_round(self.round_number - 1).punizgruppo1pl3 p3.p1pl3 = p1.in_round(self.round_number - 1).punizgruppo1pl3 p4.p1pl3 = p1.in_round(self.round_number - 1).punizgruppo1pl3 p2.p1pl4 = p1.in_round(self.round_number - 1).punizgruppo1pl4 p3.p1pl4 = p1.in_round(self.round_number - 1).punizgruppo1pl4 p4.p1pl4 = p1.in_round(self.round_number - 1).punizgruppo1pl4 for p in self.get_players(): if p.umpirelastgroup == 2: p2.p2pl2 = p1.in_round(self.round_number - 1).punizgruppo2pl2 p3.p2pl2 = p1.in_round(self.round_number - 1).punizgruppo2pl2 p4.p2pl2 = p1.in_round(self.round_number - 1).punizgruppo2pl2 p2.p2pl3 = p1.in_round(self.round_number - 1).punizgruppo2pl3 p3.p2pl3 = p1.in_round(self.round_number - 1).punizgruppo2pl3 p4.p2pl3 = p1.in_round(self.round_number - 1).punizgruppo2pl3 p2.p2pl4 = p1.in_round(self.round_number - 1).punizgruppo2pl4 p3.p2pl4 = p1.in_round(self.round_number - 1).punizgruppo2pl4 p4.p2pl4 = p1.in_round(self.round_number - 1).punizgruppo2pl4 for p in self.get_players(): if p.umpirelastgroup == 3: p2.p3pl2 = p1.in_round(self.round_number - 1).punizgruppo3pl2 p3.p3pl2 = p1.in_round(self.round_number - 1).punizgruppo3pl2 p4.p3pl2 = p1.in_round(self.round_number - 1).punizgruppo3pl2 p2.p3pl3 = p1.in_round(self.round_number - 1).punizgruppo3pl3 p3.p3pl3 = p1.in_round(self.round_number - 1).punizgruppo3pl3 p4.p3pl3 = p1.in_round(self.round_number - 1).punizgruppo3pl3 p2.p3pl4 = p1.in_round(self.round_number - 1).punizgruppo3pl4 p3.p3pl4 = p1.in_round(self.round_number - 1).punizgruppo3pl4 p4.p3pl4 = p1.in_round(self.round_number - 1).punizgruppo3pl4 for p in self.get_players(): if p.umpirelastgroup == 4: p2.p4pl2 = p1.in_round(self.round_number - 1).punizgruppo4pl2 p3.p4pl2 = p1.in_round(self.round_number - 1).punizgruppo4pl2 p4.p4pl2 = p1.in_round(self.round_number - 1).punizgruppo4pl2 p2.p4pl3 = p1.in_round(self.round_number - 1).punizgruppo4pl3 p3.p4pl3 = p1.in_round(self.round_number - 1).punizgruppo4pl3 p4.p4pl3 = p1.in_round(self.round_number - 1).punizgruppo4pl3 p2.p4pl4 = p1.in_round(self.round_number - 1).punizgruppo4pl4 p3.p4pl4 = p1.in_round(self.round_number - 1).punizgruppo4pl4 p4.p4pl4 = p1.in_round(self.round_number - 1).punizgruppo4pl4 for p in self.get_players(): if p.umpirelastgroup == 5: p2.p5pl2 = p1.in_round(self.round_number - 1).punizgruppo5pl2 p3.p5pl2 = p1.in_round(self.round_number - 1).punizgruppo5pl2 p4.p5pl2 = p1.in_round(self.round_number - 1).punizgruppo5pl2 p2.p5pl3 = p1.in_round(self.round_number - 1).punizgruppo5pl3 p3.p5pl3 = p1.in_round(self.round_number - 1).punizgruppo5pl3 p4.p5pl3 = p1.in_round(self.round_number - 1).punizgruppo5pl3 p2.p5pl4 = p1.in_round(self.round_number - 1).punizgruppo5pl4 p3.p5pl4 = p1.in_round(self.round_number - 1).punizgruppo5pl4 p4.p5pl4 = p1.in_round(self.round_number - 1).punizgruppo5pl4 for p in self.get_players(): if p.umpirelastgroup == 6: p2.p6pl2 = p1.in_round(self.round_number - 1).punizgruppo6pl2 p3.p6pl2 = p1.in_round(self.round_number - 1).punizgruppo6pl2 p4.p6pl2 = p1.in_round(self.round_number - 1).punizgruppo6pl2 p2.p6pl3 = p1.in_round(self.round_number - 1).punizgruppo6pl3 p3.p6pl3 = p1.in_round(self.round_number - 1).punizgruppo6pl3 p4.p6pl3 = p1.in_round(self.round_number - 1).punizgruppo6pl3 p2.p6pl4 = p1.in_round(self.round_number - 1).punizgruppo6pl4 p3.p6pl4 = p1.in_round(self.round_number - 1).punizgruppo6pl4 p4.p6pl4 = p1.in_round(self.round_number - 1).punizgruppo6pl4 def punizioni_gruppi(self): #registro le punizioni per poterle ripescare al momento dell'acquisto dell'info p2 = self.get_player_by_id(2) p3 = self.get_player_by_id(3) p4 = self.get_player_by_id(4) p1 = self.get_player_by_id(1) #punizioni gruppo 1 for p in self.get_players(): if p2.numberg == 1 and p2.punizione == 0: p1.punizgruppo1pl2 = "0 points" if p2.numberg == 1 and p2.punizione == 7: p1.punizgruppo1pl2 = "7 points" if p2.numberg == 1 and p2.punizione == 11: p1.punizgruppo1pl2 = "11 points" for p in self.get_players(): if p3.numberg == 1 and p3.punizione == 0: p1.punizgruppo1pl3 = "0 points" if p3.numberg == 1 and p3.punizione == 7: p1.punizgruppo1pl3 = "7 points" if p3.numberg == 1 and p3.punizione == 11: p1.punizgruppo1pl3 = "11 points" for p in self.get_players(): if p4.numberg == 1 and p4.punizione == 0: p1.punizgruppo1pl4 = "0 points" if p4.numberg == 1 and p4.punizione == 7: p1.punizgruppo1pl4 = "7 points" if p4.numberg == 1 and p4.punizione == 11: p1.punizgruppo1pl4 = "11 points" #puizioni gruppo 2 for p in self.get_players(): if p2.numberg == 2 and p2.punizione == 0: p1.punizgruppo2pl2 = "0 points" if p2.numberg == 2 and p2.punizione == 7: p1.punizgruppo2pl2 = "7 points" if p2.numberg == 2 and p2.punizione == 11: p1.punizgruppo2pl2 = "11 points" for p in self.get_players(): if p3.numberg == 2 and p3.punizione == 0: p1.punizgruppo2pl3 = "0 points" if p3.numberg == 2 and p3.punizione == 7: p1.punizgruppo2pl3 = "7 points" if p3.numberg == 2 and p3.punizione == 11: p1.punizgruppo2pl3 = "11 points" for p in self.get_players(): if p4.numberg == 2 and p4.punizione == 0: p1.punizgruppo2pl4 = "0 points" if p4.numberg == 2 and p4.punizione == 7: p1.punizgruppo2pl4 = "7 points" if p4.numberg == 2 and p4.punizione == 11: p1.punizgruppo2pl4 = "11 points" #puizioni passate gruppo 3 for p in self.get_players(): if p2.numberg == 3 and p2.punizione == 0: p1.punizgruppo3pl2 = "0 points" if p2.numberg == 3 and p2.punizione == 7: p1.punizgruppo3pl2 = "7 points" if p2.numberg == 3 and p2.punizione == 11: p1.punizgruppo3pl2 = "11 points" for p in self.get_players(): if p3.numberg == 3 and p3.punizione == 0: p1.punizgruppo3pl3 = "0 points" if p3.numberg == 3 and p3.punizione == 7: p1.punizgruppo3pl3 = "7 points" if p3.numberg == 3 and p3.punizione == 11: p1.punizgruppo3pl3 = "11 points" for p in self.get_players(): if p4.numberg == 3 and p4.punizione == 0: p1.punizgruppo3pl4 = "0 points" if p4.numberg == 3 and p4.punizione == 7: p1.punizgruppo3pl4 = "7 points" if p4.numberg == 3 and p4.punizione == 11: p1.punizgruppo3pl4 = "11 points" #puizioni passate gruppo 4 for p in self.get_players(): if p2.numberg == 4 and p2.punizione == 0: p1.punizgruppo4pl2 = "0 points" if p2.numberg == 4 and p2.punizione == 7: p1.punizgruppo4pl2 = "7 points" if p2.numberg == 4 and p2.punizione == 11: p1.punizgruppo4pl2 = "11 points" for p in self.get_players(): if p3.numberg == 4 and p3.punizione == 0: p1.punizgruppo4pl3 = "0 points" if p3.numberg == 4 and p3.punizione == 7: p1.punizgruppo4pl3 = "7 points" if p3.numberg == 4 and p3.punizione == 11: p1.punizgruppo4pl3 = "11 points" for p in self.get_players(): if p4.numberg == 4 and p4.punizione == 0: p1.punizgruppo4pl4 = "0 points" if p4.numberg == 4 and p4.punizione == 7: p1.punizgruppo4pl4 = "7 points" if p4.numberg == 4 and p4.punizione == 11: p1.punizgruppo4pl4 = "11 points" #puizioni passate gruppo 5 for p in self.get_players(): if p2.numberg == 5 and p2.punizione == 0: p1.punizgruppo5pl2 = "0 points" if p2.numberg == 5 and p2.punizione == 7: p1.punizgruppo5pl2 = "7 points" if p2.numberg == 5 and p2.punizione == 11: p1.punizgruppo5pl2 = "11 points" for p in self.get_players(): if p3.numberg == 5 and p3.punizione == 0: p1.punizgruppo5pl3 = "0 points" if p3.numberg == 5 and p3.punizione == 7: p1.punizgruppo5pl3 = "7 points" if p3.numberg == 5 and p3.punizione == 11: p1.punizgruppo5pl3 = "11 points" for p in self.get_players(): if p4.numberg == 5 and p4.punizione == 0: p1.punizgruppo5pl4 = "0 points" if p4.numberg == 5 and p4.punizione == 7: p1.punizgruppo5pl4 = "7 points" if p4.numberg == 5 and p4.punizione == 11: p1.punizgruppo5pl4 = "11 points" #puizioni passate gruppo 6 for p in self.get_players(): if p2.numberg == 6 and p2.punizione == 0: p1.punizgruppo6pl2 = "0 points" if p2.numberg == 6 and p2.punizione == 7: p1.punizgruppo6pl2 = "7 points" if p2.numberg == 6 and p2.punizione == 11: p1.punizgruppo6pl2 = "11 points" for p in self.get_players(): if p3.numberg == 6 and p3.punizione == 0: p1.punizgruppo6pl3 = "0 points" if p3.numberg == 6 and p3.punizione == 7: p1.punizgruppopl3 = "7 points" if p3.numberg == 6 and p3.punizione == 11: p1.punizgruppo6pl3 = "11 points" for p in self.get_players(): if p4.numberg == 6 and p4.punizione == 0: p1.punizgruppo6pl4 = "0 points" if p4.numberg == 6 and p4.punizione == 7: p1.punizgruppo6pl4 = "7 points" if p4.numberg == 6 and p4.punizione == 11: p1.punizgruppo6pl4 = "11 points" #partecipanti for p in self.get_players(): if p.numberg == 1 and p.partecipantipg == 0: p.partecipantipg1 = 0 elif p.numberg == 1 and p.partecipantipg == 1: p.partecipantipg1 = 0 else: p.partecipantipg1 = 100 for p in self.get_players(): if p.numberg == 2 and p.partecipantipg == 0: p.partecipantipg2 = 0 elif p.numberg == 2 and p.partecipantipg == 1: p.partecipantipg2 = 0 else: p.partecipantipg2 = 100 for p in self.get_players(): if p.numberg == 3 and p.partecipantipg == 0: p.partecipantipg3 = 0 elif p.numberg == 3 and p.partecipantipg == 1: p.partecipantipg3 = 0 else: p.partecipantipg3 = 100 for p in self.get_players(): if p.numberg == 4 and p.partecipantipg == 0: p.partecipantipg4 = 0 elif p.numberg == 4 and p.partecipantipg == 1: p.partecipantipg4 = 0 else: p.partecipantipg4 = 100 for p in self.get_players(): if p.numberg == 5 and p.partecipantipg == 0: p.partecipantipg5 = 0 elif p.numberg == 5 and p.partecipantipg == 1: p.partecipantipg5 = 0 else: p.partecipantipg5 = 100 for p in self.get_players(): if p.numberg == 6 and p.partecipantipg == 0: p.partecipantipg6 = 0 elif p.numberg == 6 and p.partecipantipg == 1: p.partecipantipg6 = 0 else: p.partecipantipg6 = 100 def giocate(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) for p in self.get_players(): if p2.numberg == 1 and p2.contribution == 99: p1.gruppo1pl2 = "Exit" if p2.numberg == 1 and p2.contribution == 0: p1.gruppo1pl2 = "0 points" if p2.numberg == 1 and p2.contribution == 3: p1.gruppo1pl2 = "3 points" if p2.numberg == 1 and p2.contribution == 6: p1.gruppo1pl2 = "6 points" if p2.numberg == 1 and p2.contribution == 9: p1.gruppo1pl2 = "9 points" if p2.numberg == 1 and p2.contribution == 100: p1.gruppo1pl2 = "0 points and 2 points to the umpire" if p2.numberg == 1 and p2.contribution == 300: p1.gruppo1pl2 = "3 points and 1 point to the umpire" for p in self.get_players(): if p3.numberg == 1 and p3.contribution == 99: p1.gruppo1pl3 = "Exit" if p3.numberg == 1 and p3.contribution == 0: p1.gruppo1pl3 = "0 points" if p3.numberg == 1 and p3.contribution == 3: p1.gruppo1pl3 = "3 points" if p3.numberg == 1 and p3.contribution == 6: p1.gruppo1pl3 = "6 points" if p3.numberg == 1 and p3.contribution == 9: p1.gruppo1pl3 = "9 points" if p3.numberg == 1 and p3.contribution == 100: p1.gruppo1pl3 = "0 points and 2 points to the umpire" if p3.numberg == 1 and p3.contribution == 300: p1.gruppo1pl3 = "3 points and 1 point to the umpire" for p in self.get_players(): if p4.numberg == 1 and p4.contribution == 99: p1.gruppo1pl4 = "Exit" if p4.numberg == 1 and p4.contribution == 0: p1.gruppo1pl4 = "0 points" if p4.numberg == 1 and p4.contribution == 3: p1.gruppo1pl4 = "3 points" if p4.numberg == 1 and p4.contribution == 6: p1.gruppo1pl4 = "6 points" if p4.numberg == 1 and p4.contribution == 9: p1.gruppo1pl4 = "9 points" if p4.numberg == 1 and p4.contribution == 100: p1.gruppo1pl4 = "0 points and 2 points to the umpire" if p4.numberg == 1 and p4.contribution == 300: p1.gruppo1pl4 = "3 points and 1 point to the umpire" # registro le giocate gruppo 2 for p in self.get_players(): if p2.numberg == 2 and p2.contribution == 99: p1.gruppo2pl2 = "Exit" if p2.numberg == 2 and p2.contribution == 0: p1.gruppo2pl2 = "0 points" if p2.numberg == 2 and p2.contribution == 3: p1.gruppo2pl2 = "3 points" if p2.numberg == 2 and p2.contribution == 6: p1.gruppo2pl2 = "6 points" if p2.numberg == 2 and p2.contribution == 9: p1.gruppo2pl2 = "9 points" if p2.numberg == 2 and p2.contribution == 100: p1.gruppo2pl2 = "0 points and 2 points to the umpire" if p2.numberg == 2 and p2.contribution == 300: p1.gruppo2pl2 = "3 points and 1 point to the umpire" for p in self.get_players(): if p3.numberg == 2 and p3.contribution == 99: p1.gruppo2pl3 = "Exit" if p3.numberg == 2 and p3.contribution == 0: p1.gruppo2pl3 = "0 points" if p3.numberg == 2 and p3.contribution == 3: p1.gruppo2pl3 = "3 points" if p3.numberg == 2 and p3.contribution == 6: p1.gruppo2pl3 = "6 points" if p3.numberg == 2 and p3.contribution == 9: p1.gruppo2pl3 = "9 points" if p3.numberg == 2 and p3.contribution == 100: p1.gruppo2pl3 = "0 points and 2 points to the umpire" if p3.numberg == 2 and p3.contribution == 300: p1.gruppo2pl3 = "3 points and 1 point to the umpire" for p in self.get_players(): if p4.numberg == 2 and p4.contribution == 99: p1.gruppo2pl4 = "Exit" if p4.numberg == 2 and p4.contribution == 0: p1.gruppo2pl4 = "0 points" if p4.numberg == 2 and p4.contribution == 3: p1.gruppo2pl4 = "3 points" if p4.numberg == 2 and p4.contribution == 6: p1.gruppo2pl4 = "6 points" if p4.numberg == 2 and p4.contribution == 9: p1.gruppo2pl4 = "9 points" if p4.numberg == 2 and p4.contribution == 100: p1.gruppo2pl4 = "0 points and 2 points to the umpire" if p4.numberg == 2 and p4.contribution == 300: p1.gruppo2pl4 = "3 points and 1 point to the umpire" # registro le giocate gruppo 3 for p in self.get_players(): if p2.numberg == 3 and p2.contribution == 99: p1.gruppo3pl2 = "Exit" if p2.numberg == 3 and p2.contribution == 0: p1.gruppo3pl2 = "0 points" if p2.numberg == 3 and p2.contribution == 3: p1.gruppo3pl2 = "3 points" if p2.numberg == 3 and p2.contribution == 6: p1.gruppo3pl2 = "6 points" if p2.numberg == 3 and p2.contribution == 9: p1.gruppo3pl2 = "9 points" if p2.numberg == 3 and p2.contribution == 100: p1.gruppo3pl2 = "0 points and 2 points to the umpire" if p2.numberg == 3 and p2.contribution == 300: p1.gruppo3pl2 = "3 points and 1 point to the umpire" for p in self.get_players(): if p3.numberg == 3 and p3.contribution == 99: p1.gruppo3pl3 = "Exit" if p3.numberg == 3 and p3.contribution == 0: p1.gruppo3pl3 = "0 points" if p2.numberg == 3 and p3.contribution == 3: p1.gruppo3pl3 = "3 points" if p3.numberg == 3 and p3.contribution == 6: p1.gruppo3pl3 = "6 points" if p3.numberg == 3 and p3.contribution == 9: p1.gruppo3pl3 = "9 points" if p3.numberg == 3 and p3.contribution == 100: p1.gruppo3pl3 = "0 points and 2 points to the umpire" if p3.numberg == 3 and p3.contribution == 300: p1.gruppo3pl3 = "3 points and 1 point to the umpire" for p in self.get_players(): if p4.numberg == 3 and p4.contribution == 99: p1.gruppo3pl4 = "Exit" if p4.numberg == 3 and p4.contribution == 0: p1.gruppo3pl4 = "0 points" if p4.numberg == 3 and p4.contribution == 3: p1.gruppo3pl4 = "3 points" if p4.numberg == 3 and p4.contribution == 6: p1.gruppo3pl4 = "6 points" if p4.numberg == 3 and p4.contribution == 9: p1.gruppo3pl4 = "9 points" if p4.numberg == 3 and p4.contribution == 100: p1.gruppo3pl4 = "0 points and 2 points to the umpire" if p4.numberg == 3 and p4.contribution == 300: p1.gruppo3pl4 = "3 points and 1 point to the umpire" # registro le giocate gruppo 4 for p in self.get_players(): if p2.numberg == 4 and p2.contribution == 99: p1.gruppo4pl2 = "Exit" if p2.numberg == 4 and p2.contribution == 0: p1.gruppo4pl2 = "0 points" if p2.numberg == 4 and p2.contribution == 3: p1.gruppo4pl2 = "3 points" if p2.numberg == 4 and p2.contribution == 6: p1.gruppo4pl2 = "6 points" if p2.numberg == 4 and p2.contribution == 9: p1.gruppo4pl2 = "9 points" if p2.numberg == 4 and p2.contribution == 100: p1.gruppo4pl2 = "0 points and 2 points to the umpire" if p2.numberg == 4 and p2.contribution == 300: p1.gruppo4pl2 = "3 points and 1 point to the umpire" for p in self.get_players(): if p3.numberg == 4 and p3.contribution == 99: p1.gruppo4pl3 = "Exit" if p3.numberg == 4 and p3.contribution == 0: p1.gruppo4pl3 = "0 points" if p2.numberg == 4 and p3.contribution == 3: p1.gruppo4pl3 = "3 points" if p3.numberg == 4 and p3.contribution == 6: p1.gruppo4pl3 = "6 points" if p3.numberg == 4 and p3.contribution == 9: p1.gruppo4pl3 = "9 points" if p3.numberg == 4 and p3.contribution == 100: p1.gruppo4pl3 = "0 points and 2 points to the umpire" if p3.numberg == 4 and p3.contribution == 300: p1.gruppo4pl3 = "3 points and 1 point to the umpire" for p in self.get_players(): if p4.numberg == 4 and p4.contribution == 99: p1.gruppo4pl4 = "Exit" if p4.numberg == 4 and p4.contribution == 0: p1.gruppo4pl4 = "0 points" if p4.numberg == 4 and p4.contribution == 3: p1.gruppo4pl4 = "3 points" if p4.numberg == 4 and p4.contribution == 6: p1.gruppo4pl4 = "6 points" if p4.numberg == 4 and p4.contribution == 9: p1.gruppo4pl4 = "9 points" if p4.numberg == 4 and p4.contribution == 100: p1.gruppo4pl4 = "0 points and 2 points to the umpire" if p4.numberg == 4 and p4.contribution == 300: p1.gruppo4pl4 = "3 points and 1 point to the umpire" # registro le giocate gruppo 5 for p in self.get_players(): if p2.numberg == 5 and p2.contribution == 99: p1.gruppo5pl2 = "Exit" if p2.numberg == 5 and p2.contribution == 0: p1.gruppo5pl2 = "0 points" if p2.numberg == 5 and p2.contribution == 3: p1.gruppo5pl2 = "3 points" if p2.numberg == 5 and p2.contribution == 6: p1.gruppo5pl2 = "6 points" if p2.numberg == 5 and p2.contribution == 9: p1.gruppo5pl2 = "9 points" if p2.numberg == 5 and p2.contribution == 100: p1.gruppo5pl2 = "0 points and 2 points to the umpire" if p2.numberg == 5 and p2.contribution == 300: p1.gruppo5pl2 = "3 points and 1 point to the umpire" for p in self.get_players(): if p3.numberg == 5 and p3.contribution == 99: p1.gruppo5pl3 = "Exit" if p3.numberg == 5 and p3.contribution == 0: p1.gruppo5pl3 = "0 points" if p2.numberg == 5 and p3.contribution == 3: p1.gruppo5pl3 = "3 points" if p3.numberg == 5 and p3.contribution == 6: p1.gruppo5pl3 = "6 points" if p3.numberg == 5 and p3.contribution == 9: p1.gruppo5pl3 = "9 points" if p3.numberg == 5 and p3.contribution == 100: p1.gruppo5pl3 = "0 points and 2 points to the umpire" if p3.numberg == 5 and p3.contribution == 300: p1.gruppo5pl3 = "3 points and 1 point to the umpire" for p in self.get_players(): if p4.numberg == 5 and p4.contribution == 99: p1.gruppo5pl4 = "Exit" if p4.numberg == 5 and p4.contribution == 0: p1.gruppo5pl4 = "0 points" if p4.numberg == 5 and p4.contribution == 3: p1.gruppo5pl4 = "3 points" if p4.numberg == 5 and p4.contribution == 6: p1.gruppo5pl4 = "6 points" if p4.numberg == 5 and p4.contribution == 9: p1.gruppo5pl4 = "9 points" if p4.numberg == 5 and p4.contribution == 100: p1.gruppo5pl4 = "0 points and 2 points to the umpire" if p4.numberg == 5 and p4.contribution == 300: p1.gruppo5pl4 = "3 points and 1 point to the umpire" # registro le giocate gruppo 6 for p in self.get_players(): if p2.numberg == 6 and p2.contribution == 99: p1.gruppo6pl2 = "Exit" if p2.numberg == 6 and p2.contribution == 0: p1.gruppo6pl2 = "0 points" if p2.numberg == 6 and p2.contribution == 3: p1.gruppo6pl2 = "3 points" if p2.numberg == 6 and p2.contribution == 6: p1.gruppo6pl2 = "6 points" if p2.numberg == 6 and p2.contribution == 9: p1.gruppo6pl2 = "9 points" if p2.numberg == 6 and p2.contribution == 100: p1.gruppo6pl2 = "0 points and 2 points to the umpire" if p2.numberg == 6 and p2.contribution == 300: p1.gruppo6pl2 = "3 points and 1 point to the umpire" for p in self.get_players(): if p3.numberg == 6 and p3.contribution == 99: p1.gruppo6pl3 = "Exit" if p3.numberg == 6 and p3.contribution == 0: p1.gruppo6pl3 = "0 points" if p2.numberg == 6 and p3.contribution == 3: p1.gruppo6pl3 = "3 points" if p3.numberg == 6 and p3.contribution == 6: p1.gruppo6pl3 = "6 points" if p3.numberg == 6 and p3.contribution == 9: p1.gruppo6pl3 = "9 points" if p3.numberg == 6 and p3.contribution == 100: p1.gruppo6pl3 = "0 points and 2 points to the umpire" if p3.numberg == 6 and p3.contribution == 300: p1.gruppo6pl3 = "3 points and 1 point to the umpire" for p in self.get_players(): if p4.numberg == 6 and p4.contribution == 99: p1.gruppo6pl4 = "Exit" if p4.numberg == 6 and p4.contribution == 0: p1.gruppo6pl4 = "0 points" if p4.numberg == 6 and p4.contribution == 3: p1.gruppo6pl4 = "3 points" if p4.numberg == 6 and p4.contribution == 6: p1.gruppo6pl4 = "6 points" if p4.numberg == 6 and p4.contribution == 9: p1.gruppo6pl4 = "9 points" if p4.numberg == 6 and p4.contribution == 100: p1.gruppo6pl4 = "0 points and 2 points to the umpire" if p4.numberg == 6 and p4.contribution == 300: p1.gruppo6pl4 = "3 points and 1 point to the umpire" def giocate_gruppi(self): for p in self.get_players(): 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) # registro le giocate gruppo 1 if p2.numberg == 1 and p2.contribution == 99: p1.gruppo1pl2 = "Exit" elif p2.numberg == 1 and p2.contribution == 0: p1.gruppo1pl2 = "0 points" elif p2.numberg == 1 and p2.contribution == 3: p1.gruppo1pl2 = "3 points" elif p2.numberg == 1 and p2.contribution == 6: p1.gruppo1pl2 = "6 points" elif p2.numberg == 1 and p2.contribution == 9: p1.gruppo1pl2 = "9 points" elif p2.numberg == 1 and p2.contribution == 100: p1.gruppo1pl2 = "0 points and 2 points to the umpire" elif p2.numberg == 1 and p2.contribution == 300: p1.gruppo1pl2 = "3 points and 1 point to the umpire" else: pass if p3.numberg == 1 and p3.contribution == 99: p1.gruppo1pl3 = "Exit" elif p3.numberg == 1 and p3.contribution == 0: p1.gruppo1pl3 = "0 points" elif p3.numberg == 1 and p3.contribution == 3: p1.gruppo1pl3 = "3 points" elif p3.numberg == 1 and p3.contribution == 6: p1.gruppo1pl3 = "6 points" elif p3.numberg == 1 and p3.contribution == 9: p1.gruppo1pl3 = "9 points" elif p3.numberg == 1 and p3.contribution == 100: p1.gruppo1pl3 = "0 points and 2 points to the umpire" elif p3.numberg == 1 and p3.contribution == 300: p1.gruppo1pl3 = "3 points and 1 point to the umpire" else: pass if p4.numberg == 1 and p4.contribution == 99: p1.gruppo1pl4 = "Exit" elif p4.numberg == 1 and p4.contribution == 0: p1.gruppo1pl4 = "0 points" elif p4.numberg == 1 and p4.contribution == 3: p1.gruppo1pl4 = "3 points" elif p4.numberg == 1 and p4.contribution == 6: p1.gruppo1pl4 = "6 points" elif p4.numberg == 1 and p4.contribution == 9: p1.gruppo1pl4 = "9 points" elif p4.numberg == 1 and p4.contribution == 100: p1.gruppo1pl4 = "0 points and 2 points to the umpire" elif p4.numberg == 1 and p4.contribution == 300: p1.gruppo1pl4 = "3 points and 1 point to the umpire" else: pass # registro le giocate gruppo 2 if p2.numberg == 2 and p2.contribution == 99: p1.gruppo2pl2 = "Exit" elif p2.numberg == 2 and p2.contribution == 0: p1.gruppo2pl2 = "0 points" elif p2.numberg == 2 and p2.contribution == 3: p1.gruppo2pl2 = "3 points" elif p2.numberg == 2 and p2.contribution == 6: p1.gruppo2pl2 = "6 points" elif p2.numberg == 2 and p2.contribution == 9: p1.gruppo2pl2 = "9 points" elif p2.numberg == 2 and p2.contribution == 100: p1.gruppo2pl2 = "0 points and 2 points to the umpire" elif p2.numberg == 2 and p2.contribution == 300: p1.gruppo2pl2 = "3 points and 1 point to the umpire" else: pass if p3.numberg == 2 and p3.contribution == 99: p1.gruppo2pl3 = "Exit" elif p3.numberg == 2 and p3.contribution == 0: p1.gruppo2pl3 = "0 points" elif p3.numberg == 2 and p3.contribution == 3: p1.gruppo2pl3 = "3 points" elif p3.numberg == 2 and p3.contribution == 6: p1.gruppo2pl3 = "6 points" elif p3.numberg == 2 and p3.contribution == 9: p1.gruppo2pl3 = "9 points" elif p3.numberg == 2 and p3.contribution == 100: p1.gruppo2pl3 = "0 points and 2 points to the umpire" elif p3.numberg == 2 and p3.contribution == 300: p1.gruppo2pl3 = "3 points and 1 point to the umpire" else: pass if p4.numberg == 2 and p4.contribution == 99: p1.gruppo2pl4 = "Exit" elif p4.numberg == 2 and p4.contribution == 0: p1.gruppo2pl4 = "0 points" elif p4.numberg == 2 and p4.contribution == 3: p1.gruppo2pl4 = "3 points" elif p4.numberg == 2 and p4.contribution == 6: p1.gruppo2pl4 = "6 points" elif p4.numberg == 2 and p4.contribution == 9: p1.gruppo2pl4 = "9 points" elif p4.numberg == 2 and p4.contribution == 100: p1.gruppo2pl4 = "0 points and 2 points to the umpire" elif p4.numberg == 2 and p4.contribution == 300: p1.gruppo2pl4 = "3 points and 1 point to the umpire" else: pass # registro le giocate gruppo 3 if p2.numberg == 3 and p2.contribution == 99: p1.gruppo3pl2 = "Exit" elif p2.numberg == 3 and p2.contribution == 0: p1.gruppo3pl2 = "0 points" elif p2.numberg == 3 and p2.contribution == 3: p1.gruppo3pl2 = "3 points" elif p2.numberg == 3 and p2.contribution == 6: p1.gruppo3pl2 = "6 points" elif p2.numberg == 3 and p2.contribution == 9: p1.gruppo3pl2 = "9 points" elif p2.numberg == 3 and p2.contribution == 100: p1.gruppo3pl2 = "0 points and 2 points to the umpire" elif p2.numberg == 3 and p2.contribution == 300: p1.gruppo3pl2 = "3 points and 1 point to the umpire" else: pass if p3.numberg == 3 and p3.contribution == 99: p1.gruppo3pl3 = "Exit" elif p3.numberg == 3 and p3.contribution == 0: p1.gruppo3pl3 = "0 points" elif p2.numberg == 3 and p3.contribution == 3: p1.gruppo3pl3 = "3 points" elif p3.numberg == 3 and p3.contribution == 6: p1.gruppo3pl3 = "6 points" elif p3.numberg == 3 and p3.contribution == 9: p1.gruppo3pl3 = "9 points" elif p3.numberg == 3 and p3.contribution == 100: p1.gruppo3pl3 = "0 points and 2 points to the umpire" elif p3.numberg == 3 and p3.contribution == 300: p1.gruppo3pl3 = "3 points and 1 point to the umpire" else: pass if p4.numberg == 3 and p4.contribution == 99: p1.gruppo3pl4 = "Exit" elif p4.numberg == 3 and p4.contribution == 0: p1.gruppo3pl4 = "0 points" elif p4.numberg == 3 and p4.contribution == 3: p1.gruppo3pl4 = "3 points" elif p4.numberg == 3 and p4.contribution == 6: p1.gruppo3pl4 = "6 points" elif p4.numberg == 3 and p4.contribution == 9: p1.gruppo3pl4 = "9 points" elif p4.numberg == 3 and p4.contribution == 100: p1.gruppo3pl4 = "0 points and 2 points to the umpire" elif p4.numberg == 3 and p4.contribution == 300: p1.gruppo3pl4 = "3 points and 1 point to the umpire" else: pass # registro le giocate gruppo 4 if p2.numberg == 4 and p2.contribution == 99: p1.gruppo4pl2 = "Exit" elif p2.numberg == 4 and p2.contribution == 0: p1.gruppo4pl2 = "0 points" elif p2.numberg == 4 and p2.contribution == 3: p1.gruppo4pl2 = "3 points" elif p2.numberg == 4 and p2.contribution == 6: p1.gruppo4pl2 = "6 points" elif p2.numberg == 4 and p2.contribution == 9: p1.gruppo4pl2 = "9 points" elif p2.numberg == 4 and p2.contribution == 100: p1.gruppo4pl2 = "0 points and 2 points to the umpire" elif p2.numberg == 4 and p2.contribution == 300: p1.gruppo4pl2 = "3 points and 1 point to the umpire" else: pass if p3.numberg == 4 and p3.contribution == 99: p1.gruppo4pl3 = "Exit" elif p3.numberg == 4 and p3.contribution == 0: p1.gruppo4pl3 = "0 points" elif p2.numberg == 4 and p3.contribution == 3: p1.gruppo4pl3 = "3 points" elif p3.numberg == 4 and p3.contribution == 6: p1.gruppo4pl3 = "6 points" elif p3.numberg == 4 and p3.contribution == 9: p1.gruppo4pl3 = "9 points" elif p3.numberg == 4 and p3.contribution == 100: p1.gruppo4pl3 = "0 points and 2 points to the umpire" elif p3.numberg == 4 and p3.contribution == 300: p1.gruppo4pl3 = "3 points and 1 point to the umpire" else: pass if p4.numberg == 4 and p4.contribution == 99: p1.gruppo4pl4 = "Exit" elif p4.numberg == 4 and p4.contribution == 0: p1.gruppo4pl4 = "0 points" elif p4.numberg == 4 and p4.contribution == 3: p1.gruppo4pl4 = "3 points" elif p4.numberg == 4 and p4.contribution == 6: p1.gruppo4pl4 = "6 points" elif p4.numberg == 4 and p4.contribution == 9: p1.gruppo4pl4 = "9 points" elif p4.numberg == 4 and p4.contribution == 100: p1.gruppo4pl4 = "0 points and 2 points to the umpire" elif p4.numberg == 4 and p4.contribution == 300: p1.gruppo4pl4 = "3 points and 1 point to the umpire" else: pass # registro le giocate gruppo 5 if p2.numberg == 5 and p2.contribution == 99: p1.gruppo5pl2 = "Exit" elif p2.numberg == 5 and p2.contribution == 0: p1.gruppo5pl2 = "0 points" elif p2.numberg == 5 and p2.contribution == 3: p1.gruppo5pl2 = "3 points" elif p2.numberg == 5 and p2.contribution == 6: p1.gruppo5pl2 = "6 points" elif p2.numberg == 5 and p2.contribution == 9: p1.gruppo5pl2 = "9 points" elif p2.numberg == 5 and p2.contribution == 100: p1.gruppo5pl2 = "0 points and 2 points to the umpire" elif p2.numberg == 5 and p2.contribution == 300: p1.gruppo5pl2 = "3 points and 1 point to the umpire" else: pass if p3.numberg == 5 and p3.contribution == 99: p1.gruppo5pl3 = "Exit" elif p3.numberg == 5 and p3.contribution == 0: p1.gruppo5pl3 = "0 points" elif p2.numberg == 5 and p3.contribution == 3: p1.gruppo5pl3 = "3 points" elif p3.numberg == 5 and p3.contribution == 6: p1.gruppo5pl3 = "6 points" elif p3.numberg == 5 and p3.contribution == 9: p1.gruppo5pl3 = "9 points" elif p3.numberg == 5 and p3.contribution == 100: p1.gruppo5pl3 = "0 points and 2 points to the umpire" elif p3.numberg == 5 and p3.contribution == 300: p1.gruppo5pl3 = "3 points and 1 point to the umpire" else: pass if p4.numberg == 5 and p4.contribution == 99: p1.gruppo5pl4 = "Exit" elif p4.numberg == 5 and p4.contribution == 0: p1.gruppo5pl4 = "0 points" elif p4.numberg == 5 and p4.contribution == 3: p1.gruppo5pl4 = "3 points" elif p4.numberg == 5 and p4.contribution == 6: p1.gruppo5pl4 = "6 points" elif p4.numberg == 5 and p4.contribution == 9: p1.gruppo5pl4 = "9 points" elif p4.numberg == 5 and p4.contribution == 100: p1.gruppo5pl4 = "0 points and 2 points to the umpire" elif p4.numberg == 5 and p4.contribution == 300: p1.gruppo5pl4 = "3 points and 1 point to the umpire" else: pass # registro le giocate gruppo 6 if p2.numberg == 6 and p2.contribution == 99: p1.gruppo6pl2 = "Exit" elif p2.numberg == 6 and p2.contribution == 0: p1.gruppo6pl2 = "0 points" elif p2.numberg == 6 and p2.contribution == 3: p1.gruppo6pl2 = "3 points" elif p2.numberg == 6 and p2.contribution == 6: p1.gruppo6pl2 = "6 points" elif p2.numberg == 6 and p2.contribution == 9: p1.gruppo6pl2 = "9 points" elif p2.numberg == 6 and p2.contribution == 100: p1.gruppo6pl2 = "0 points and 2 points to the umpire" elif p2.numberg == 6 and p2.contribution == 300: p1.gruppo6pl2 = "3 points and 1 point to the umpire" else: pass if p3.numberg == 6 and p3.contribution == 99: p1.gruppo6pl3 = "Exit" elif p3.numberg == 6 and p3.contribution == 0: p1.gruppo6pl3 = "0 points" elif p2.numberg == 6 and p3.contribution == 3: p1.gruppo6pl3 = "3 points" elif p3.numberg == 6 and p3.contribution == 6: p1.gruppo6pl3 = "6 points" elif p3.numberg == 6 and p3.contribution == 9: p1.gruppo6pl3 = "9 points" elif p3.numberg == 6 and p3.contribution == 100: p1.gruppo6pl3 = "0 points and 2 points to the umpire" elif p3.numberg == 6 and p3.contribution == 300: p1.gruppo6pl3 = "3 points and 1 point to the umpire" else: pass if p4.numberg == 6 and p4.contribution == 99: p1.gruppo6pl4 = "Exit" elif p4.numberg == 6 and p4.contribution == 0: p1.gruppo6pl4 = "0 points" elif p4.numberg == 6 and p4.contribution == 3: p1.gruppo6pl4 = "3 points" elif p4.numberg == 6 and p4.contribution == 6: p1.gruppo6pl4 = "6 points" elif p4.numberg == 6 and p4.contribution == 9: p1.gruppo6pl4 = "9 points" elif p4.numberg == 6 and p4.contribution == 100: p1.gruppo6pl4 = "0 points and 2 points to the umpire" elif p4.numberg == 6 and p4.contribution == 300: p1.gruppo6pl4 = "3 points and 1 point to the umpire" else: pass class Player(BasePlayer): QuestionPG = models.IntegerField(choices=[[18, '\ufeff3 + 6 + 9 = 18 points'], [36, '3 + 6 + 9 = 18. 18 x 2 = 36 points']], label='1) What is the value of the common project?', widget=widgets.RadioSelect) Questionme = models.IntegerField(choices=[[20, '36 : 3 = 12 points. 14(endowment) - 6(contribution) + 12(share of common project) = 20 points'], [24, '36 : 3 = 12 points. 14(endowment) + 12 (share of common project) = 26 points']], label="2) What is your payoff, if the umpire doesn't take you away any point?", widget=widgets.RadioSelect) QuestionUmp = models.IntegerField(choices=[[17, '17 points'], [19, '17(endowment) + 2(prize from the common project) = 19 points if you do not accept points'], [20, '17(endowment) + 2(prize from the common project) + 1 (offered) = 20 points if you accept the point']], label="2) What is the umpire's payoff?", widget=widgets.RadioSelect) contribution = models.IntegerField(choices=[[0, '0'], [100, '0 and 2 points to the umpire'], [3, '3'], [300, '3 and 1 point to the umpire'], [6, '6'], [9, '9'], [99, 'Exit ']], label='How much do you want to put in the common project?', widget=widgets.RadioSelect) mazzetta = models.IntegerField() bonus = models.IntegerField() punishment2 = models.IntegerField(choices=[[0, 'No points'], [7, '7'], [11, '11']], label="Of how many points do you want to reduce this participant's payoff? ", widget=widgets.RadioSelect) punishment3 = models.IntegerField(choices=[[0, 'No points'], [7, '7'], [11, '11']], label="Of how many points do you want to reduce this participant's payoff? ", widget=widgets.RadioSelect) punishment4 = models.IntegerField(choices=[[0, 'No points'], [7, '7'], [11, '11']], label="Of how many points do you want to reduce this participant's payoff? ", widget=widgets.RadioSelect) bribe2 = models.IntegerField(choices=[[1, 'Yes'], [0, 'No']], label='Do you accept the points offered by this participant?', widget=widgets.RadioSelect) bribe3 = models.IntegerField(choices=[[1, 'Yes'], [0, 'No']], label='Do you accept the points offered by this participant?', widget=widgets.RadioSelect) bribe4 = models.IntegerField(choices=[[1, 'Yes'], [0, 'No']], label='Do you accept the points offered by this participant?', widget=widgets.RadioSelect) bribepl2 = models.IntegerField() bribepl3 = models.IntegerField() bribepl4 = models.IntegerField() Info = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label="Do you want to buy information about the previous round umpire's decisions, paying 1 point?", widget=widgets.RadioSelect) infostringa = models.StringField() punizione2 = models.IntegerField() punizione3 = models.IntegerField() punizione4 = models.IntegerField() valoremazzetta = models.IntegerField() punizione = models.IntegerField() numberg = models.IntegerField() exit0 = models.IntegerField() exitpl2 = models.IntegerField() exitpl3 = models.IntegerField() exitpl4 = models.IntegerField() progettocomune = models.StringField(choices=[['0 points', '0 points'], ['3 points', '3 points'], ['0 points and 2 points to the umpire', '0 points and 2 points to the umpire'], ['3 points and 1 point to the umpire', '3 points and 1 point to the umpire'], ['6 points', '6 points'], ['9 points ', '9 points '], ['Exit', 'Exit']]) infopunizione = models.IntegerField(choices=[[0, '0'], [7, '7'], [11, '11']]) infocontribution = models.IntegerField(choices=[[0, '0'], [3, '3'], [100, '100'], [300, '300'], [6, '6'], [9, '9'], [99, '99']]) progettocomunepl2 = models.StringField(choices=[['0 points', '0 points'], ['3 points', '3 points'], ['0 points and 2 points to the umpire', '0 points and 2 points to the umpire'], ['3 points and 1 point to the umpire', '3 points and 1 point to the umpire'], ['6 points', '6 points'], ['9 points ', '9 points '], ['Exit', 'Exit']]) progettocomunepl3 = models.StringField(choices=[['0 points', '0 points'], ['3 points', '3 points'], ['0 points and 2 points to the umpire', '0 points and 2 points to the umpire'], ['3 points and 1 point to the umpire', '3 points and 1 point to the umpire'], ['6 points', '6 points'], ['9 points ', '9 points '], ['Exit', 'Exit']]) progettocomunepl4 = models.StringField(choices=[['0 points', '0 points'], ['3 points', '3 points'], ['0 points and 2 points to the umpire', '0 points and 2 points to the umpire'], ['3 points and 1 point to the umpire', '3 points and 1 point to the umpire'], ['6 points', '6 points'], ['9 points ', '9 points '], ['Exit', 'Exit']]) corruzione = models.IntegerField() corruttori = models.IntegerField() gruppo1pl2 = models.StringField() gruppo1pl3 = models.StringField() gruppo1pl4 = models.StringField() gruppo2pl2 = models.StringField() gruppo2pl3 = models.StringField() gruppo2pl4 = models.StringField() gruppo3pl2 = models.StringField() gruppo3pl3 = models.StringField() gruppo3pl4 = models.StringField() gruppo4pl2 = models.StringField() gruppo4pl3 = models.StringField() gruppo4pl4 = models.StringField() gruppo5pl2 = models.StringField() gruppo5pl3 = models.StringField() gruppo5pl4 = models.StringField() gruppo6pl2 = models.StringField() gruppo6pl3 = models.StringField() gruppo6pl4 = models.StringField() punizgruppo1pl2 = models.StringField() punizgruppo1pl3 = models.StringField() punizgruppo1pl4 = models.StringField() punizgruppo2pl2 = models.StringField() punizgruppo2pl3 = models.StringField() punizgruppo2pl4 = models.StringField() punizgruppo3pl2 = models.StringField() punizgruppo3pl3 = models.StringField() punizgruppo3pl4 = models.StringField() punizgruppo4pl2 = models.StringField() punizgruppo4pl3 = models.StringField() punizgruppo4pl4 = models.StringField() punizgruppo5pl2 = models.StringField() punizgruppo5pl3 = models.StringField() punizgruppo5pl4 = models.StringField() punizgruppo6pl2 = models.StringField() punizgruppo6pl3 = models.StringField() punizgruppo6pl4 = models.StringField() umpirelastgroup = models.IntegerField() corruttoriprima = models.StringField() corruzioneprima = models.StringField() contributionplayer2 = models.IntegerField() contributionplayer3 = models.IntegerField() contributionplayer4 = models.IntegerField() g1pl2 = models.StringField() g1pl3 = models.StringField() g1pl4 = models.StringField() p1pl2 = models.StringField() p1pl3 = models.StringField() p1pl4 = models.StringField() partecipantiprima = models.IntegerField() partecipantipg1 = models.IntegerField() partecipantipg2 = models.IntegerField() partecipantipg3 = models.IntegerField() partecipantipg4 = models.IntegerField() partecipantipg5 = models.IntegerField() partecipantipg6 = models.IntegerField() partecipantipg = models.IntegerField() QuestionPGUmpire = models.IntegerField(choices=[], label='What is the value of the common project=') def setglobals(self): self.participant.vars['FJVG_payoff'] = self.participant.payoff return(self.participant.vars)