Lisää playrille tällainen muuttuja #initialize player total #To do luo erikseen revenue eikä payoff def init_player_total(self): if self.round_number==1: self.total=0 else: self.total=self.in_round(self.round_number - 1).total def init_player_wins(self): if self.round_number==1: self.wins=0 else: self.wins=self.in_round(self.round_number - 1).wins def update_player_total(self): if self.round_number>1: self.total+=self.payoff else: self.total+=self.payoff def update_player_wins(self): if self.round_number>1 and self.is_winner: self.wins+=1 elif self.round_number==1 and self.is_winner: self.wins=1 def get_group_totals(self): saldos=[0,0] times_won=[0,0] for i,p in enumerate(self_get_player_by_role('Seller')) saldos[i]=p.total times_won[i]=p.wins def vars_for_template(self): [retA,retB],[winsA,winsB] = self.get_group_totals() return dict( retA=retA, retB=retB, winsA=winsA, winsB=winsB, ) Edellisten kierrosten aikana osallistujan A on tarjous voittanut {{winsA}} kertaa ja pelaajan saama tulo on ollut yhteensä {{retA}}. Osallistujan B on tarjous voittanut {{winsB}} kertaa ja pelaajan saama tuotto on ollut yhteensä {{retB}}.