Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

How can be done trials in a task in diffrent proportion ?

I'm trying to create a task switching task (Number-letter task) which has to include switch and non-switch trials. In the task switch trials should be %40 and non-switch should be %60.
I just wrote stimuli on the loop item, and create the list with the "full-factorial design " function. Then I wrote [letter][number] the stimuli sketchpad item to provide display stimuli side by side.

But I need help about how can be control switch and non-switch trials proportion. Could you please help me?

image.png 201.9K


  • eduardeduard Posts: 1,043


    Add an inline_script before your loop and put this code in there (prepare phase):

    import random no_trials = 20 ratio_rep = 0.6 # how many repetition trials are in a block # make sure that the ratio can be reproduced with the number of trials var.trials = [0]*0.6*20 + [1]*(1-0.6)*20 random.shuffle(var.trials)

    Now the variable var.trials will have 0s for all the repetitions and 1s for all switches. In your experiment you just have to access every item in that list one after another, so that you get the correct type per trial.

    Does that help?


Sign In or Register to comment.