from otree.api import ( models, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, ) author = 'Nischal Poudel' doc = """ This app presents the instruction to participants and then tests their understanding. """ class Constants(BaseConstants): name_in_url = 'comprehension' players_per_group = None num_rounds = 1 instructions_template = 'comprehension/instructions.html' endowment = c(50) multiplier = 2 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): test_question_1 = models.IntegerField( label=''' If you read the instructions correctly, answer 1 ''' ) test_question_2 = models.IntegerField( label=''' If you read the instructions correctly, answer 2 ''' ) test_question_3 = models.IntegerField( label=''' If you read the instructions correctly, answer 3 ''' ) test_question_4 = models.IntegerField( label=''' If you read the instructions correctly, answer 4 ''' ) all_test_passed = models.BooleanField(initial=False) def check_answers(self): self.all_test_passed = self.test_question_1 == 1 and self.test_question_2 == 2 and \ self.test_question_3 == 3 and self.test_question_4 == 4