This page contains selected code components from experiments I implemented in oTree since 2025. It focuses on parts of the implementation that are not entirely straightforward to code (or that I was particularly proud of 🤓).
Feel free to test the implementations, reuse or adapt them for your own projects, or reach out if you have questions.
A two player audio/video chat
This app implements a two-player video chat using webcams and microphones and was developed in collaboration with Quentin Thévenet, lab manager at GATE. Participants can communicate in real time for a fixed duration. The system relies on WebRTC for peer-to-peer communication and uses STUN/TURN servers to ensure reliable connections across different networks.Â
Human vs AI Classification Task
This app implements a flexible image classification task for oTree in which participants categorize images as human-created or AI-generated. The app can easily be adapted for any binary image classification task. The set of images is loaded dynamically from the otree folder. Images are presented sequentially, responses can be given using on-screen buttons or keyboard shortcuts.Â
Flexible Survey Module
This app is a flexible questionnaire module for oTree that loads its questions from a CSV file making it easy to add, remove, or modify questions without changing the code. Supported question types include multiple choice, free text, numeric input, and Likert-style scales. The CSV file can also define answer options, numeric or character bounds, and scale anchors.Â
'Bomb' Risk Task
This app implements a Bomb Risk Elicitation Task (Crosetto, 2013) with built-in instructions. Two versions of the task are available: the standard version, and a second version in which earnings also accrue to another player, allowing researchers to study risk-taking under responsibility. The instructions include illustrated characters and an animation to explain how the task works.Â
Math Task
This app implements a mental arithmetic task in which participants solve addition problems for a fixed duration (Niederle & Vesterlund, 2007). A problem consists of several randomly generated numbers that must be added. Problems are presented sequentially. The number of numbers per addition, the number of digits of each number, and the task duration are parameterized.