from otree.api import * c = cu doc = '' class Constants(BaseConstants): name_in_url = 'pilot_v2_Chinese' players_per_group = None num_rounds = 1 rob_benefit = cu(5) rob_lost = cu(10) showup_fee = cu(5) finish_button_template = 'pilot_v2_Chinese/finish_button.html' group_attachment_slider_template = 'pilot_v2_Chinese/group_attachment_slider.html' group_attach_slider_chinese_template = 'pilot_v2_Chinese/group_attach_slider_chinese.html' group_attach_slider_foreign_template = 'pilot_v2_Chinese/group_attach_slider_foreign.html' flag_right_top_template = 'pilot_v2_Chinese/flag_right_top.html' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): birthday_china = models.BooleanField(choices=[[True, '单数'], [False, '双数']], label='您生日的末位数字是单数还是双数', widget=widgets.RadioSelectHorizontal) identification = models.FloatField() overlap = models.FloatField() attachment_china = models.BooleanField() view1 = models.IntegerField(choices=[[1, '1 - 完全不同意'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6 - 完全同意']], label='CN2应该销毁B2的筹码') view2 = models.IntegerField(choices=[[1, '1 - 完全不同意'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6 - 完全同意']], label='CN1知道CN2销毁了B2的筹码后会觉得好受') view3 = models.IntegerField(choices=[[1, '1 - 完全不同意'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6 - 完全同意']], label='CN3知道CN2销毁了B2的筹码后会觉得好受') view4 = models.IntegerField(choices=[[1, '1 - 完全不同意'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6 - 完全同意']], label='当CN1和CN3知道CN2销毁了B2的筹码后,他们眼中CN2的声誉会提高') hypothetical_VR = models.IntegerField(max=150, min=0) class Instruction(Page): form_model = 'player' @staticmethod def before_next_page(player, timeout_happened): pass class Birthday(Page): form_model = 'player' form_fields = ['birthday_china'] @staticmethod def before_next_page(player, timeout_happened): player.attachment_china = player.birthday_china class Flag(Page): form_model = 'player' class Group_attachment(Page): form_model = 'player' form_fields = ['identification', 'overlap'] class View_towards_VR(Page): form_model = 'player' form_fields = ['view1', 'view2', 'view3', 'view4', 'hypothetical_VR'] @staticmethod def before_next_page(player, timeout_happened): participant = player.participant participant.payoff = Constants.showup_fee page_sequence = [Instruction, Birthday, Flag, Group_attachment, View_towards_VR]