surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.12k stars 802 forks source link

Multi-Select Matrix: A checkbox column with `showInMultipleColumns: true` produces an incorrect response #8348

Closed JaneSjs closed 3 months ago

JaneSjs commented 3 months ago

T18436 - Issue on Random Option on multi-select metrix https://surveyjs.answerdesk.io/internal/ticket/details/T18436


To reproduce the issue, add a Checkbox column, enable the showInMultipleColumns option and activate the random choice order. View Demo

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "matrixdropdown",
     "name": "question1",
     "columns": [
      {
       "name": "Column 1",
       "cellType": "checkbox",
       "showInMultipleColumns": true,
       "choices": [
        "col1",
        "col2",
        "col3",
        "col4",
        "col5"
       ],
       "choicesOrder": "random"
      }
     ],
     "choices": [
      1,
      2,
      3,
      4,
      5
     ],
     "rows": [
      "Row 1",
      "Row 2"
     ]
    }
   ]
  }
 ]
}

The following selection: image

Produces the irrelevant output:

{
   "question1": {
      "Row 1": {
         "Column 1": [
            "col2"
         ]
      },
      "Row 2": {
         "Column 1": [
            "col5"
         ]
      }
   }
}