Millisecond Forums

Randomizing presentation of groups of blocks

https://forums.millisecond.com/Topic30785.aspx

By mindwanderingjeremy - 2/10/2021

Hi again! 

I am having trouble with my n-back task code again. It is nearly complete but I am attempting to randomise the presentation of my survey pages which is proving difficult.
The way I have attempted to do this is I have created a <survey thoughtprobes> function which presents each of the survey pages in a random order. However, I need this survey page to be shown after every one of my experimental blocks. To do this I need to be able to randomly select groups of block1 + survey.thoughtprobes, block 2 + survey.thoughprobes, block3 + survey.thoughtprobes, etc in my <experiment> function. Is there an easy way to do this?

So far I have attempted to use a method I found on a 10 year old thread in this forum which uses lists to achieve this like so:
<list blockselector>
/items = (list.q0b1, list.q0b2, list.q0b3, list.m0b1, list.m0b2, list.m0b3, list.l0b1, list.l0b2, list.l0b3,
list.q1b1, list.q1b2, list.q1b3, list.m1b1, list.m1b2, list.m1b3, list.l1b1, list.l1b2, list.l1b3,)
/selectionmode = random
/replace = false
</list>
<list q0b1>
/items = (block.quick0back1, survey.thoughtprobe)
/selectionmode = sequence
</list>
*** multiple lists for each block type ***
<expt>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [1-2 = list.blockselector; 3-4 = list.blockselector; 5-6 = list.blockselector; 7-8 = list.blockselector; 9-10 = list.blockselector;
11-12 = list.blockselector; 13-14 = list.blockselector; 15-16 = list.blockselector; 17-18 = list.blockselector; 19-20 = list.blockselector;
21-22 = list.blockselector; 23-24 = list.blockselector; 25-26 = list.blockselector; 27-28 = list.blockselector; 29-30 = list.blockselector;
31-32 = list.blockselector; 33-34 = list.blockselector; 35-36 = list.blockselector]
/onexptend = [values.completed = 1]
</expt>

However this does not work. Any ideas on how I can randomly present blocks with the survey at the end?
I have included my code and stimuli below if you would like to look at the whole thing.
Thank you!
By Dave - 2/11/2021

mindwanderingjeremy - 2/11/2021
Hi again! 

I am having trouble with my n-back task code again. It is nearly complete but I am attempting to randomise the presentation of my survey pages which is proving difficult.
The way I have attempted to do this is I have created a <survey thoughtprobes> function which presents each of the survey pages in a random order. However, I need this survey page to be shown after every one of my experimental blocks. To do this I need to be able to randomly select groups of block1 + survey.thoughtprobes, block 2 + survey.thoughprobes, block3 + survey.thoughtprobes, etc in my <experiment> function. Is there an easy way to do this?

So far I have attempted to use a method I found on a 10 year old thread in this forum which uses lists to achieve this like so:
<list blockselector>
/items = (list.q0b1, list.q0b2, list.q0b3, list.m0b1, list.m0b2, list.m0b3, list.l0b1, list.l0b2, list.l0b3,
list.q1b1, list.q1b2, list.q1b3, list.m1b1, list.m1b2, list.m1b3, list.l1b1, list.l1b2, list.l1b3,)
/selectionmode = random
/replace = false
</list>
<list q0b1>
/items = (block.quick0back1, survey.thoughtprobe)
/selectionmode = sequence
</list>
*** multiple lists for each block type ***
<expt>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [1-2 = list.blockselector; 3-4 = list.blockselector; 5-6 = list.blockselector; 7-8 = list.blockselector; 9-10 = list.blockselector;
11-12 = list.blockselector; 13-14 = list.blockselector; 15-16 = list.blockselector; 17-18 = list.blockselector; 19-20 = list.blockselector;
21-22 = list.blockselector; 23-24 = list.blockselector; 25-26 = list.blockselector; 27-28 = list.blockselector; 29-30 = list.blockselector;
31-32 = list.blockselector; 33-34 = list.blockselector; 35-36 = list.blockselector]
/onexptend = [values.completed = 1]
</expt>

However this does not work. Any ideas on how I can randomly present blocks with the survey at the end?
I have included my code and stimuli below if you would like to look at the whole thing.
Thank you!

Why don't you just /branch to the survey block from each of the nback blocks? That is:

Sample your nback blocks randomly at the <expt> level per

<expt>
...
/ blocks = [1-18 = noreplace(quick0back1, ...)]
...
</expt>

and in each nback block have

