oTree Forum >

Real Time Calculator and graph

#1 by Arsil

Hi Everyone, 

I am working on an app for a modified public good game where I need to display a real time calculation i.e. what a player will get and what others will get given a choice of contribution to the common fund. If it can also be shown in real time graph that will also be helpful. Any code snippets that are related will be much appreciated. I have also searched but I found only the code to incorporate digital version of simple calculator whereas what I want is to display a real time calculation based on an input on the same page. 


#2 by Chris_oTree

See input_calculation in otree-snippets: https://www.otreehub.com/projects/otree-snippets/

#3 by Arsil

Thank you so much Chris. I have tried to use the snippet you shared. However, the code is not working on the player specific pages i.e. page which is showed to leader of the group only.

Write a reply

Set forum username