Presenting stimuli of different set sizes

Hi, I want to present 80 stimuli in set sizes that range from 2 to 6. For example, participants read 4 sentences, after each sentence, they make a meaningfulness judgement while remembering the final word of the sentence, and after all 4 sentences have been presented, participants recall the 4 sentences’ final words by typing into a textbox.

I want the program to evaluate participants’ meaningfulness judgement of each sentence by comparing to the corrAns specified in the .csv file, while presenting different set sizes of sentences. I know the former can be pretty easily achieved by including a .csv file and loop through all stimuli, but how can I specify the different set sizes?

You can just set it up as a condition and tell the code to pull that many sentences from the list of possible sentences.

So you have a .csv file with 80 rows of sentences. Let’s name this list sentenceStim. Then you make a list variable numSentences with randomized numbers 2-6 for each trial you have and make a variable s = 0 at the beginning of the experiment (can be named something else) to keep track of which sentence you’re on later. Then make a code similar to this in the ‘Begin Routine’ tab for the trial loop:

sentences = [' ', ' ', ' ', ' ', ' ', ' '] #blank list with 6 slots for the sentences

currentSentences = numSentences[trial] #gets the number of sentences for the trial you're on

i = 0
while i < currentSentences :
    sentences[i] = sentenceStim[s] #replace a blank with the next word to the list
    s = s+1 #s will increase every trial by the number of sentences were in that trial, so it will continue down your list of 80 sentences

Then have six text components with $sentences[0], $sentences[1], etc. in the box. So if there are only 2 sentences that trial, they’ll just stay spaces and won’t be visible.

I hope this makes sense. That might not be the most elegant way to do it, but that’s what I would do.