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); });