from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class QuestionPage(Page): form_model = 'player' form_fields = ['answer'] template_name = 'quiz/Question.html' def answer_choices(self): return Constants.question_choices[self.round_number-1] def is_displayed(self): return True def vars_for_template(self): return { 'questiontext' : Constants.question_text[self.round_number - 1] } class FeedbackPage(Page): def is_displayed(self): return True template_name = 'quiz/Feedback.html' def vars_for_template(self): return { 'questiontext': Constants.question_text[self.round_number-1], 'explanationtext': Constants.explanation_text[self.round_number - 1], 'correct': Constants.correct_answers[self.round_number-1], 'is_correct': self.player.question_correct() } page_sequence = [ QuestionPage, FeedbackPage ]