|
Post by lauramai on Sept 10, 2019 12:47:17 GMT
I am presenting my trials in a random order using all_before_repeat. My problem is that I want to give the participants a break every 20 trials or so, but don't want to make many separate blocks (and tables) with 20 stimuli rows in each and then show them sequentially. I read that "If you have fixed in consecutive blocks, but use the same task and table, you will continue at the table row where you had left" in the documentation. But I couldn't find any information about how to do this same thing, i.e. picking up where you left off within the table after showing a break screen, with "all_before_repeat" instead of "fixed". Have I missed something? I feel that making many separate blocks, and having to specify which subset of stimuli appear in each block and the order of the blocks, is restricting the random trial selection quite a lot which I don't want to do. Any advice would be greatly appreciated.
|
|
|
Post by PsyToolkit on Sept 10, 2019 20:33:51 GMT
That is a good question. There are 2 ways to do this. Personally, I would create multiple blocks. In fact, with "blockorder", you can have the same block repeating multiple times, below I give a quick example with a useless example task, just to keep it short (see also: blockorder documentationbitmaps some_instructions
task mytask keys z m show rectangle 0 0 20 20 255 255 0 readkey 1 2000 clear -1 delay 1000
block myblock message some_instructions tasklist mytask 10 end
blockorder myblock myblock myblock myblock
myblock
Note that the "fixed" order just picks up the table where you left it (that is a handy feature and solves your problem). In this example there is no table, though.
There is another way of doing it. For this, you need to keep track of the trial number in your task (I created the variable &my_trial_counter and it gets increased by one each trial), but you can do it. So in some ways it looks a bit more complicated, but it works just ask well. Note that the "&" in front of the variable name means it is a "global" variable, one that does not get reset to 0 at beginning/end of task, but instead keeps its value and you can increase it etc (usually, global variables are more easy to use). Anyway, if the value is 20, we show a little text asking people to take a break and to continue with a key press when ready to go on. The maximum key wait here is 999999, which is quite a long (for conversion check: www.google.com/search?client=firefox-b-d&q=999999+ms+in+minutes). Every break we reset the trial counter back to zero and then it goes on and after another 20 trials you will have another break! Easy solution. PsyToolkit is fairly flexible with these sort of things.
bitmaps some_instructions
fonts arial 20
task mytask keys z m space
set &my_trial_counter increase
show rectangle 0 0 20 20 255 255 0 readkey 1 2000 clear -1 delay 1000 if &my_trial_counter == 20 show text "Take a break and press space when you are ready" readkey 3 999999 clear -1
set &my_trial_counter = 0
fi
block myblock message some_instructions tasklist mytask 200 end
|
|
|
Post by lauramai on Sept 12, 2019 11:04:37 GMT
thanks for your helpful reply. There is something I am not clear about with Option 1 that you present; I understand that if you use the "fixed" order, it picks up on the next row of the table where I left it, across repetitions of "myblock". However, I am using a "all_before_repeat" term as I need the different rows of the table to be presented in a random order. SO if I present multiple times the same short block (listed in blockorder), will it also pick up where I left off in the table and continue its random all_before_repeat pattern? I thought it would not?
I tried option 2, which I understand more, however I am getting the error "set_variable_syntax in line: 205 >>>set &my_trial_counter = 0". Does the global variable need to be set at some starting value at the start of the experiment, outside of the task?
Many thanks!
|
|
|
Post by lauramai on Sept 16, 2019 10:08:27 GMT
I think I solved the second part of my question, it should be "set &my_trial_counter 0" and not "set &my_trial_counter = 0" as previously written. I should have read through the documentation more carefully!
|
|