diff --git a/js/data/TrialHandler.js b/js/data/TrialHandler.js index 314efcb..6efb1ad 100644 --- a/js/data/TrialHandler.js +++ b/js/data/TrialHandler.js @@ -473,11 +473,15 @@ export class TrialHandler extends PsychObject value = Number.parseFloat(value); } - const [arrayMaybe] = util.turnSquareBracketsIntoArrays(value); + // Look for string encoded arrays in the form of '[1, 2]' + const arrayMaybe = util.turnSquareBracketsIntoArrays(value); if (Array.isArray(arrayMaybe)) { - value = arrayMaybe; + // Keep the first match if more than one are found. If the + // input string looked like '[1, 2][3, 4]' for example, + // the resulting value would be [1, 2] + value = arrayMaybe[0]; } trial[fields[l]] = value;