<block quick0back1>
...
/ branch = [survey.thoughtprobe]
</block>
By mindwanderingjeremy - 2/11/2021

Dave - 2/11/2021
mindwanderingjeremy - 2/11/2021
Hi again! 

I am having trouble with my n-back task code again. It is nearly complete but I am attempting to randomise the presentation of my survey pages which is proving difficult.
The way I have attempted to do this is I have created a <survey thoughtprobes> function which presents each of the survey pages in a random order. However, I need this survey page to be shown after every one of my experimental blocks. To do this I need to be able to randomly select groups of block1 + survey.thoughtprobes, block 2 + survey.thoughprobes, block3 + survey.thoughtprobes, etc in my <experiment> function. Is there an easy way to do this?

So far I have attempted to use a method I found on a 10 year old thread in this forum which uses lists to achieve this like so:
<list blockselector>
/items = (list.q0b1, list.q0b2, list.q0b3, list.m0b1, list.m0b2, list.m0b3, list.l0b1, list.l0b2, list.l0b3,
list.q1b1, list.q1b2, list.q1b3, list.m1b1, list.m1b2, list.m1b3, list.l1b1, list.l1b2, list.l1b3,)
/selectionmode = random
/replace = false
</list>
<list q0b1>
/items = (block.quick0back1, survey.thoughtprobe)
/selectionmode = sequence
</list>
*** multiple lists for each block type ***
<expt>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [1-2 = list.blockselector; 3-4 = list.blockselector; 5-6 = list.blockselector; 7-8 = list.blockselector; 9-10 = list.blockselector;
11-12 = list.blockselector; 13-14 = list.blockselector; 15-16 = list.blockselector; 17-18 = list.blockselector; 19-20 = list.blockselector;
21-22 = list.blockselector; 23-24 = list.blockselector; 25-26 = list.blockselector; 27-28 = list.blockselector; 29-30 = list.blockselector;
31-32 = list.blockselector; 33-34 = list.blockselector; 35-36 = list.blockselector]
/onexptend = [values.completed = 1]
</expt>

However this does not work. Any ideas on how I can randomly present blocks with the survey at the end?
I have included my code and stimuli below if you would like to look at the whole thing.
Thank you!

Why don't you just /branch to the survey block from each of the nback blocks? That is:

Sample your nback blocks randomly at the <expt> level per

<expt>
...
/ blocks = [1-18 = noreplace(quick0back1, ...)]
...
</expt>

and in each nback block have

<block quick0back1>
...
/ branch = [survey.thoughtprobe]
</block>

I tried doing this but it doesnt work for some reason. It just goes past skips the thought probes and goes to the next block. 
By mindwanderingjeremy - 2/11/2021

mindwanderingjeremy - 2/11/2021
Dave - 2/11/2021
mindwanderingjeremy - 2/11/2021
Hi again! 

I am having trouble with my n-back task code again. It is nearly complete but I am attempting to randomise the presentation of my survey pages which is proving difficult.
The way I have attempted to do this is I have created a <survey thoughtprobes> function which presents each of the survey pages in a random order. However, I need this survey page to be shown after every one of my experimental blocks. To do this I need to be able to randomly select groups of block1 + survey.thoughtprobes, block 2 + survey.thoughprobes, block3 + survey.thoughtprobes, etc in my <experiment> function. Is there an easy way to do this?

So far I have attempted to use a method I found on a 10 year old thread in this forum which uses lists to achieve this like so:
<list blockselector>
/items = (list.q0b1, list.q0b2, list.q0b3, list.m0b1, list.m0b2, list.m0b3, list.l0b1, list.l0b2, list.l0b3,
list.q1b1, list.q1b2, list.q1b3, list.m1b1, list.m1b2, list.m1b3, list.l1b1, list.l1b2, list.l1b3,)
/selectionmode = random
/replace = false
</list>
<list q0b1>
/items = (block.quick0back1, survey.thoughtprobe)
/selectionmode = sequence
</list>
*** multiple lists for each block type ***
<expt>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [1-2 = list.blockselector; 3-4 = list.blockselector; 5-6 = list.blockselector; 7-8 = list.blockselector; 9-10 = list.blockselector;
11-12 = list.blockselector; 13-14 = list.blockselector; 15-16 = list.blockselector; 17-18 = list.blockselector; 19-20 = list.blockselector;
21-22 = list.blockselector; 23-24 = list.blockselector; 25-26 = list.blockselector; 27-28 = list.blockselector; 29-30 = list.blockselector;
31-32 = list.blockselector; 33-34 = list.blockselector; 35-36 = list.blockselector]
/onexptend = [values.completed = 1]
</expt>

