oTree Forum >

Leaving the chat together

#1 by Aurel

Hey Chris and oTree community, 

I am programming a usual repeated public good game with chat before the contribution stage. The chat has a time-out of 3 minutes. Additionally, to speed things up in later rounds (in case the participants have nothing to discuss anymore), I also have a next button on the page to let participants leave the chat before the time ends. 

Now, the tricky part: I do not want that one participant leaves and the other two can continue to discuss. My ideal solution would be: as a participant, you can click the next button which sends a notification to the others that you want to leave but everyone remains in the chat. Only when all participants indicated that they want to leave the chat, the chat page is submitted. Any ideas? 

Best and thank you for any hint,

#2 by Chris_oTree

You can do this with a pretty simple live page. Make a Boolean field on each player indicating whether they clocked the button. Connect the button to a liveSend, and in the live method set that field to True. If all players are set to True, then the live method should return a “finished” message. In the liveRecv, submit the page.

Write a reply

Set forum username