Help! Force respondents to enter 0s on a constant sum matrix table (and on a constant sum table) | XM Community
Skip to main content
Solved

Help! Force respondents to enter 0s on a constant sum matrix table (and on a constant sum table)

  • February 27, 2022
  • 6 replies
  • 291 views

MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Level 5 ●●●●●
  • 137 replies

I could do with some urgent help....
I have a constant sum table (and same issue on a constant sum matrix table).
The default choices are 0, but there is a concern is that a respondent might click next without checking their response (i.e. just keeping the 0).
So, I thought I could make the default choice blank, so that the respondent would need to enter a 0 (or another value).
I didn't seem to be able to make default choices blank on these question types, so I tried some code. On the Constant Sum Matrix table I did:
Qualtrics.SurveyEngine.addOnload(function() {
    jQuery("#"+this.questionId+" td input[type=text]").val("");
});
This does change the default choice to blank - however, if I click next, I'm still able to proceed without changing the blank to a 0 or another number.
Any thoughts please..
I need to do this for two question types (Constant Sum/ Matrix Table Constant Sum).
Thank you

Best answer by MatthewM

Hi MikeW ,
If you want to stick with the Constant Sum question type, you can use Custom Validation to require an entry in each field. It would look something like this:
image.pngAnother option is to use the Matrix Table with Text Entry instead of Constant Sum Type, and add use the Force Response and Number Content Type settings.
image.png

View original

6 replies

MatthewM
Level 6 ●●●●●●
Forum|alt.badge.img+30
  • Level 6 ●●●●●●
  • 1073 replies
  • Answer
  • February 28, 2022

Hi MikeW ,
If you want to stick with the Constant Sum question type, you can use Custom Validation to require an entry in each field. It would look something like this:
image.pngAnother option is to use the Matrix Table with Text Entry instead of Constant Sum Type, and add use the Force Response and Number Content Type settings.
image.png


MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • 137 replies
  • February 28, 2022


https://community.qualtrics.com/XMcommunity/discussion/comment/44119#Comment_44119Hi MatthewM - thanks - that works for the Matrix Constant Sum questions.
Did you have any thoughts on how I do the same on a standard Constant Sum question? I don't appear to be able to clear the answers with JavaScript on the standard Constant Sum??


MatthewM
Level 6 ●●●●●●
Forum|alt.badge.img+30
  • Level 6 ●●●●●●
  • 1073 replies
  • February 28, 2022

Instead of using a Constant Sum question, you could use a Matrix with a single column.


MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • 137 replies
  • February 28, 2022

https://community.qualtrics.com/XMcommunity/discussion/comment/44128#Comment_44128I'll take a look at that, thanks....
On the Matrix Constant Sum... I'm using the code below to make the default choices blank and then your custom validation idea to ensure that respondents answer.... however, once the validation is triggered, it re-loads the question and any answers the respondent did give are blanked off again by the code. Is there a way to avoid that?
Qualtrics.SurveyEngine.addOnload(function() {
    jQuery("#"+this.questionId+" td input[type=text]").val("");
});


MatthewM
Level 6 ●●●●●●
Forum|alt.badge.img+30
  • Level 6 ●●●●●●
  • 1073 replies
  • February 28, 2022

Unfortunately I'm little better than a novice with Javascript. But if you make the question a Matrix Table with Text Entry, and add use the Force Response and Number Content Type settings, the fields should be blank by default, instead of having 0 prepopulated like it is with Constant Sum question types.


MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • 137 replies
  • March 1, 2022

Hi MatthewM - thanks so much for all of your help


Leave a Reply