QUEST loop not terminating online

Hi

I’m encountering a problem with a QUEST staircase on Pavlovia. The experiment was created with Builder and runs fine, but the staircase does not terminate after the specified number of trials when I run it online.
Here is the loop specification:


I report each trial to the console so I can see the intensity values and trial number. They always go over the nReps (50) and the staircase doesn’t terminate. I have to force quit the experiment.
Am I missing something here?!
Thanks.

Answering my own question here :joy:… but it might be useful for others. Found a solution by @alyd in their post here:

Basically you need to pass an additional parameter (maxTrials) to the stair handler. You can edit the js file directly or add it via the Builder as shown below, although doing it this way will give an error if you try and run it locally.

Thank you so much for this post. This was the exact error I was encountering. I also have the issue where my stopInterval is basically zero and therefore my Quest procedure doesnt stop unless it hits the maxTrials and never stops because the thresholds have been met. Have you solved this problem or do you rely on maxTrials?

Glad it helped! I just use maxTrials to terminate and then use all the data collected (stimulus intensity and accuracy) to reconstruct a QuestHandler object and then use the internal posterior probability density function and the built-in mean() method to calculate an estimate of the threshold.
I got interested in your question though, but couldn’t find a clear answer, which is reflected in this discussion I found from some time ago:
Correct use of StopInterval in QuestHandler - Coding - PsychoPy
Good luck!

1 Like

Hey, so I have been running into some issues with your method. I tried looking at this documentation, and I am finding it a bit hard to run this on my end (and the documentation is not that clear to me), would you mind sharing some of the code that you are using for this and/or the documentation you used to get this up and running? I’m still in the process of “learining to code as I go” and I’m finding that I am spending way more time on this than I should be.

Does it look something like this? PSYCHOPY_SCRIPT.py (2.2 KB)

I solved the StopInterval problem. Will post my solution shortly (it’s super late here), but replying because this might help you and your research if necessary.

Step 1) Add stopInterval to your conditions file (wtv number you need)

Step 2) Add a new code component in the trial loop that uses quest and paste the code in it as JS and END Routine

Code used for stopinterval

Step 3) Add code to Routine


if (typeof currentLoop !== ‘undefined’ && currentLoop.name) {
if (currentLoop.currentStaircase) {
console.log(“Current staircase:”, currentLoop.currentStaircase.name);
console.log(“StopInterval value:”, currentLoop.currentStaircase._stopInterval);
console.log(“Confidence interval:”, currentLoop.currentStaircase.confInterval(true));
console.log(“Should stop?”, currentLoop.currentStaircase.confInterval(true) < currentLoop.currentStaircase._stopInterval);
console.log(“Is finished?”, currentLoop.currentStaircase._finished);
}
}

I found this