However this does not work. Any ideas on how I can randomly present blocks with the survey at the end?
I have included my code and stimuli below if you would like to look at the whole thing.
Thank you!

Why don't you just /branch to the survey block from each of the nback blocks? That is:

Sample your nback blocks randomly at the <expt> level per

<expt>
...
/ blocks = [1-18 = noreplace(quick0back1, ...)]
...
</expt>

and in each nback block have

<block quick0back1>
...
/ branch = [survey.thoughtprobe]
</block>

I tried doing this but it doesnt work for some reason. It just goes past skips the thought probes and goes to the next block. 

Here is the scripted coded like you suggest. It doesnt branch to the survey for some reason.
By Dave - 2/11/2021

mindwanderingjeremy - 2/11/2021
mindwanderingjeremy - 2/11/2021
Dave - 2/11/2021
mindwanderingjeremy - 2/11/2021
Hi again! 

I am having trouble with my n-back task code again. It is nearly complete but I am attempting to randomise the presentation of my survey pages which is proving difficult.
The way I have attempted to do this is I have created a <survey thoughtprobes> function which presents each of the survey pages in a random order. However, I need this survey page to be shown after every one of my experimental blocks. To do this I need to be able to randomly select groups of block1 + survey.thoughtprobes, block 2 + survey.thoughprobes, block3 + survey.thoughtprobes, etc in my <experiment> function. Is there an easy way to do this?

So far I have attempted to use a method I found on a 10 year old thread in this forum which uses lists to achieve this like so:
<list blockselector>
/items = (list.q0b1, list.q0b2, list.q0b3, list.m0b1, list.m0b2, list.m0b3, list.l0b1, list.l0b2, list.l0b3,
list.q1b1, list.q1b2, list.q1b3, list.m1b1, list.m1b2, list.m1b3, list.l1b1, list.l1b2, list.l1b3,)
/selectionmode = random
/replace = false
</list>
<list q0b1>
/items = (block.quick0back1, survey.thoughtprobe)
/selectionmode = sequence
</list>
*** multiple lists for each block type ***
<expt>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [1-2 = list.blockselector; 3-4 = list.blockselector; 5-6 = list.blockselector; 7-8 = list.blockselector; 9-10 = list.blockselector;
11-12 = list.blockselector; 13-14 = list.blockselector; 15-16 = list.blockselector; 17-18 = list.blockselector; 19-20 = list.blockselector;
21-22 = list.blockselector; 23-24 = list.blockselector; 25-26 = list.blockselector; 27-28 = list.blockselector; 29-30 = list.blockselector;
31-32 = list.blockselector; 33-34 = list.blockselector; 35-36 = list.blockselector]
/onexptend = [values.completed = 1]
</expt>

However this does not work. Any ideas on how I can randomly present blocks with the survey at the end?
I have included my code and stimuli below if you would like to look at the whole thing.
Thank you!

Why don't you just /branch to the survey block from each of the nback blocks? That is:

Sample your nback blocks randomly at the <expt> level per

<expt>
...
/ blocks = [1-18 = noreplace(quick0back1, ...)]
...
</expt>

and in each nback block have

<block quick0back1>
...
/ branch = [survey.thoughtprobe]
</block>

I tried doing this but it doesnt work for some reason. It just goes past skips the thought probes and goes to the next block. 

Here is the scripted coded like you suggest. It doesnt branch to the survey for some reason.

It branches to the survey just fine. You're probably just confused, expecting the branch to occur whenever you see your "stop" trial, but that's because your blocks' /trials syntax is faulty (in all blocks).

/ trials = [1 = 0backready; 2 -9 = noreplace(0backNT, 0backNT, 0backNT, 0backtarget); 10-14 = 0backtarget, 0backNT, 0backNT, 0backNT, stop]

I'm not sure what you intend the bolded part above to do, but I can tell you what it does do: It runs the sequence of trials

0backtarget -> 0backNT -> 0backNT -> 0backNT -> stop

five times.

If you want that sequence of five trials to run only once, the proper specification is


/ trials = [1 = 0backready; 2 -9 = noreplace(0backNT, 0backNT, 0backNT, 0backtarget); 10 = sequence(0backtarget, 0backNT, 0backNT, 0backNT, stop)]
By mindwanderingjeremy - 2/11/2021

