Scoring text entry questions based on minimum character count | XM Community
Skip to main content

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!

Hi,
you might try this:

  1. create an embedded data field entryPoints

  2. 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