-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Scratch/* | ||
Scratch | ||
*/wip* | ||
.history/* | ||
wip/ | ||
.history | ||
wip/ | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Qualtrics.SurveyEngine.addOnReady(function () { | ||
let quest = this, | ||
all_inputs = quest.questionContainer.querySelectorAll("[type='radio'],[type='checkbox']"); | ||
all_inputs.forEach((ip) => { | ||
ip.oninput = function (e) { | ||
setTimeout(() => { | ||
// Change the question here | ||
let check = confirm("Yes or no"); | ||
if (!check) { | ||
quest.getSelectedChoices().forEach((ch) => { | ||
quest.setChoiceValue(ch, false); | ||
}); | ||
} | ||
}, 100); | ||
}; | ||
}); | ||
setTimeout(() => { | ||
all_inputs.forEach((ip) => { | ||
ip.oninput = function (e) {}; | ||
}); | ||
// Change this to the delay in ms | ||
}, 6000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Check for fast answers | ||
|
||
This function allows you to reconfirm the respondents answer if they were too fast. The idea here is to allow the respondent to slowdown a bit, helping improve data quality. | ||
|
||
If the respondent answers too quickly, the code below asks them to confirm their choice, if they say no, the choices are cleared. | ||
|
||
```js | ||
Qualtrics.SurveyEngine.addOnReady(function () { | ||
// Change this value to increase/decrease the time. It is in ms. | ||
let check_time = 6000; | ||
let quest = this, | ||
all_inputs = quest.questionContainer.querySelectorAll("[type='radio'],[type='checkbox']"); | ||
all_inputs.forEach((ip) => { | ||
ip.oninput = function (e) { | ||
setTimeout(() => { | ||
// Change the question here | ||
let check = confirm("Yes or no"); | ||
if (!check) { | ||
quest.getSelectedChoices().forEach((ch) => { | ||
quest.setChoiceValue(ch, false); | ||
}); | ||
} | ||
}, 100); | ||
}; | ||
}); | ||
setTimeout(() => { | ||
all_inputs.forEach((ip) => { | ||
ip.oninput = function (e) {}; | ||
}); | ||
}, check_time); | ||
}); | ||
``` |