Typically a Shiny server would spawn separate instances for individual users, so that multiple people can individually use the same app at the same time. This answer shows how to make a simple multi-user chat room using Shiny, and this answer explains how multiple users can connect to the same session via direct IP. I got the chat example to work, two users both see the messages immediately as they're being sent, and as such can chat to one another.
I'm wondering if it is at all possible to use Shiny for an (experiment) scenario where two users, interacting with one another, would see different GUI elements on their respective screens, and different output, depending on who's turn it is to "play". For example, if user1 is the "starting player", he would see three buttons and click one of them, a relevant image would pop up for user2 (not for user1), user2 clicks a button (that he thinks matches the image), and then a relevant image pops up for user1, and user1 clicks a "correct"/"incorrect" button to send feedback; they should not see who clicks which button, nor the image the other one sees (if actually hiding GUI elements is tricky, graying out/disabling them intermittently is also fine, as long as they don't see what the other does).
Or more graphically:
round 1
user1 user2
director guesser
what they see, step by step:
1. [three buttons] [ (blank) ]
2. [clicks one] [ ]
3 [ ] [sees an image & 3 buttons]
4. [ ] [clicks a button]
5. [sees image,2 butns] [ ]
6. [clicks button] [ ]
7. [ ] [sees the message "correct" or "incorrect"]
round 2
user1 user2
guesser director
1. [ ] [three buttons]
...
...
And for the next round they switch roles, and so on, for multiple rounds.
I've seen similar experimental scenarios implemented using Javascript (jsPsych, nodegame) and Python (psychopy, oTree), but I'm looking to understand if it's possible to do it in Shiny, and if so, how.