from otree.api import * doc = """ Post-experiment survey: - Music feedback (only for music treatments) - Emotional state - Closing & payment info """ class C(BaseConstants): NAME_IN_URL = 'thesis_exp_post_survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # ---------- Post-Experiment Music Feedback ---------- # Shown only if session.config['treatment'] != 'no_music' music_familiar = models.StringField( label="Was the music playing in the background familiar to you?", choices=[ "Yes", "No", ], widget=widgets.RadioSelect, blank=True, ) music_like = models.StringField( label="Did you like the music?", choices=[ "Yes", "No", "Neutral", ], widget=widgets.RadioSelect, blank=True, ) music_help_disturb = models.StringField( label="Do you think the music helped or disturbed you during the experiment?", choices=[ "Helped", "Neutral", "Disturbed", ], widget=widgets.RadioSelect, blank=True, ) music_concentration = models.StringField( label="How much did the music affect your concentration?", choices=[ "Not at all", "Slightly", "Moderately", "Strongly", ], widget=widgets.RadioSelect, blank=True, ) music_decision = models.StringField( label="How much did the music affect your decision-making?", choices=[ "Not at all", "Slightly", "Moderately", "Strongly", ], widget=widgets.RadioSelect, blank=True, ) # ---------- Post-Experiment Emotional State ---------- feeling_now = models.IntegerField( label="How are you feeling right now?", choices=[ [1, "Very calm"], [2, "Slightly calm"], [3, "Neutral"], [4, "Slightly anxious"], [5, "Very anxious"], ], widget=widgets.RadioSelect, ) energy_now = models.IntegerField( label="How energized do you feel right now?", choices=[ [1, "Very low energy"], [2, "Slightly low energy"], [3, "Neutral"], [4, "Slightly high energy"], [5, "Very high energy"], ], widget=widgets.RadioSelect, ) mood_now = models.IntegerField( label="How would you describe your current mood?", choices=[ [1, "Very negative"], [2, "Slightly negative"], [3, "Neutral"], [4, "Slightly positive"], [5, "Very positive"], ], widget=widgets.RadioSelect, ) # Optional free-text feedback (you can remove if not needed) general_feedback = models.LongStringField( label="If you have any comments or feedback about the experiment, you can write them here (optional):", blank=True, ) # ============ PAGES ============ def current_treatment(player: Player) -> str: # Helper to read treatment, defaulting to 'no_music' if missing return player.session.config.get('treatment', 'no_music') class MusicFeedback(Page): form_model = 'player' form_fields = [ 'music_familiar', 'music_like', 'music_help_disturb', 'music_concentration', 'music_decision', ] @staticmethod def is_displayed(player: Player): # Only show for music treatments return current_treatment(player) != 'no_music' class EmotionSurvey(Page): form_model = 'player' form_fields = [ 'feeling_now', 'energy_now', 'mood_now', 'general_feedback', ] #class ClosingPage(Page): # @staticmethod # def vars_for_template(player: Player): # # You can adjust the text here later if lab procedures change # return dict( # payment_info_text=( # "Your payment will now be calculated based on your performance " # "in the investment game and the math task. " # "Please wait in the lab; within approximately 10–15 minutes " # "you will receive your cash payment before leaving." # ) # ) page_sequence = [ MusicFeedback, EmotionSurvey, # ClosingPage, ]