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, minVal, maxVal, nTrials, nReversals, nUp, nDown, applyInitialRule, stepSizes, stepType, name, autoLog, fromMultiStair, extraArgs}={})
{
super({
psychoJS,
name,
autoLog,
method: TrialHandler.Method.SEQUENTIAL,
trialList: Array(nTrials),
nReps: 1
});
Pavolvia version:
var StairHandler = class extends TrialHandler{
constructor({psychoJS, varName, startVal, minVal, maxVal, nTrials, maxTrials=200, nReversals, nUp, nDown, applyInitialRule, stepSizes, stepType, name, autoLog, fromMultiStair, extraArgs}={})
{
super({
psychoJS,
name,
autoLog,
method: TrialHandler.Method.SEQUENTIAL,
trialList: Array(maxTrials),
nReps: 1
});
setting nReps in the builder window for the loop had the effect of setting nTrials, which limited the number of trials when running locally but not on Pavlovia.
To set the maximum number of trials in Pavlovia, I went into the code in my Exp.js file and added the maxTrials line to this section:
mixed_FV_PV_trials = new data.MultiStairHandler({stairType:MultiStairHandler.StaircaseType.simple,
psychoJS: psychoJS,
name: 'mixed_FV_PV_trials',
varName: 'intensity',
nTrials: 4.0,
**maxTrials: 4.0,**
conditions: mixed_FV_PV_trialsConditions,
method: TrialHandler.Method.RANDOM
});
Alternatively, from the Builder when I click on the trials loop to configure it, in the box for entering nReps I entered 4.0, maxTrials: 4.0