import random from ._builtin import Page, WaitPage from .models import Constants class Label(Page): form_model = 'player' form_fields = ['p_label'] class Instructions(Page): form_model = 'player' form_fields = ['email'] def before_next_page(self): self.participant.payoff += Constants.PointsImport_dict.get(self.player.email) self.participant.label = self.player.p_label class WTP_Instructions(Page): def before_next_page(self): self.participant.vars['lottery_no_meat'] = 0 class WTP_Instructions2(Page): form_model = 'player' form_fields = ['WTP_i1', 'WTP_i2', 'WTP_i3', 'WTP_i4', 'WTP_i5'] page_sequence = [Label, Instructions, WTP_Instructions, WTP_Instructions2]