Dave - 2/12/2021
mindwanderingjeremy - 2/11/2021
mindwanderingjeremy - 2/11/2021
Dave - 2/11/2021
mindwanderingjeremy - 2/11/2021
Hi again! 

I am having trouble with my n-back task code again. It is nearly complete but I am attempting to randomise the presentation of my survey pages which is proving difficult.
The way I have attempted to do this is I have created a <survey thoughtprobes> function which presents each of the survey pages in a random order. However, I need this survey page to be shown after every one of my experimental blocks. To do this I need to be able to randomly select groups of block1 + survey.thoughtprobes, block 2 + survey.thoughprobes, block3 + survey.thoughtprobes, etc in my <experiment> function. Is there an easy way to do this?

So far I have attempted to use a method I found on a 10 year old thread in this forum which uses lists to achieve this like so:
<list blockselector>
/items = (list.q0b1, list.q0b2, list.q0b3, list.m0b1, list.m0b2, list.m0b3, list.l0b1, list.l0b2, list.l0b3,
list.q1b1, list.q1b2, list.q1b3, list.m1b1, list.m1b2, list.m1b3, list.l1b1, list.l1b2, list.l1b3,)
/selectionmode = random
/replace = false
</list>
<list q0b1>
/items = (block.quick0back1, survey.thoughtprobe)
/selectionmode = sequence
</list>
*** multiple lists for each block type ***
<expt>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [1-2 = list.blockselector; 3-4 = list.blockselector; 5-6 = list.blockselector; 7-8 = list.blockselector; 9-10 = list.blockselector;
11-12 = list.blockselector; 13-14 = list.blockselector; 15-16 = list.blockselector; 17-18 = list.blockselector; 19-20 = list.blockselector;
21-22 = list.blockselector; 23-24 = list.blockselector; 25-26 = list.blockselector; 27-28 = list.blockselector; 29-30 = list.blockselector;
31-32 = list.blockselector; 33-34 = list.blockselector; 35-36 = list.blockselector]
/onexptend = [values.completed = 1]
</expt>

However this does not work. Any ideas on how I can randomly present blocks with the survey at the end?
I have included my code and stimuli below if you would like to look at the whole thing.
Thank you!

Why don't you just /branch to the survey block from each of the nback blocks? That is:

Sample your nback blocks randomly at the <expt> level per

<expt>
...
/ blocks = [1-18 = noreplace(quick0back1, ...)]
...
</expt>

and in each nback block have

<block quick0back1>
...
/ branch = [survey.thoughtprobe]
</block>

I tried doing this but it doesnt work for some reason. It just goes past skips the thought probes and goes to the next block. 

Here is the scripted coded like you suggest. It doesnt branch to the survey for some reason.

It branches to the survey just fine. You're probably just confused, expecting the branch to occur whenever you see your "stop" trial, but that's because your blocks' /trials syntax is faulty (in all blocks).

/ trials = [1 = 0backready; 2 -9 = noreplace(0backNT, 0backNT, 0backNT, 0backtarget); 10-14 = 0backtarget, 0backNT, 0backNT, 0backNT, stop]

I'm not sure what you intend the bolded part above to do, but I can tell you what it does do: It runs the sequence of trials

0backtarget -> 0backNT -> 0backNT -> 0backNT -> stop

five times.

If you want that sequence of five trials to run only once, the proper specification is


/ trials = [1 = 0backready; 2 -9 = noreplace(0backNT, 0backNT, 0backNT, 0backtarget); 10 = sequence(0backtarget, 0backNT, 0backNT, 0backNT, stop)]

Ahh right I understand! yes thank you I did want it to only run once so I appreciate this clarification. I will change this syntax thank you
By mindwanderingjeremy - 2/11/2021

Is it the same for the expt /blocks syntax? If I only want it to run through noreplace(block1, block2, block3, etc.) once I list it as 1 = noreplace(block1, block2, block3, etc.)?
By Dave - 2/11/2021

mindwanderingjeremy - 2/12/2021
Is it the same for the expt /blocks syntax? If I only want it to run through noreplace(block1, block2, block3, etc.) once I list it as 1 = noreplace(block1, block2, block3, etc.)?

This applies to sequence() only. A sequence is treated as a single unit.

When sampling randomly from some pool, it's 1-3 = noreplace(a,b,c) if you want each element in the pool run once, in random order.

2 -9 = noreplace(0backNT, 0backNT, 0backNT, 0backtarget);

will give you 6 0backNT trials and 2 0backtarget trials, in random order.