from otree.api import Currency as c, currency_range from . import models from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): # timeout_seconds = 600 def is_displayed(self): return self.round_number == 1 # def vars_for_template(self): # if self.round_number == 1: # self.player.shuffle_once() form_model = models.Player form_fields = ['comprehension_question_{}'.format(ii) for ii in range(1, 3)] def error_message(self, values): if values['comprehension_question_1'] != 'True' or values['comprehension_question_2'] != 'True': return 'One or more comprehension questions is incorrect, please either re-read instructions and try again' class SDO(Page): form_model = models.Player form_fields = ['test_question_{}'. format(ii) for ii in range(1, 3)] # form_fields = ['test_question_{}'. format(ii) for ii in range(1, 3)] class SDO1(Page): form_model = models.Player form_fields = ['test_question_1'] class SDO2(Page): form_model = models.Player form_fields = ['test_question_2'] class SDO3(Page): form_model = models.Player form_fields = ['test_question_3'] class SDO4(Page): form_model = models.Player form_fields = ['test_question_4'] class SDO5(Page): form_model = models.Player form_fields = ['test_question_5'] class SDO6(Page): form_model = models.Player form_fields = ['test_question_6'] class MyPage(Page): pass class ResultsWaitPage(WaitPage): def after_all_players_arrive(self): pass class Results(Page): pass page_sequence = [ Introduction, SDO1, SDO2, SDO3, SDO4, SDO5, SDO6 ]