from otree.api import * doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'Result' players_per_group = 2 num_rounds = 1 width = '850px' height = 1.7 # 聊天室 PAPERCUPS_TEMPLATE = __name__ + '/papercups.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): pass # PAGES class IntroductionPayoff(Page): pass class IntroductionPayoff_drop(Page): @staticmethod def is_displayed(player: Player): return player.participant.jump_to_next == True pass class Offer(Page): form_model = 'group' form_fields = ['kept'] @staticmethod def is_displayed(player: Player): return player.id_in_group == 1 class ResultsWaitPage(WaitPage): # after_all_players_arrive = set_payoffs pass class Results(Page): @staticmethod def vars_for_template(player: Player): import time # player.participant.wait_page_arrival = time.time() group = player.group p1 = group.get_player_by_id(1) p2 = group.get_player_by_id(2) print("p1", p1.participant.participated) print("p2", p2.participant.participated) pass class MyPage(Page): pass class ResultsWaitPage(WaitPage): pass page_sequence = [IntroductionPayoff_drop, Results]