from otree.api import Currency as c, currency_range from ._builtin import Page from .models import Constants import time class MyPage1(Page): form_model = 'player' form_fields = ['question1', 'question2', 'question3', 'question4', 'question5', 'question6'] class MyPage2(Page): def vars_for_template(self): self.participant.vars['time_started'] = time.time() return dict(link="https://www.youtube.com/embed/{}".format(self.player.weblink) ) class MyPage3(Page): def vars_for_template(self): self.player.total_seconds = time.time() - self.participant.vars['time_started'] form_model = 'player' form_fields = ['question1_1', 'question2_1', 'question3_1', 'question4_1', 'question5_1', 'question6_1'] class Results(Page): def vars_for_template(self): self.player.total_seconds = time.time() - self.participant.vars['time_started'] page_sequence = [MyPage1, MyPage2, MyPage3, Results]