From 8a6209b302e929033f458819733f34a1a8b77d7c Mon Sep 17 00:00:00 2001 From: Alain Pitiot Date: Tue, 21 May 2024 14:20:48 +0200 Subject: [PATCH] corrected issue with saving of partial results --- src/core/PsychoJS.js | 2 +- src/data/ExperimentHandler.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/PsychoJS.js b/src/core/PsychoJS.js index 46e7f75..ba4eca2 100644 --- a/src/core/PsychoJS.js +++ b/src/core/PsychoJS.js @@ -437,7 +437,7 @@ export class PsychoJS { self._experiment.save({ tag: "", - clear: true + clear: false }); }, self._config.experiment.resultsUpload.period * 60 * 1000 diff --git a/src/data/ExperimentHandler.js b/src/data/ExperimentHandler.js index bf963c0..3695f6f 100644 --- a/src/data/ExperimentHandler.js +++ b/src/data/ExperimentHandler.js @@ -296,11 +296,15 @@ export class ExperimentHandler extends PsychObject // we need a header if it is asked for and there is actual data to save: const withHeader = this._isCsvHeaderNeeded && (data.length > 0); +/* INCORRECT: since new attributes can be added throughout the participant session, we need, currently, + to upload the whole result data, on each call to save. + // if we are outputting a header on this occasion, we won't need one thereafter: if (this._isCsvHeaderNeeded) { this._isCsvHeaderNeeded = !withHeader; } +*/ // TODO only save the given attributes const worksheet = XLSX.utils.json_to_sheet(data, {skipHeader: !withHeader});