# Standard and Persistent Public Goods ## Overview This repository contains an oTree project implementing two variants of public good games. The pgg app allows playing a standard version (full depreciation of the public good in each round) and a persistent version (partial depreciation of the public good) of the game. The repository is private. ## Structure App ``ppg_instructions`` contains all instruction and comprehension question pages. This is also where constants are set. If constants are used for other apps, make sure to add them to the session variables so they are shared across apps. App ``pgg`` implements the actual game rounds and belief elicitation. Note that custom grouping code is added such that the game works with an arbitrary number of players. Group size can thus be controlled via the session config. It also handles both standard and persistent versions. These can also be set from the session config. App ``pgg_ending`` contains demographics (and other) questionnaires and shows final results and payments. ## Running Clone it and change into the directory: ```bash git clone https://github.com/chkgk/persistent_pgg.git cd persistent_pgg ``` [Create a virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) with python 3.7.x, then activate it whenever you use try to run the project: ```bash # create (once per project): python -m venv venv # usage (every time you start working on the project): # windows: .\venv\Scripts\activate # unix: source venv/bin/activate ``` Install requirements: ```bash pip install -r requirements.txt ``` Run: ```bash otree devserver ``` ## Tests Make sure to write and run tests (for all three apps) when making changes: ```bash otree test pgg_instructions otree test spgg3 otree test spgg4 otree test ppgg3 otree test ppgg4 otree test pgg_ending ``` ## Collaboration Unless you freshly cloned the repo, get the latest version (others may have worked on it) before working on it: ```bash git pull origin master ``` When you are done working on the project or at sensible steps in between, commit your changes: ```bash git add . git commit -am "" ``` To share your work with the others, push it back to the repo: ```bash git push origin master ```