from otree.api import * doc = """ This is a template for an exit survey linking to a SoSciSurvey payout survey. """ class C(BaseConstants): NUM_ROUNDS = 1 PLAYERS_PER_GROUP = None NAME_IN_URL = 'payout_referral' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): pass # PAGES class Payment_Refer_Page(Page): form_model = 'player' @staticmethod def js_vars(player: Player): payoff_eur = player.participant.vars.get('total_pay', 0)# note that this needs to change to your specific payout variable. return dict(p_payoff = payoff_eur, p_participant = player.participant.code) # this returns the otree participant code, in case you are using something else, you need to change this. page_sequence = [Payment_Refer_Page]