from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants class Introduction(Page): timeout_seconds = 100 class Decision_guess(Page): def is_displayed(self): return self.round_number in [1,3] form_model = 'player' form_fields = ['decision_guess'] class Decision(Page): form_model = 'player' form_fields = ['decision'] class ResultsWaitPage(WaitPage): after_all_players_arrive = 'set_payoffs' class Results(Page): def vars_for_template(self): me = self.player opponent = me.other_player() return dict( my_decision=me.decision_type, opponent_decision=opponent.decision_type, same_choice=me.decision_type == opponent.decision_type, ) page_sequence = [ Introduction, Decision_guess, Decision, ResultsWaitPage, Results ]