Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Creating a Mind Wandering/Breath Counting Task

Hello!

Below is pseudo-code for an experiment I'm trying to create in OpenSesame. I lack the background in python and OpenSesame to convert the pseudo-code to proper code. I'm hoping you all can help me!

The experiment is fairly straight forward (conceptually). A blank screen is presented while participants monitor their breath. They silently count each breath to themselves, from 1-9, and then returning back to 1, and on and on. For breaths 1-8, they press the LEFT key at the end of each exhalation. At the end of breath 9, they press the RIGHT key. Every 60-120 seconds, a series of 3 questions pops up asking them where their attention was, how aware they were of where their attention was and what their breath count was. They then resume counting their breath.

# Experiment
import random

var.past_probe_time 0 # initializing probe clock
Begin clock # Begin experiment
while  clock <= 1080000: # Duration of experiment

    var.breath_count 0 # initialize breath_count
    while True:
        Present blank screen

        # At the end of every exhalation, the participant presses a button
        Record response

        # Participant is to press the left key after exhalations 1-8, and the right key after exhalation 9; looping         
        # continuously throughout the experiment
        if var.breath_count != 9:
                var.correct_response = 'left'
        elif var.breath_count == 9:
                var.correct_response = 'right'

        if clock = past_probe_time + randomint(60000,120000):
            break

    present MC form w/question “just now where was your attention? (completely on-task/off-task)” [2-6 scale]
    Record response
    present MC form w/question “how aware were you of where your attention was? (completely aware/unaware).”    [2-6    scale]
    present MC form asking participants for breath count [1-9 scale]
        If response = var.breath_count
                correct
        Elif response !=var.breath_count
                incorrect

    print: Please resume counting with your first breath.

Comments

Sign In or Register to comment.