import sys sys.path.append("improv_rate") from scripts import * from feedback import * from stories import * from otree.api import * import random random.seed(10) import time class C(BaseConstants): NAME_IN_URL = 'improv_rate' PLAYERS_PER_GROUP = 1 NUM_ROUNDS = 25 SCRIPTS = get_scripts() STORY1_OPENING = get_story1_opening() STORY2_OPENING = get_story2_opening() STORY3_OPENING = get_story3_opening() STORY4_OPENING = get_story4_opening() class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): [o1, o2, o3, o4] = feedback_survey_overall() class Consent(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return (player.round_number == 1) class Instr0(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return (player.round_number == 1) class Feedback(Page): form_model = 'player' form_fields = ['o1', 'o2', 'o3', 'o4'] @staticmethod def vars_for_template(player): messages = C.SCRIPTS[player.participant.id_in_session % 7][player.round_number] return dict( story = messages['story'], ) class EndPage(Page): form_model = 'player' @staticmethod def is_displayed(player: Player): return player.round_number == 25 page_sequence = [ Consent, \ Instr0, \ Feedback, \ EndPage, \ ]