from otree.api import * import random import csv author = 'Lingguo Xu' doc = """ Instruction for the test for Part 1 Task Prolific pilot """ class Constants(BaseConstants): name_in_url = 'Part1-Instruction' players_per_group = None payment_per_correct_answer = 1 score_per_correct_answer = 1 num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): consent = models.IntegerField(label="", choices=[[1, 'I agree'], [0, 'I do not agree']], widget=widgets.RadioSelect ) practice1 = models.StringField(label="Please fill in a single lower-case letter:") #def practice1_error_message(player, value): #print('You typed in', value) #if value not in ["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]: #return 'This is not a valid answer.' practice2 = models.StringField(label="Please fill in a single lower-case letter:") #def practice2_error_message(player, value): #print('You typed in', value) #if value not in ["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]: #return 'This is not a valid answer.' practice3 = models.StringField(label="Please fill in a single lower-case letter:") #def practice3_error_message(player, value): #print('You typed in', value) #if value not in ["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]: #return 'This is not a valid answer.' # FUNCTIONS # PAGES class PLS_Consent(Page): form_model = 'player' form_fields = ['consent'] class Noconsent(Page): def is_displayed(player): return player.consent == 0 class Overview(Page): pass class Instruction1(Page): pass class Instruction2_1(Page): form_model = 'player' form_fields = ['practice1'] class Instruction2_2(Page): pass class Instruction2_3(Page): form_model = 'player' form_fields = ['practice2'] class Instruction2_4(Page): pass class Instruction2_5(Page): form_model = 'player' form_fields = ['practice3'] class Instruction2_6(Page): pass class Instruction3(Page): pass #page_sequence = [Overview] page_sequence = [PLS_Consent, Noconsent, Overview, Instruction1, Instruction2_1, Instruction2_2, Instruction2_3, Instruction2_4, Instruction2_5, Instruction2_6]