from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Jakob Moeller' doc = """ Intro instructions. """ class Constants(BaseConstants): name_in_url = 'intro' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): prolific_id = models.CharField( initial='', label='Please enter your Prolific ID:' ) control_question = models.IntegerField(min=0, max=15, label='') control_trys = models.IntegerField(initial=1) reCaptcha = models.CharField() def set_error_message(self, value): v = list(value.items())[0][1] print('Player submitted:', v) text = "That's not the number of cells with 1. Note: cells with the number 11 or 10 do not count." if v != 6: self.control_trys += 1 return text