from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'Payment' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass # def vars_for_admin_report(self): # report = list() # for p in self.get_players(): # report.append(dict( # id=p.participant.id_in_session, # label=p.participant.label, # code=p.participant.vars['code'], # Access code from participant vars # payoff=p.participant.vars['payoff'], # Access payoff from participant vars # )) # return dict(report=report) class Group(BaseGroup): pass class Player(BasePlayer): code = models.StringField() satisfaction = models.IntegerField(blank=True) comments = models.StringField(blank=True) # PAGES class Satisfaction(Page): form_model = 'player' form_fields = [ 'satisfaction', 'comments'] def before_next_page(player, timeout_happened): player.code = player.participant.vars['code'] if 'payoff' in player.participant.vars: player.payoff = player.participant.vars['payoff'] class Payment(Page): pass page_sequence = [ Satisfaction, Payment]