def set_coopcomp_payoff(self): players = self.get_players() correct_num_round2 = [p.num_correct_round2 for p in players] self.total_correct_num2 = sum(correct_num_round2) self.jugador_equipo = self.total_correct_num2 / Constants.players_per_group for p in players: if p.pay_choice == "Opción 1": p.earnings_round3 = p.num_correct_round3 * Constants.piece_rate else: if self.jugador_equipo + p.num_correct_round3 >= self.jugador_equipo + p.num_correct_round2: p.earnings_round3 = p.num_correct_round3 * Constants.challenge_piece_rate else: p.earnings_round3 = 0