from otree.api import Currency as c, currency_range from . import models from ._builtin import Page, WaitPage from .models import Constants class Welcome(Page): pass class Demographics(Page): form_model = models.Player form_fields = ['Gender','Age','Country','Education','Employment'] class Instructions (Page): pass class Instructions_task1_observer (Page): pass class Instructions_task1_beliefs (Page): pass class CQ(Page): form_model = 'player' form_fields = ['Task1CQ1','Task1CQ2','Task1CQ3','Task1CQ4'] def error_message(self, values): print('values is', values) if values["Task1CQ1"] !=1 or values["Task1CQ2"] !=2 or values["Task1CQ3"] !=1 or values["Task1CQ4"] !=3: return 'There is at least one incorrect answer. Please, reconsider.' #class SomeUnderstandingQuestions(UnderstandingQuestionsPage): # page_title = 'Some Understanding Questions' #set_correct_answers = APPS_DEBUG # this is the default setting #set_correct_answers = True # do not fill out the correct answers in advance (this is for fast skipping through pages) # form_model = models.Player #questions = [ # { # 'question': 'The Green players __________ four three-digit numbers in every round of the task.', # 'options': ['added', 'subtracted', 'multiplied', 'divided'], # 'correct': 'added', # 'hint': 'This is wrong, please reconsider.' # }, # { # 'question': 'Is the probability of getting higher earnings for the Yellow player increasing in the amount of correct answers by his/her Green player?', # 'options': ['Yes', 'No','It depends'], # 'correct': 'Yes', # 'hint': 'This is wrong, please reconsider.' # }, # { # 'question': 'Does the Green player`s performance fully determine the Yellow player`s earnings?', # 'options': ['Yes', 'No','It depends'], # 'correct': 'No', # 'hint': 'This is wrong. Remember that the Green player`s performance determines the `wheel of fortune` that gets assigned to the Yellow player' # }, # { # 'question': 'Suppose the earnings of the Yellow player was $1. What is the most he/she can pay to the Green player?', # 'options': ['$0', '$1', '$2', 'anything'], # 'correct': '$2', # 'hint': 'This is wrong. The Yellow player has a separate amount of money from which to pay the Green player.' # }, #] class Instructions_task1_familiarize (Page): form_model = 'player' form_fields = ['PracticeRaven'] page_sequence = [ Welcome, Demographics, Instructions, Instructions_task1_observer, Instructions_task1_beliefs, CQ, Instructions_task1_familiarize ]