Accessing last round choice variables

82 views
Skip to first unread message

joya.zh...@gmail.com

unread,
Oct 22, 2021, 11:03:30 AM10/22/21
to oTree help & discussion
Hi Chris and all,

Is there a way to access last round subjects' choices in otree? For a specific field, I would like the subjects to choose something different from last round. So if they choose the same thing as last round, I would like to present an error message. Thanks a lot!

Best,
Junya

Chris Crabbe

unread,
Oct 22, 2021, 10:56:27 PM10/22/21
to joya.zh...@gmail.com, oTree help & discussion
Hi Junya -

player.in_round(subsession.round_number-1) should get you the previous round player object:  https://otree.readthedocs.io/en/latest/rounds.html?highlight=in_round#in-rounds-in-previous-rounds-in-round-etc

Thanks,
--Chris

--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/decec90e-23e5-4e4a-903e-7b3a7f71de2fn%40googlegroups.com.

joya.zh...@gmail.com

unread,
Oct 24, 2021, 10:18:50 AM10/24/21
to oTree help & discussion
Thanks a lot, Chris!
Reply all
Reply to author
Forward
0 new messages