diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 702e9cc..6812521 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -17,7 +17,7 @@ module.exports = {
"block-spacing": 2,
"brace-style": [2, "allman", { allowSingleLine: true }],
"camelcase": 1,
- "capitalized-comments": [1, "always", { ignoreConsecutiveComments: true }],
+ "capitalized-comments": 0,
"comma-spacing": 2,
"comma-style": 2,
"consistent-return": 1,
@@ -47,7 +47,7 @@ module.exports = {
"no-console": 1,
"no-div-regex": 2,
"no-duplicate-imports": 2,
- "no-else-return": 2,
+ "no-else-return": 1,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
@@ -65,7 +65,7 @@ module.exports = {
"no-mixed-requires": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
- "no-multiple-empty-lines": [2, { max: 1, maxEOF: 0 }],
+ "no-multiple-empty-lines": [1, { max: 2, maxEOF: 0 }],
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
@@ -74,7 +74,7 @@ module.exports = {
"no-octal-escape": 2,
"no-param-reassign": 1,
"no-path-concat": 2,
- "no-plusplus": 2,
+ "no-plusplus": 0,
"no-proto": 2,
"no-restricted-properties": 2,
"no-return-assign": [2, "except-parens"],
@@ -85,14 +85,15 @@ module.exports = {
"no-shadow-restricted-names": 2,
"no-tabs": [1, { allowIndentationTabs: true }],
"no-template-curly-in-string": 2,
- "no-throw-literal": 2,
+ "no-throw-literal": 0,
"no-trailing-spaces": 2,
"no-undef-init": 2,
// https://eslint.org/docs/rules/no-underscore-dangle#disallow-dangling-underscores-in-identifiers-no-underscore-dangle
- "no-underscore-dangle": 1,
+ "no-underscore-dangle": 0,
"no-unmodified-loop-condition": 2,
"no-unneeded-ternary": 2,
- "no-unused-expressions": 2,
+ "no-unused-expressions": 1,
+ "no-unused-vars": 1,
"no-use-before-define": [2, { functions: false }],
"no-useless-call": 2,
"no-useless-computed-key": 2,
@@ -106,7 +107,7 @@ module.exports = {
"object-property-newline": [2, { allowMultiplePropertiesPerLine: true }],
"one-var": [2, "never"],
"one-var-declaration-per-line": 2,
- "operator-linebreak": [2, "before"],
+ "operator-linebreak": [1, "before"],
"padded-blocks": [2, "never"],
"padding-line-between-statements": 2,
"prefer-const": 2,
diff --git a/package.json b/package.json
index 01eca0e..470fceb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "psychojs",
- "version": "2021.2.x",
+ "version": "2021.3.0",
"private": true,
"description": "Helps run in-browser neuroscience, psychology, and psychophysics experiments",
"license": "MIT",
diff --git a/src/core/ServerManager.js b/src/core/ServerManager.js
index a06140a..68965df 100644
--- a/src/core/ServerManager.js
+++ b/src/core/ServerManager.js
@@ -453,7 +453,7 @@ export class ServerManager extends PsychObject
path,
data: undefined,
});
- this._psychoJS.logger.debug("registered resource:", name, path);
+ this._psychoJS.logger.debug(`registered resource: name= ${name}, path= ${path}`);
resourcesToDownload.add(name);
}
}
@@ -476,12 +476,10 @@ export class ServerManager extends PsychObject
{
// to deal with potential CORS issues, we use the pavlovia.org proxy for resources
// not hosted on pavlovia.org:
- if (
- (path.toLowerCase().indexOf("www.") === 0
- || path.toLowerCase().indexOf("http:") === 0
- || path.toLowerCase().indexOf("https:") === 0)
- && (path.indexOf("pavlovia.org") === -1)
- )
+ if ( (path.toLowerCase().indexOf("www.") === 0 ||
+ path.toLowerCase().indexOf("http:") === 0 ||
+ path.toLowerCase().indexOf("https:") === 0) &&
+ (path.indexOf("pavlovia.org") === -1) )
{
path = "https://pavlovia.org/api/v2/proxy/" + path;
}
@@ -491,7 +489,7 @@ export class ServerManager extends PsychObject
path,
data: undefined,
});
- this._psychoJS.logger.debug("registered resource:", name, path);
+ this._psychoJS.logger.debug(`registered resource: name= ${name}, path= ${path}`);
// download resources by default:
if (typeof download === "undefined" || download)
diff --git a/src/data/MultiStairHandler.js b/src/data/MultiStairHandler.js
new file mode 100644
index 0000000..fb51572
--- /dev/null
+++ b/src/data/MultiStairHandler.js
@@ -0,0 +1,382 @@
+/** @module data */
+/**
+ * Multiple Staircase Trial Handler
+ *
+ * @author Alain Pitiot
+ * @version 2021.2.1
+ * @copyright (c) 2017-2020 Ilixa Ltd. (http://ilixa.com) (c) 2020-2021 Open Science Tools Ltd.
+ * (https://opensciencetools.org)
+ * @license Distributed under the terms of the MIT License
+ */
+
+
+import {TrialHandler} from "./TrialHandler.js";
+import {QuestHandler} from "./QuestHandler.js";
+import * as util from "../util/Util.js";
+import seedrandom from "seedrandom";
+
+
+/**
+ *
A handler dealing with multiple staircases, simultaneously.
+ *
+ * Note that, at the moment, using the MultiStairHandler requires the jsQuest.js
+ * library to be loaded as a resource, at the start of the experiment.
+ *
+ * @class module.data.MultiStairHandler
+ * @extends TrialHandler
+ * @param {Object} options - the handler options
+ * @param {module:core.PsychoJS} options.psychoJS - the PsychoJS instance
+ * @param {string} options.varName - the name of the variable / intensity / contrast
+ * / threshold manipulated by the staircases
+ * @param {module:data.MultiStairHandler.StaircaseType} [options.stairType="simple"] - the
+ * handler type
+ * @param {Array.