from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from . import models from .models import Constants import random import itertools import numpy as np from sklearn.utils import shuffle class Introduction(Page): # timeout_seconds = 600 def is_displayed(self): return self.round_number == 1 form_model = models.Player form_fields = ['test_question_{}'.format(ii) for ii in range(1, 5)] def error_message(self, values): if values['test_question_1'] != 20 or values['test_question_2'] != 20 or values[ 'test_question_3'] != 20 or values['test_question_4'] != 39: return 'One or more test questions is incorrect, please either re-read instructions and try again' class Offer(Page): form_model = models.Player form_fields = ['amount_returned'] page_sequence = [ Introduction, Offer # Results # Final ]