We want to create a scored quiz that includes text entry questions. We want to award 2 points for each text entry answer that includes at least 500 characters. The specific answer doesn't matter. If they enter at least 500 characters in the text entry answer, they get 2 points. If they enter less than 500 characters, they get 0 points. Qualtrics support said this is not possible. But I've seen a lot of super-clever workarounds from the community, so I was hoping someone might have a good suggestion. Thanks in advance for any suggestions you can provide!
Page 1 / 1
Hi,
you might try this:
- create an embedded data field entryPoints
- add this javascript:
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
let qId = this.questionId;
let entryPoints = Number("${e://Field/entryPoints}")
let input = document.getElementById("QR~"+qId).value
//let words = input.split(' ')
let wordCount = input.match(/\\S+/g).length;
console.log(wordCount)
if(wordCount >= 500){
wordCount = wordCount +2
}
Qualtrics.SurveyEngine.setEmbeddedData("entryPoints", wordCount);
});
not very elaborated but easy to implement
Best regards
Rudi
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.