Skip to content

Commit

Permalink
fix monitorInput
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-jedrusiak committed Oct 31, 2024
1 parent 8ee086f commit 66376c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion velesresearch/website_template/src/SurveyComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 66376c4

Please sign in to comment.