from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer ) import csv author = 'Eveline Vandewal' doc = """ Theory of Mind """ class Constants(BaseConstants): name_in_url = 'CTBS2_Part3' players_per_group = None with open('CTBS2_Part3/problems.csv') as problems_file: problems = list(csv.DictReader(problems_file)) num_rounds = 12 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): problem_id = models.IntegerField() problem = models.StringField() word1 = models.StringField() word2 = models.StringField() word3 = models.StringField() word4 = models.StringField() randomized_order = models.IntegerField() practice_submitted_choice = models.IntegerField( choices=[ [1, 'Word 1'], [2, 'Word 2'], [3, 'Word 3'], [4, 'Word 4'] ], widget=widgets.RadioSelect ) submitted_choice = models.IntegerField( choices=[ [1, 'Word 1'], [2, 'Word 2'], [3, 'Word 3'], [4, 'Word 4'] ], widget=widgets.RadioSelect ) submitted_time = models.FloatField() submitted_confidence = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) def current_problem(self): return self.participant.vars['randomized_problems3'][self.round_number - 1]