Question T12843
Visible to All Users

Option to give no rating

created 2 years ago

Hello Team,

We use rating questions to gather … well, ratings of staff. We can do this with the default rating setup:

JSON
{ "type": "rating", "name": "question1", "rateCount": 5, "rateMax": 5 }

This works well with SurveyJS Analytics, as we can use the Gauge representation of average rating.

We also want to give option to not rate someone. We have achieved this by entering rate values manualy:

JSON
{ "type": "rating", "name": "question1", "autoGenerate": false, "rateCount": 6, "rateValues": [1, 2, 3, 4, 5, { "value": "NA", "text": "I do not want to rate this one" } ], "rateMax": 6 }

This gives us a nice visual representation in the survey, however we end up with a broken representation in SurveyJS Analytics.
I can imagine that the underlying average() doesn't work well with NA values being present among numbers, but can't figure out a solution.

Is there a better way to allow None rating?

Show previous comments (5)

    Hello,
    Thank you for your patience. A Gauge chart excludes undefined values from visualization. So, you may wish to customize a user response and use the undefined value instead of a NA string.

    Please let me know if this option can help you.

      Thanks Jane. How do I use undefined value in rating questions?
      I tried

      JSON
      { "type": "rating", "name": "question1", "autoGenerate": false, "rateCount": 3, "rateValues": [ 1, 2, { "value": null, "text": "No rating" } ] }

      and

      JSON
      { "type": "rating", "name": "question1", "autoGenerate": false, "rateCount": 3, "rateValues": [ 1, 2, { "value": "", "text": "No rating" } ] }

      In both cases SurveyCreator fixes the JSON to

      JSON
      { "type": "rating", "name": "question1", "autoGenerate": false, "rateCount": 3, "rateValues": [ 1, 2, "No rating" ] }

        Hello,
        I am afraid will not be able to provide you with a solution right now for undefined value. SurveyJS treats undefined value as unset value for all questions. We have unit tests checking that value property of item value object is not undefined.
        You can decide that value X you will treat as undefined and make it a defaultValue as well. It will work. End-user will not be able to unset this value in rating question and only set it back.

        Thank you,
        Andrew
        SurveyJS Team