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

"showOtherItem" and the "showCommentArea" combined give false Survey Results

Open dasboe opened this issue 1 year ago • 1 comments

There is an inconsitency when using the "showOtherItem" and the "showCommentArea" in a "radiogroup".

The Following JSON definiton of a Survey Creator

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "radiogroup",
     "name": "question1",
     "showCommentArea": true,
     "choices": [
      "Item 1",
      "Item 2"
     ],
     "showOtherItem": true
    }
   ]
  }
 ]
}

will create this form

Bildschirmfoto 2023-07-31 um 12 09 02

First I think it's strange that the default text for "showCommentArea" is "Other (descripe)". Souldn't it be just "Comment"?

But there is also a problem in the Survey Result JSON:

{
    "question1": "Text Other",
    "question1-Comment": "Text Description"
}

I would have expected this instead:

{
    "question1": "other",
    "question1-Other": "Text Other",
    "question1-Comment": "Text Description"
}

This is because without the "showCommentArea" option the output is as expected

{
    "question1": "other",
    "question1-Other": "Text Other"
}

Is this a bug or is there a reasoning behind this behaviour?

dasboe avatar Jul 31 '23 10:07 dasboe

@dasboe Unfortuantely, this change will break a lot of projects and we can't impelment it. The easy solution is to add a comment question with a hidden question number index.

Thank you, Andrew

andrewtelnov avatar Aug 03 '23 16:08 andrewtelnov