from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class starting_page(Page): pass class voucher_instructions(Page): pass class quiz(Page): form_model = 'player' form_fields = ['quiz1', 'quiz2'] def error_message(self, values): if values["quiz1"] is None or values["quiz2"] is None: return "Please answer all the questions before proceed." elif values["quiz1"] != Constants.quiz1ans or values["quiz2"] != Constants.quiz2ans: return "You did not answer all the questions correctly. Please try again." def before_next_page(self): self.player.set_payoff() class ACTION_after_quiz_wait(Page): pass page_sequence = [ starting_page, voucher_instructions, quiz, #ACTION_after_quiz_wait, ]