from . import models from ._builtin import Page, WaitPage from .models import Constants class Situation(Page): form_model = 'player' def vars_for_template(self): return { 'f_news': self.player.participant.vars['f_news']} def is_displayed(self): return ( self.round_number == 1 ) class Question(Page): form_model = 'player' def vars_for_template(self): return { 'f_news': self.player.participant.vars['f_news']} class QuestionA(Question): form_fields = ["Act3", "Act4"] def before_next_page(self): self.player.participant.vars['response1'] = self.player.Act1, self.player.participant.vars['response2'] = self.player.Act2 class QuestionB(Question): form_fields = ["Act1", "Act2"] def before_next_page(self): self.player.participant.vars['response3'] = self.player.Act3, self.player.participant.vars['response4'] = self.player.Act4, self.player.participant.vars['response5'] = self.player.Act5, # class QuestionC(Question): form_fields = ["Act5", "Act6", "Act7", "Act8"] template_name = 'NormElicitation/QuestionC.html' def before_next_page(self): self.player.participant.vars['response6'] = self.player.Act6, self.player.participant.vars['response7'] = self.player.Act7, self.player.participant.vars['response6'] = self.player.Act8, self.player.participant.vars['response6'] = self.player.Act9, class QuestionD(Question): form_fields = ["Act9", "Act10"] def before_next_page(self): self.player.participant.vars['response10'] = self.player.Act10, # self.player.participant.vars['response11'] = self.player.Act11, def app_after_this_page(self, upcoming_apps): if not self.player.participant.vars['f_news']: return upcoming_apps[1] page_sequence = [ Situation, QuestionA, QuestionB, QuestionC, QuestionD, ]