from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Begin(Page): form_model = 'player' class Instruction(Page): form_model = 'player' form_fields = ['Quiz1', 'Quiz2', 'Quiz3', 'Quiz4', 'Quiz5', 'Quiz1_2'] def error_message(self, values): pass if values['Quiz1'] != 'A' or values['Quiz2'] != 'C' or values['Quiz3'] != 'D' or values['Quiz4'] != 'E' or values['Quiz5'] != 'B': return '您的问题有误,请重新仔细阅读实验说明' if values['Quiz1_2'] != self.player.id_in_group: return '您的问题有误,请重新仔细阅读实验说明' class Choice1(Page): form_model = 'player' form_fields = ['First_choice', 'Second_choice', 'Third_choice', 'Fourth_choice', 'Fifth_choice'] def error_message(self, values): pass if values['First_choice'] == values['Second_choice']: return '您的选项有重复,请重新选择' if values['First_choice'] == values['Third_choice']: return '您的选项有重复,请重新选择' if values['First_choice'] == values['Fourth_choice']: return '您的选项有重复,请重新选择' if values['First_choice'] == values['Fifth_choice']: return '您的选项有重复,请重新选择' if values['Second_choice'] == values['Third_choice']: return '您的选项有重复,请重新选择' if values['Second_choice'] == values['Fourth_choice']: return '您的选项有重复,请重新选择' if values['Second_choice'] == values['Fifth_choice']: return '您的选项有重复,请重新选择' if values['Third_choice'] == values['Fourth_choice']: return '您的选项有重复,请重新选择' if values['Third_choice'] == values['Fifth_choice']: return '您的选项有重复,请重新选择' if values['Fourth_choice'] == values['Fifth_choice']: return '您的选项有重复,请重新选择' class MyWaitPage1(WaitPage): after_all_players_arrive = 'Results1' class Guess(Page): form_model = 'player' form_fields = ['First_guess', 'Second_guess', 'Third_guess', 'Fourth_guess'] class MyWaitPage2(WaitPage): after_all_players_arrive = 'Payoff1' class Choice2(Page): form_model = 'player' form_fields = ['First_choice2', 'Second_choice2', 'Third_choice2', 'Fourth_choice2', 'Fifth_choice2'] def error_message(self, values): pass if values['First_choice2'] == values['Second_choice2']: return '您的选项有重复,请重新选择' if values['First_choice2'] == values['Third_choice2']: return '您的选项有重复,请重新选择' if values['First_choice2'] == values['Fourth_choice2']: return '您的选项有重复,请重新选择' if values['First_choice2'] == values['Fifth_choice2']: return '您的选项有重复,请重新选择' if values['Second_choice2'] == values['Third_choice2']: return '您的选项有重复,请重新选择' if values['Second_choice2'] == values['Fourth_choice2']: return '您的选项有重复,请重新选择' if values['Second_choice2'] == values['Fifth_choice2']: return '您的选项有重复,请重新选择' if values['Third_choice2'] == values['Fourth_choice2']: return '您的选项有重复,请重新选择' if values['Third_choice2'] == values['Fifth_choice2']: return '您的选项有重复,请重新选择' if values['Fourth_choice2'] == values['Fifth_choice2']: return '您的选项有重复,请重新选择' class MyWaitPage3(WaitPage): after_all_players_arrive = 'Results2' class Guess2(Page): form_model = 'player' form_fields = ['First_guess2', 'Second_guess2', 'Third_guess2', 'Fourth_guess2'] class MyWaitPage4(WaitPage): after_all_players_arrive = 'Payoff2' class Q11_20(Page): form_model = 'player' form_fields = ['q11_20'] class MyWaitPage5(WaitPage): after_all_players_arrive = 'Q11_20' class Beauty_con(Page): form_model = 'player' form_fields = ['guess'] class MyWaitPage6(WaitPage): after_all_players_arrive = 'Beauty_con' class EGrisk(Page): form_model = 'player' form_fields = ['EGrisk'] class MyWaitPage(WaitPage): after_all_players_arrive = 'EG_risk' class MyWaitPage7(WaitPage): after_all_players_arrive = 'Set_payoff' class Results(Page): form_model = 'player' class Survey(Page): form_model = 'player' form_fields = ['ID_e', 'Age', 'Female', 'Grade', 'Major', 'Province', 'CRT1', 'CRT2', 'CRT3'] page_sequence = [Begin, Instruction, Choice1, MyWaitPage1, Guess, MyWaitPage2, Choice2, MyWaitPage3, Guess2, MyWaitPage4, Q11_20, MyWaitPage5, Beauty_con, MyWaitPage6, EGrisk, MyWaitPage, MyWaitPage7, Results, Survey]