from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random import csv import numpy doc = """ Results - FINAL Results and Payments from all Parts """ class Constants(BaseConstants): name_in_url = 'code:code_SS_results_final' players_per_group = 2 # players_per_supergroup = 4 # --> only relevant for Players B - Part 2 # basically the group brings together all Players A from the same batch/session num_rounds = 1 class Subsession(BaseSubsession): n_tokens_equal_to_1_eur = models.IntegerField() def creating_session(self): self.n_tokens_equal_to_1_eur = self.session.config['n_tokens_equal_to_1_eur'] for p in self.get_players(): p.n_tokens_equal_to_1_eur = self.session.config['n_tokens_equal_to_1_eur'] # Conversion rate: number of tokens equal to 1 Euro class Group(BaseGroup): pass class Player(BasePlayer): n_tokens_equal_to_1_eur = models.IntegerField() # part1_payoff = models.IntegerField() part1_payoff_eur_to_show = models.FloatField() # part2_payoff = models.IntegerField() part2_payoff_eur_to_show = models.FloatField() # part3_payoff = models.IntegerField() part3_payoff_eur_to_show = models.FloatField() # total_payoff_pt1to3 = models.FloatField() total_payoff_pt1to3_eur_to_show = models.FloatField() # total_payoff = models.IntegerField() total_payoff_eur_to_show = models.FloatField()