from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Introduction(Page): """Description of the game: How to play and returns expected""" pass class CognitiveReflectionTest(Page): form_model = 'player' form_fields = ['question1', 'question2', 'question3', 'question4', 'question5', 'question6', 'question7', 'question8' ] # def vars_for_template(self): # self.player.back = 0 # # def before_next_page(self): # print("ENTERS HERE") # if self.player.back == 1: # self._is_frozen = False # self._index_in_pages -= 2 # self.player.participant._index_in_pages -= 2 # def before_next_page(self): # print("ENTERS HERE") # if self.request.POST.get('back'): # if self.request.POST.get('back')[0] == '1': # print("ENTERS INSIDE") # self._is_frozen = False # self._index_in_pages -= 2 # self.participant._index_in_pages -= 2 def error_message(self, values): # print('values is', values) # error = " " l1 = [] if values["question1"] != 'Hayır her seansta farklı kişiler olacak': l1.append('\n - Question 1') if values["question2"] != 'Ortak projedeki birikimden pay alır': l1.append('\n- Question 2') if values["question3"] != 'Onun jetonları azalır': l1.append('\n- Question 3') if values["question4"] != 'Sizin jetonlarınız azalır': l1.append('\n - Question 4') if values["question5"] != 4: l1.append('\n- Question 5') if values["question6"] != 20: l1.append('\n- Question 6') if values["question7"] != 32: l1.append('\n- Question 7') if values["question8"] != 5: l1.append('\n- Question 8') # print('Errors is', l1) return '\n'.join(l1) page_sequence = [# if getplayer.check_error(): # page_sequence = [ # Introduction, # CognitiveReflectionTest, # Introduction # ] # else: # page_sequence = [ # Introduction, # CognitiveReflectionTest # ] Introduction, CognitiveReflectionTest ] # if getplayer.check_error(): # page_sequence = [ # Introduction, # CognitiveReflectionTest, # Introduction # ] # else: # page_sequence = [ # Introduction, # CognitiveReflectionTest # ]