How to prevent one instruction from presenting after some stimuli in rows which is intended not to be responded by the participants?

Hi,

How can I prevent just (‘yes or no question’ instruction) not comprehension questions from
appearing after fillers in their rows on the screen which is intended not to be respond? presentation is by random.

I am doing the experiment online.

Your question is confusing because I don’t know where ‘yes or no instruction’ and comprehension questions appear.

However, if your question is "How do I skip grammarCheck when nameOfColumnB says filler then you could put the following in a Begin Routine code component in grammarCheck.

if nameOfColumnB == 'filler':
     continueRoutine = False

As you see in the excel file I have sent, in the row 33 the sentence is followed by a comprehension question about the sentence but not for the sentence in the row 34. On the builder, I defined the routine grammar check which contains yes or no instruction to appear after questions for each sentence in each row randomly, unfortunately when running, yes or know instruction also appears after the sentences named filler for example in the row 34 without comprehension question. I just wanted to know how can I prevent yes or no instruction from appearing after sentences without comprehension questions for sentences as fillers.

I used your code but facing the error: nameOfColumnB is not defined.

That’s because I don’t know what your Excel column B is called

if stimulitype == 'filler':
     continueRoutine = False

facing the error: stimulitype is not defined.

Did you put the code in Begin Experiment or Begin Routine? The latter is correct.

In begin routine, but the same error.

Are you sure you aren’t getting filler is not defined (since it should be in quotes)?

Why are you using a JS only code component here? Auto code components are best practice, since they help check your syntax.

I changed the but the error:

I fixed this error but the code does not prevent the question from appearing after filler. Don’t you think it might be better if enter the code in each frame tab?!

I’d recommend searching through your JS code online. Perhaps you’ve defined it twice or are making an edit to it somewhere.

How did you fix it?

Try moving code to the top of the routine.

You could put it in Each Frame but it shouldn’t be necessary from around 2020.2.5 onwards.

My condition file did not contain the column called stimulitype. I had forgot that. I just changed the condition file.

Thank you so much. Now it works.