How can be done trials in a task in diffrent proportion ?
Hi,
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?

Comments
Hi,
Add an inline_script before your loop and put this code in there (prepare phase):
Now the variable
var.trialswill have0s for all the repetitions and1s 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?
Eduard
Thank you very much for the response
But unfortunately, when I tried your solution, I got the "can't multiply sequence by non-int of type 'float'" error for the "var.trials = [0] * 0.6 * 20 + [1] * (1-0.6) * 20" line. I searched about this but ı couldn't understand the solutions suggested because the examples are not similar to mine and they are very complicated for me.
Hi,
my bad, replace
var.trials = [0] * 0.6 * 20 + [1] * (1-0.6) * 20withvar.trials = [0] * int(0.6 * 20) + [1] * int((1-0.6) * 20)Does that work?
Hi,


it works but I am sorry that I couldn't understand how it show switch ( changed response e.g. b to n) and non-switch (unchanged response e.g. b and again b) trials?
I tried to analyze the logic from the quickrun file, but I couldn't get it. Could you please help? Thank you
var.trialswill contain0s and1s in a certain proportion. When you present your stimuli, you have to do it contingent on the number in the list. Ifvar.trials[current_trial_number] == 0present a repeated stimulus, else, present a switched stimulus. The exact way to implement this. depends on your stimuli and your preference, there are multiple options.Does that make sense?
I am sorry it is a bit much for novices, but I am studying on hard. I believe I will achieve
Until that time I will enter stimuli manually and present sequentially. Thank you very much 