MultiStairHandler Issues with different feature counts

I got a peculiar MultiStairHandler when running experiments with different numbers of features (staircases). Staircases are interleaved, randomized and through a QUEST algorithm .

I got two experiments running concurrently, but only one has a problem:

  • My experiment with 2 features (2 staircases) runs fine through completion (No issues)
  • My experiment with 5 features (5 staircase) encounters errors and stalls once one feature reaches its stopInterval (problem)

Technical Details:

  1. Error Message: TypeError: Cannot read properties of undefined (reading 'addResponse') occurring in the DiscriminationTrialRoutineEnd function when trying to access currentLoop.addResponse()
  2. Root Cause Analysis:
  • With 5 staircases, when one staircase reaches its stopInterval threshold[1], it stops running
  • However, the experiment continues cycling through all staircases
  • When trying to add responses to a completed staircase, the error occurs because the staircase object becomes unavailable
  1. Different Property Access:
  • Working 2-feature code uses currentLoop.currentStaircase
  • 5-feature code uses currentLoop._currentStaircase (with underscore)
  • The properties may change state differently after a staircase completes in PsychoJS
  1. Data Impact:
  • Features that reach their stopInterval first have complete data
  • Features that didn’t yet reach their stopInterval have incomplete data
  • This creates uneven data quality across features

Has anyone else encountered similar issues with MultiStairHandler when using different numbers of staircases? Are there established best practices for handling multiple concurrent staircases? The only solution I can think of is just sticking to a fixed trial number.

[1]: stopInterval: None or a number

The minimum 5-95% confidence interval required in the threshold estimate before stopping. If both this and nTrials is specified, whichever happens first will determine when Quest will stop.