Word count on fill in the blank question

Hi there, I followed the guide to creating a word count for essay questions. But was wondering how I achieve this for a fill in the blank question. It seems I cant reference the text the respondent fills into a blank?

Hi,

I’m sorry but I couldn’t figure it out what you want to do with the Fill in Blanks questions.
Could you explain it more details?
Besides, could you provide the link of the guide that you are following?

Regards,

Thanks HaiYen,

This is the guide i’ve been following:

It works for this example, but i can’t get it to work to count the text inside of the “fill in the blank” style question.

Hi,

Can you please let me know why you need to count the number of words in a fill-in-blanks question?
It’s different from Essay question so you can use the script for Essay question.

Regards

I would like to limit the number of words the respondent can type into each blank.
I need to be able to count the number of words to achieve this.
I can’t use the essay question type because there are many small single words i would like to collect in long passages of text. It would require many essay boxes and not be as flexible.

Hi,

You can count number of words filled in each blanks as follows:

$(prez.object('question name').textNode).find('input').each(function() {
    var filledText = this.value.trim();
    var numWords = filledText ? filledText.split(/\s+/).length : 0;
});

Regards

1 Like