Hi Chris and all, I am having a question with a line of code at Otree snippets:
It is pay_random_app1
class Constants(BaseConstants):
name_in_url = 'pay_random_app1'
players_per_group = None
num_rounds = 1
class ResultsWaitPage(WaitPage):
@staticmethod
def after_all_players_arrive(group: Group):
"""
In multiplayer games, payoffs are typically set in after_all_players_arrive,
so that's what we demonstrate here.
"""
import random
for p
in group.get_players():
participant = p.participant
potential_payoff = random.randint(100, 200)
p.potential_payoff = potential_payoff
# __name__ is the name of the current app
participant.app_payoffs
[__name__] = potential_payoff
I am wondering what to put in that name part. Is it:
participant.app_payoffs[__pay_random_app1__] = potential_payoff
Because when I am running my own code(participant.app_payoffs[__ABC__] = potential_payoff)
I have an Attribution error that said participant field does not have the field ABC so I am wondering if I am understanding the model code correctly(maybe I did something wrong somewhere else, just trying to figure things out).
Thanks!