from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): pass class Questionnaire(Page): form_model = 'player' form_fields = ['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7'] def error_message(self, values): if values['q1'] != 2: self.player.Errors += 1 return 'The answer to question n. 1 is wrong' if values['q2'] != 2: self.player.Errors += 1 return 'The answer to question n. 2 is wrong' if values['q3'] != 3: self.player.Errors += 1 return 'The answer to question n. 3 is wrong' if values['q4'] != 12: self.player.Errors += 1 return 'The answer to question n. 4 is wrong' if values['q5'] != 11: self.player.Errors += 1 return 'The answer to question n. 5 is wrong' if values['q6'] != 1: self.player.Errors += 1 return 'The answer to question n. 6 is wrong' if values['q7'] != 2: self.player.Errors += 1 return 'The answer to question n. 7 is wrong' class Game_Introduction1(Page): pass class Example(Page): pass class Campaign_Strategy_Phase(Page): pass class Voting_Phase(Page): pass class demo(Page): pass page_sequence = [ Introduction,Game_Introduction1, Example, Campaign_Strategy_Phase, Voting_Phase, Questionnaire]