Problem with constrain command
Greetings!
I am attempting to create a sustained-attention-to-response task (SART). The SART consists of 9-trial blocks in which a single digit (1-9) is randomly presented, with the constraint that each digit is presented only once per block. The digits are presented in one of five possible type sizes, with the constraint that no type size appears more than twice per block.
I have created a loop representing all 45 possible combinations of digits and type sizes. I want to randomly present 9 combinations of digits and type sizes per 9 trial block. To implement this, I have added the following constraints to the OpenSesame script:
constrain digit maxrep=1
constrain font_size maxrep=2
But, even with these constraints added, digits are appearing more than once and font sizes more than twice per block.
I feel that I must be missing something obvious either in the use of the constrain commands or in some other settings for the loop items, but even after trying multiple possible solutions and watching the relevant tutorials I can't figure out the issue!
Any help would be most greatly appreciated. I've attached the script for reference.
Thank you for your development and support of this great tool!
Comments
Hi,
The
maxrepconstraint refers to direct repetitions. Soconstrain digit maxrep=1means thatdigitwill not have the same value on two consecutive trials, but the same value may repeat at longer intervals.In your case, it seems that you want to randomly pair
digitandfont_size. To do this, I would create alooptable with 9 rows, and then useshuffle digitto randomly shuffle thedigitcolumn (but not the other columns), thus breaking the correspondence betweendigitandfont_size. Does this make sense?One thing to consider is that you have 9 values for digit and 5 for font size, which is unbalanced. (Some
font_sizevalues will occur more often than others.) I would use, say, 10 digits and 5 font sizes, or 8 digits and 4 font sizes. That strikes me as more elegant.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks Sebastiaan! This is very helpful. Unfortunately I'm stuck with the 9 digits and 5 font sizes because this a direct replication of a specific version of the task, but I think I should be able to build it out using the information you provided here. Thanks again!