Detect if a session is a demo session

32 views
Skip to first unread message

Jonas

unread,
Mar 17, 2021, 7:08:51 AM3/17/21
to oTree help & discussion
Is there a way to detect if an oTree session is a demo session or a regular session? I would like to implement the option to skip certain pages in demo mode. I guess this would be possible by putting a "test_mode" boolean in the session config that is true in demo sessions but false otherwise, but i would prefer a more direct way to avoid the risk of accidentely selecting the demo version for a real session.

Chris @ oTree

unread,
Mar 17, 2021, 7:17:06 AM3/17/21
to oTree help & discussion
Hi, there is no official indicator whether a session is a demo session or not. (There are some internal flags in the database but it is not stable to rely on undocumented features.) 

Actually I consider the session config technique to be a pretty decent solution for this.

Reply all
Reply to author
Forward
0 new messages