from otree.api import * c = cu doc = 'Democratic Grouping room for 5 Players' class Constants(BaseConstants): name_in_url = 'GroupingRoomDem_5P' players_per_group = 5 num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): consent = models.BooleanField(choices=[[True, 'Yes'], [False, 'No']], label='I have read and understand the explanations. I am over 18 years of age, and I agree to participate in this study.', widget=widgets.RadioSelect) class GroupingPage(WaitPage): group_by_arrival_time = True title_text = 'Waiting Room' body_text = "Please just hang tight, we're waiting for other players to join the game. Don't close this browser as you might have issues rejoining. Grouping typically takes a few minutes, anything longer than this is likely off-peak times." class AppSelection(Page): form_model = 'player' timeout_seconds = 60 @staticmethod def app_after_this_page(player, upcoming_apps): session = player.session subsession = player.subsession group = player.group numid = group.id_in_subsession while(numid > 2): numid -= 2 if(numid == 1): nextapp = upcoming_apps[1] else: nextapp = upcoming_apps[2] return (nextapp) page_sequence = [GroupingPage, AppSelection]