oTree Forum >

Multi-generation game / skip apps for certain participants

#1 by Aurel ,

Hey Chris and all, 

I am building a multi-generation experiment with multiple contribution stages in each generation. To be more precise, we have a total of 12 participants per group distributed across 4 generations (ergo, 3 per generation). The first generation starts, and each of the 3 participants makes 5 contribution decision. After each contribution decision, the 3 participants have the opportunity to use the chat window to communicate with each other. Only if the 3 participants reach a certain contribution threshold, the second generation starts and the same logic applies until the last generation. 

My initial idea was to create one app per generation, have NUM_ROUNDS = 5, and show only the pages of this app to the generation 1. However, then Waitpages do not work (as 9 participants always wait). Is there the opportunity to skip complete apps for certain participants? If I move participants #4-12 already in the app for the second generation, the app for the first generation should work, doesnt it? 

Live Pages as an alternative are a bit problematic as I want to always skip between contribution phase and chat window...

Thank you for any feedback or help and all my best, 

#2 by Chris_oTree ,

Yes you can have the upcoming generations skip the current app using app_after_this_page. And when a generation finishes, you send them to the end of the app_sequence also using app_after_this_page.

#3 by Aurel ,

Thank you Chris for your quick reply - I tried: 

class Instructions(Page):
    form_model = 'player'

def app_after_this_page(player, upcoming_apps):
    print('upcoming_apps is', upcoming_apps)
    if player.id_in_group == 1:
        return "G2"
But it does not work - do you have another hint for me? Thank you!

#4 by Chris_oTree ,

Can you describe in more detail about what is not working?

#5 by Aurel ,

Nothing is happening, all players still proceed to G1 (instead of player with id 1 proceeding to G2).

#6 by Chris_oTree ,

What is the output of your print statement? Did player 1 proceed to the page after Instructions? Try double checking the documentation for app_after_this_page.

#7 by Aurel ,

How can I get the print statement? Sorry for the stupid questions... 

Player 1 also just proceeded to G1 instead of G2.

#8 by Chris_oTree , (edited )

The output of the print statement is in your console where you started the server.

#9 by Chris_oTree ,

And is P1 able to proceed through all of G1?

#10 by Aurel ,

It says: "Warning(title="'app_after_this_page' is defined but not used", id=131, app_name='Instructions')"... Hm, weird... And yes, P1 is able to proceed through all of G1. Do I need to extra trigger the function?

#11 by Chris_oTree ,

it needs to be indented inside the page class (like every @staticmethod)

#12 by Aurel ,

Jesus... I just missed to intend it properly. It works now... Sorry.

Write a reply

Set forum username