Participant ID In chat

279 views
Skip to first unread message

Flora T

unread,
Sep 9, 2021, 2:56:21 PM9/9/21
to oTree help & discussion
Hi,

I am creating a chat channel for a 2-person group in a 16 person session, but instead of the player ID showed as player 1 said something  and player 2 said something in their player channel. I want the label showed as the exact match. For example, if player 1 and player 16 are matched together, I want in the chatroom the box shows: Player 1 said something and player 16 said something.

Thank you.
Screen Shot 2021-09-09 at 2.54.54 PM.png
Screen Shot 2021-09-09 at 2.54.36 PM.png

Chris @ oTree

unread,
Sep 9, 2021, 3:05:58 PM9/9/21
to oTree help & discussion
@staticmethod
def vars_for_template(player):
  return dict(my_nickname="Player {}".format(player.id_in_subsession))

in the template:

{{ chat nickname=my_nickname }}

Flora T

unread,
Sep 9, 2021, 3:19:30 PM9/9/21
to oTree help & discussion
Wow! I will try this. Thank you~
Message has been deleted

Flora T

unread,
Oct 11, 2021, 5:48:59 PM10/11/21
to oTree help & discussion
Hi Chris,

The chat works well but the message of the participants is not recording in the excel file I think, are there any extra code I need to put to record the chat message? Thank you!

Chris @ oTree

unread,
Oct 11, 2021, 5:49:42 PM10/11/21
to Flora T, oTree help & discussion
Chat messages are not shown in the session’s “data” tab. They are available through the Excel data export page. 

Sent from my phone

On Oct 11, 2021, at 2:46 PM, Flora T <flora...@gmail.com> wrote:

Hi Chris,

The chat works well but the message is not recording I think, are there any extra code I need to put to record the chat message? Thank you!
--
You received this message because you are subscribed to a topic in the Google Groups "oTree help & discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/otree/NBWf9CmES4Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/76aa14f6-a621-4b34-a030-16331d2f8dabn%40googlegroups.com.
<Screen Shot 2021-10-11 at 5.40.31 PM.png>
<Screen Shot 2021-10-11 at 5.40.15 PM.png>

Flora T

unread,
Oct 11, 2021, 6:13:20 PM10/11/21
to oTree help & discussion
Hi Chris,

Thank you! I downloaded the excel but I did not find the user-input data. Can you help me take a look at this, thank you!

Flora T

unread,
Oct 11, 2021, 6:14:25 PM10/11/21
to oTree help & discussion
Screen Shot 2021-10-11 at 6.12.04 PM.png
Message has been deleted

beat...@gmail.com

unread,
May 27, 2022, 10:16:01 AM5/27/22
to oTree help & discussion
You downloaded the wrong data; see the graph below. Best, B.
chat_download_new.JPG
Reply all
Reply to author
Forward
0 new messages