from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants from time import time class Timer(Page): form_model = 'player' form_fields = ['new_time_choice', 'new_time_choice_rounded'] def vars_for_template(self): self.player.time_choice = time() def before_next_page(self): self.player.time_choice = time() - self.player.time_choice self.player.time_choice_rounded = int(round(self.player.time_choice, 0)) page_sequence = [ Timer ]