Change which trial participant goes to next based on a calculation of how the participant did in the previous trial

Hey everyone - so I need some help doing the following:

We are looking to create a trier stress task with math equations as the stressor. What this basically means is we will present participants with math equations, they have to enter the answer, and a feedback page tells them if they were right or wrong - often telling them they are wrong to add stress.

But of course some people are better at maths than others, so to create an ideal stress task the person should be answering math questions that stress them, basically.

So what I want is 4 different ‘streams’, each with its own level of toughness, each one containing say 20 questions. The participant does a practice run, from that the program calculates their rough level (say 4 out of 10 right, therefore they start in the 2nd stream). Then every 3-5 questions (a trial I presume - so each stream could be made up of 4-5 trials) the program calculates how many they got right, and moves them to another stream if needed - if not, it continues on the current difficulty level.

I can create the trials and all the basic stuff, I just have no idea how to get the program to dynamically change which trial it goes to next based on a calculation of how the participant did in the previous trial.

Any and all help would be immensely appreciated!

Thanks in advance :slight_smile:

You could store your 4 TrialHandlers in a list, and your level could refer to which of the TrialHandlers the next trial is drawn from.

So set level to 1 initially, if the last 3 trials were correct (or 3 out of 5 or whatever), add 1 to level. Then use level as the index for your TrialHandler list.

It’s hard to be more specific without having a snippet of your code though.

Jan’s solution could work if you’re using code. Make sure then you connect your TrialHandlers to an ExperimentHandler so that it can output all the data into one file.

But it sounds like you’re heading towards using a ‘staircase’ procedure, which is all about trying to select the best level (the simple staircase uses a procedure of increasing an intensity if the participant gets it wrong and decreasing the level if they get it right (originates from trying to measure auditory thresholds). You can set the number of correct/incorrect in a row before changing.

In your case you’d then have to write the code to go and choose an appropriate challenge, given that the current level is 4, say, but getting the number 4 could be provided by the staircase.

I’m sorry, I have been on holiday.

Thank you very much for the replies, I am not great with coding so I will go away and try to make sense of what you said and implement it.

I may be back for further assistance.

Thanks again!