Upper limit for using the stimuli

Hi all,
I am building an experiment and was wondering - is it possible somehow set upper limit for one variable (word as a stimuli) in the whole experiment? In other words, I have list of 200 words, all of them should be randomly but equally distributed between all participants (one participant will have only some smaller set of stimuli-words). However, I would like to tell PsychoPy to stop offering a word in the new trials if it was already used, let’s say, 20x in the previous trials by previous participants. Hope it makes sense. I am not that advanced in coding but I am willing to try anything

I think there are two ways of doing this.

  1. Divide your words into fixed (potentially overlapping) subsets and make sure you assign equal participants to each group.

  2. Check and record the use of each word and skip if a maximum number of presentations has been reached.

How you do these will be different offline and online. Please could you confirm that you are running your experiment locally?

Also, please note that your thread title doesn’t seem to be connected to your question (at least not in my understanding).

Thank you for your reply. The second option seems that might work on what I am trying to do. The thing is that I have three “blocks” made by loop that use the same words but with different condition so in each block, there is different question related to the words (1 - how well you express X vocally, 2 - how well you express X in gesture, 3 - how well you express X multimodally), but the words are essentially the same in all 3 blocks. What I need is that in each of this block, the word will appear, let’s say, in total 20x - which means, that at the end, for each word I will have 20 answers for each 1-vocal, 2-gestural, 3-multimodal mean of expression.
The experiment will run online only. If the second option is still appliable, could you please give me a hand? :slight_smile:
Thanks for the feedback

Online, the solution for the second option would be to use the shelf. I haven’t done much with the shelf yet, but I think this would be a fairly simple project for me to use as a demo. For the demo my thought is to have a list of items (e.g. the numbers one to twenty in words), presenting five at random along with the total number of times that word has been presented across participants, and skipping if that number reaches a specified threshold. Does that sound like it would help you?

Thank you, I will take a look on the documentation and get back if any problem occurs. Do I understand correctly that this exhaustion condition is done only on Pavlovia server and not in the Builder/Coder? And if not, could you navigate me towards the right steps to do? Thanks

Here’s the documentation for the shelf. You create a shelf dictionary using Pavlovia and then use code components in Builder to make changes.


Here’s my new demo (the first I’ve done with the shelf).

Presentation Cap code | try it

Uses the shelf to cap the maximum number of times a given item will be shown across participants. Checking and updating the shelf takes a little time - especially if an item needs to be skipped, so this experiment displays a fixation cross for 1 frame plus that time.

My shelf code seems to be taking about 850ms.

presentationCount = await psychoJS.shelf.getDictionaryFieldNames({key: ["presentation-cap"]});

    psychoJS.shelf.setDictionaryFieldValue({key: ["presentation-cap"], fieldName: Item, fieldValue :1});
    count = 1;
    nTrials += 1;
        //increase the number of sessions completed by this participant
        count = await psychoJS.shelf.getDictionaryFieldValue({key: ["presentation-cap"], fieldName:Item, defaultValue:'no sessions detected'});
        count = count + 1;
if ((count > Number.parseInt(expInfo["presentation limit"]))) {
    continueRoutine = false;
} else {
    nTrials += 1;
    psychoJS.shelf.setDictionaryFieldValue({key: ["presentation-cap"], fieldName: Item, fieldValue :count});


Hey, I finally got to that and thanks, it seems to work. Thank you very much!

1 Like