from ._builtin import Page, WaitPage from .models import Constants class pretest(Page): pass class Info_Consent(Page): form_model = 'player' form_fields = ['consent'] def before_next_page(self): self.player.UserAgent = self.request.META.get('HTTP_USER_AGENT') class consent_out(Page): def is_displayed(self): return self.player.consent == 0 class mobile_end(Page): def is_displayed(self): user_agent = self.request.META['HTTP_USER_AGENT'] is_mobile = False for substring in ['Mobi', 'Android']: if substring in user_agent: is_mobile = True return is_mobile class Start_Questionnaire(Page): form_model = 'player' form_fields = ['sex', 'age', 'nationality'] class general_study_Instructions(Page): form_model = 'player' form_fields = ['P_ID'] class general_study_Instructions2(Page): pass class Introduction(Page): pass class Instructions(Page): pass class situation_description(Page): pass class situation_description_points(Page): pass class manipulation_check(Page): form_model = 'player' form_fields = ['m_check_1','m_check_2'] class manipulation_check_feedback(Page): pass class norm_elicitation(Page): form_model = 'player' form_fields = ['personalnorm_session_1'] class norm_real(Page): form_model = 'player' form_fields = ['personalnorm_session_1'] class Results(Page): form_model = 'player' form_fields = ['feedback'] class completion_site(Page): pass page_sequence = [ #mobile_end, #Info_Consent, #consent_out, #general_study_Instructions, #general_study_Instructions2, Start_Questionnaire, Introduction, situation_description_points, manipulation_check, manipulation_check_feedback, norm_elicitation, #Results, #completion_site #norm_real ]