oTree Forum >

Get other player by participant.code or id_in_session

#1 by DavidP

Hi!

Is there a way to directly retrieve (another) player by id_in_subsession (I understand this is constant across apps, right?), participant.id_in_session, or participant.code? I cannot find anything in the docs.
(Of course, looping over all players and then checking for equality works, but is cumbersome and more prone to errors, especially in nested loops etc.)
Bonus points if the method works in otree 3, as I am updating an old experiment.

Thanks,
David

Write a reply

Set forum username