From 66376c43634983e2c8b6724ddb6f7c6ed85b7169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20J=C4=99drusiak?= Date: Thu, 31 Oct 2024 14:54:50 +0100 Subject: [PATCH] fix monitorInput --- NEWS.md | 1 + velesresearch/website_template/src/SurveyComponent.jsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 59b8fd1..6338bac 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ * Added `surveyFromJson()` function to create a survey from a json file made with the visual creator. * Themes have been implemented. See `themeFile` argument in the `SurveyModel` class. * Imports in __init__.py are now explicit. +* Fixed the `monitorInput` property so it now works as expected. ## 0.3.2 diff --git a/velesresearch/website_template/src/SurveyComponent.jsx b/velesresearch/website_template/src/SurveyComponent.jsx index 3641ae1..2966b3e 100644 --- a/velesresearch/website_template/src/SurveyComponent.jsx +++ b/velesresearch/website_template/src/SurveyComponent.jsx @@ -203,6 +203,8 @@ function setupTracking(survey, questionName) { registerCustomFunctions(); function SurveyComponent() { + SurveyCore.Serializer.addProperty("question", { name: "monitorInput", type: "boolean" }) + const survey = new Model(json); survey.participantID = MakeID(8); const dateStarted = new Date(); @@ -246,7 +248,6 @@ function SurveyComponent() { }); // Input monitoring setup - SurveyCore.Serializer.addProperty("question", { name: "monitorInput", type: "boolean" }) survey.onAfterRenderQuestion.add((sender, options) => { if (options.question.getPropertyValue("monitorInput", false)) setupTracking(sender, options.question.name); });