Honesty game with dice-roll for Otree
The game generates a random number [1,6] on the click of a button.
The user is paid a sum based on the number they report. Their honesty is measured as the difference between the reported number and the actual outcome.
You can paste the code into your Otree project. You need to add the game to the global settings file as well.