from otree.api import * import time doc = """ Post-task questionnaire + Debrief """ class Constants(BaseConstants): name_in_url = 'debrief' players_per_group = None num_rounds = 1 # Set your Prolific completion code (optional) PROLIFIC_CODE = 'C1PR56I4' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # ----------------------------- # Post-task questionnaire items # 7-point Likert: 1 (low) ... 7 (high) # ----------------------------- task_difficulty = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How difficult did you find the task overall?", widget=widgets.RadioSelectHorizontal ) coord_effort = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How easy was it to coordinate with your partner?", widget=widgets.RadioSelectHorizontal ) metronome_help = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="Did the metronome help you coordinate?", widget=widgets.RadioSelectHorizontal ) video_help = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="Did the video call help you coordinate?", widget=widgets.RadioSelectHorizontal ) partner_like = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How much did you like your partner?", widget=widgets.RadioSelectHorizontal ) estimate_confidence = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How confident were you in your estimates during the individual phase", widget=widgets.RadioSelectHorizontal ) leadership_discussion = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="To what extent did you lead with respect to choosing which fruit to select?", widget=widgets.RadioSelectHorizontal ) difficulty_discussion = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How difficult was it to jointly decide which fruit to select?", widget=widgets.RadioSelectHorizontal ) video_smoothness = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How well did the video work (1 = didn't work/couldnt see partner; 7 = no issues)?", widget=widgets.RadioSelectHorizontal ) audio_smoothness = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], label="How well did the audio work (1 = didn't work/couldnt hear partner; 7 = no issues)?", widget=widgets.RadioSelectHorizontal ) # Page timing (seconds) for the questionnaire posttask_rt = models.FloatField(blank=True) # ----------------------------- # PAGES # ----------------------------- class PostTaskQuestions(Page): form_model = 'player' form_fields = [ 'task_difficulty', 'coord_effort', 'metronome_help', 'video_help', 'partner_like', 'estimate_confidence', 'leadership_discussion', 'difficulty_discussion', 'video_smoothness', 'audio_smoothness' ] timeout_seconds = 300 # optional @staticmethod def is_displayed(player: Player): # show only if they reached at least round 6 of pacman return player.participant.vars.get("enough_rounds", 0) == True @staticmethod def vars_for_template(player: Player): player.participant.vars['posttask_start'] = time.time() return {} @staticmethod def before_next_page(player: Player, timeout_happened): start = player.participant.vars.get('posttask_start') if start: player.posttask_rt = time.time() - start class DebriefPage(Page): @staticmethod def vars_for_template(player): return dict( audio_gate_failed=bool(player.participant.vars.get("audio_gate_failed", False)), failed_comprehension=bool(player.participant.vars.get("failed_comprehension", False)), code_complete="C1PR56I4", code_audio_fail="CD8SU8D6", ) page_sequence = [ PostTaskQuestions, DebriefPage, ]