Howdy, Stranger!

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

Supported by

SART Script

edited November 18 in OpenSesame

Hi All! I was wondering if anyone could take a look at my script and tell me how I could fix this. I am trying to run an exact replication of SART (Sustained Attention to Response Task) through OpenSesame. I have created a file but I cannot figure out two things:

(1) I need the font size to display randomly within a block. There are 9 numbers and 5 fonts sizes. So, I need all of the font sizes except one to be displayed twice within a block. Right now I have a random.choice option running but this gives me a random number from my list every time and therefore doesn't constrain my list in any way.

(2) I cannot figure out how to randomly display my thought probes in this experiment. I need a thought probe to randomly display once within 45 trails in the ExperimentalLoop. I've tried many different ways to do this and am wondering if there is no way to do exactly what I need?

I am brand new to OpenSesame. I just started trying to do this a month ago and have no experience coding in Python. Any help would be so appreciated! This is also an open call for any existing SART OpenSesame scripts.


  • Hi,

    I need the font size to display randomly within a block.

    In an inline_script, create a list with all font sizes you want, randomize it, and then take them out one by one in a trial. import random

    . var.fontsizes = [1,2,3,4,5,1,2,3,4]
    # then in a trial (in a different inline_script)
    var.cur_fontsize = var.fontsizes[var.trial_no] # the variable var.trial_no is the current trial 
    #number and you have to define it yourself


    Basically, the same way, create a sequence of 44 zeros and one 1, randomize it, and define trial type based on that list (if 0, no probe, if 1 then probe).

    Does that make sense?


Sign In or Register to comment.