Hey, the following code should work:
(the omitted code parts are the ones you find in every app)
Settings
PARTICIPANT_FIELDS = ["wait_page_arrival"]
First App
import time
# PAGES
class MyPage(Page):
@staticmethod
def before_next_page(player: Player, timeout_happened):
player.participant.wait_page_arrival = time.time()
Second App
import time
class Constants(BaseConstants):
players_per_group = 2
class Subsession(BaseSubsession):
@staticmethod
def group_by_arrival_time_method(subsession, waiting_players):
if len(waiting_players) >= 2:
return waiting_players[:2]
for player in waiting_players:
if waiting_too_long(player):
# make a single-player group.
return [player]
class Group(BaseGroup):
pass
class Player(BasePlayer):
pass
# Function
def waiting_too_long(player):
participant = player.participant
return time.time() - participant.wait_page_arrival > 5
# PAGES
class ResultsWaitPage(WaitPage):
group_by_arrival_time = True
class MyPage(Page):
pass
page_sequence = [ResultsWaitPage, MyPage] # Waitpage must be the first page in the app!