surveyjs / custom-widgets

The collection of custom widgets for SurveyJS: Survey Library and Survey Creator :package:
https://surveyjs.io
MIT License
79 stars 78 forks source link

Emotions Rating - Choices are empty when converting an Emotions Rating question from another question #328

Closed JaneSjs closed 1 year ago

JaneSjs commented 1 year ago

Run this example. Click Add Question to add a new question; click a question type selector to convert this question to an Emotions Rating. On a design surface, it appears correctly: image However, in a survey JSON, the choices collection is empty:

{
  "type": "emotionsratings",
  "name": "question2"
}

Also, if you open the preview - this question is available, but it doesn't appear in survey results. image

Original Issue: T11456 - emotion rating does not have the "choices" key when I change question type

JaneSjs commented 1 year ago

Define a list of choices using the defaultJSON property:

SurveyCreator.settings.toolbox.defaultJSON.emotionsratings = {
 "choices": [
        "1",
        "2",
        "3",
        "4",
        "5"
      ] 
};

Example.