# QUEST loop not terminating online

**URL:** <https://discourse.psychopy.org/t/quest-loop-not-terminating-online/43135>\
**Category:** Online experiments\
**Created:** [December 3, 2024, 1:38pm UTC](https://discourse.psychopy.org/t/quest-loop-not-terminating-online/43135 "2024-12-03T13:38:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![NeuroImager](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/neuroimager/32/42865_2.png) [@NeuroImager](https://discourse.psychopy.org/u/NeuroImager)\
**Post date:** [December 12, 2024, 11:24am UTC](https://discourse.psychopy.org/t/quest-loop-not-terminating-online/43135/2 "2024-12-12T11:24:15Z")

</div>

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

> [@Ending a staircase after a maximum number of trials](https://discourse.psychopy.org/t/ending-a-staircase-after-a-maximum-number-of-trials/35276/2):
>
> I found that when testing it locally in my browser, setting “nReps” in the builder window for the staircase loop was equivalent to setting the maximum number of Trials (the documentation is misleading) When testing it online (piloting with Pavlovia), “nReps” no longer had this effect. That is because of this inconsistency I found in the psychojs files (psychojs-24.2.1.js in my case) Local version: var StairHandler = class extends TrialHandler{ constructor({psychoJS, varName, startVal, mi…

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.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/4/640d03a7e89194501c98db03ea3bea584b11fe8a.png)

---

_[View the full topic](https://discourse.psychopy.org/t/quest-loop-not-terminating-online/43135)._
