from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'auction' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): highest_bidder = models.StringField() highest_bid = models.CurrencyField(initial=0) current_bid = models.FloatField() def live_auction(self, id_in_group, var1): # There has to be three arguments # first is self, second is id_in_group, third is the variable that is live send self.current_bid = var1 if var1 > self.highest_bid: self.highest_bid = var1 self.highest_bidder = "me" response = dict(first=self.highest_bidder, second=var1, third = self.current_bid) # response is the value that is send back to the page # one the page it is recorder as data.something return {0: response} class Player(BasePlayer): pass