Hi Chris,
Thank you for the quick reply.
I was trying to add a data export endpoint but have since realized that simply requesting "/ExportSessionWide/<session_code>" does the trick. (By the way: This seems to work even when not logged-in and with OTREE_AUTH_LEVEL set to "STUDY").
In the past, I have used additional views to trigger payoff calculations that depend on all finished participants. For example, pay a bonus to participants who are better than the median participant in some game. In online experiments having a "wait for all" page before calculating the payoffs is hardly an option. Thus, I would implement a custom admin report where I could manually mark a session as "finished" and trigger the payoff (re-)calculation for all finished participants when a suitable number of participants had completed the experiments. As the number of participants who finish experiments is quite uncertain, I preferred this approach to hard coding a minimum number of participants to finish before triggering the payoff calculation for everyone.
I think it would be great if a future version of oTree would again allow us to somehow extend the routing system (also for Websockets). Maybe a single check for the presence of a routing.py or urls.py in an app folder would be enough to add to oTree-core.
Related to the API, it would also be nice to be able to specify webhooks for certain events. This would allow third-party applications to react to participants reaching the last page of the experiment for example. I imagine this could also be useful for applications like otree-hr.
Thank you,
Christian