from otree.api import Currency as c, currency_range from . import models from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): def is_displayed(self): return self.subsession.round_number == 1 class Choice(Page): form_model = models.Player form_fields = ['Choice'] #waitpage only need if there are several people in one session (laboratory) and you want them to be able to see the others choices class WaitForStats(WaitPage): wait_for_all_groups = True class Results(Page): def vars_for_template(self): everyone = [ { 'Option A': 0, 'Option B': 0 } for i in range(1) ] for participant in self.session.get_participants(): for player in participant.get_players(): everyone[0][player.get_Choice_display()] += 1 you = [ self.player.get_Choice_display(), ] return { 'everyone': everyone, 'you': you } # return self.subsession.vars_for_admin_report() page_sequence = [ Introduction, Choice, WaitForStats, Results ]