survey-creator icon indicating copy to clipboard operation
survey-creator copied to clipboard

Ability to have different choices per matrixdynamic columns seems to have broken

Open stephenmond opened this issue 3 years ago • 1 comments

Are you requesting a feature, reporting a bug or ask a question?

Reporting bug

What is the current behavior?

I had created a Survey in Survey-Creator that at one time allowed me to have different dropdown choices per column on a single Dynamic Matrix object. This no longer seems to be possible which may have something to do with survey library itself and a code change on that end. When attempting to add different choices between columns, Survey Creator does not respect the values:

Choices for column one, "Sex":

sex

Choices for column two, "Age":

age

JSON output when apply is made on both of these columns:

json


Trying to add the data in the actual choices field in right-hand sidebar does not work as this makes the choices global for all columns.

What is the expected behavior?

Differentiating the choice data between columns used to work reliably, but now the JSON will not output to two columns, nor are any choices available when attempting to preview or run the survey in the wild..

Code that used to work now throws error in Creator JSON output: error

How would you reproduce the current behavior (if this is a bug)?

  • Drag a dynamic matrix block into your Survey Creator page
  • Make 2 columns
  • Hover over the pencil Icon on one column and add choices, click Apply
  • Hover over the pencil icon on the other column and add different choices, click Apply
  • Observe that either one set of choices becomes global for all, or no choices persist and JSON choices does not output

Provide the test code and the tested page URL (if applicable)

Code that used to work:

{
 "logoPosition": "right",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "matrixdynamic",
     "name": "child_sex&age",
     "visibleIf": "{Parent} = 'Yes'",
     "title": "Please select your child's biological sex and current age (in years)",
     "columns": [
      {
       "name": "Age",
       "choices": [
        {
         "value": "item1",
         "text": "Prefer not to Answer"
        },
        {
         "value": "item2",
         "text": "Under 12 Months"
        },
        {
         "value": "item3",
         "text": "1"
        },
        {
         "value": "item4",
         "text": "2"
        },
       ],
       "storeOthersAsComment": true,
       "optionsCaption": "Choose "
      },
      {
       "name": "Sex",
       "choices": [
        {
         "value": "item1",
         "text": "Prefer not to Answer"
        },
        {
         "value": "item2",
         "text": "Male"
        },
        {
         "value": "item3",
         "text": "Female"
        },
        {
         "value": "item4",
         "text": "Intersex"
        }
       ],
       "storeOthersAsComment": true,
       "optionsCaption": "Choose "
      }
     ],
     "optionsCaption": "Choose ",
     "rowCount": 1,
     "minRowCount": 1,
     "confirmDelete": true,
     "confirmDeleteText": "Are you sure you want to delete this record?",
     "addRowText": "Add Child"
    }
   ]
  }
 ]
}

Specify your

  • browser: Firefox 102.0
  • editor version: 1.940

stephenmond avatar Jul 14 '22 01:07 stephenmond

We will investigate the problem and write back as soon as possible

dmitry-kurmanov avatar Jul 26 '22 11:07 dmitry-kurmanov

@stephenmond hello, I am sorry for the late answer.

It seems that we did some updates for that functionality in matrix dynamic:

image

Could you please check it at https://surveyjs.io/create-free-survey ? Possibly the problem doesn't exist anymore.

dmitry-kurmanov avatar Oct 10 '22 08:10 dmitry-kurmanov