Survey drop-down lists

LabKey Support Forum
Survey drop-down lists Jon (LabKey DevOps)  2015-06-02 23:18
Status: Closed
 
Thanks Michele,

It took a bit, but I believe I have an adequate solution for what you're looking for.

So obviously for the radio buttons to be stacked in a single column, you would have to set your columns to 1, but the trickier part was two things:

1. Finding a way to render images.

2. Finding a way to render the question with the image as:

QUESTION | IMAGE | MULTIPLE CHOICE ANSWERS

or

QUESTION | MULTIPLE CHOICE ANSWERS | IMAGE

So my idea was for you to use tables and since the radiogroup option already sets itself up as QUESTION | MULTIPLE CHOICE ANSWERS, I figured that we could use the second option and have two cells like this:

[QUESTION | MULTIPLE CHOICE ANSWERS] [IMAGE]

This would have the radiogroup in one cell and the image in the other. The image would be rendering via HTML tags.

So using your original Brice survey code and paring down the information to make a basic working model, I came up with the following:

{
  "survey" : {
    "sections" : [{
      "title" : "BRICE Interview",
      "collapsible" : true,
      "description" : null,
       "questions" : [{
             "extConfig": {
                  "xtype": "panel",
                  "layout": {
                      "type": "table",
                      "columns": 2
                       },
             "items": [{
                            "hidden": false,
                       "fieldLabel": "1. Letzte Erinnerungen bevor Sie einschliefen?",
                         "xtype": "radiogroup",
                         "name": "erinvor",
                         "columns": 1,
                         "items": [{
                            "boxLabel": "im OP-Bereich / Wartezone zu sein",
                            "name": "erinvor",
                            "inputValue": "a. im OP-Bereich/Wartezone zu sein"
                              },{
                            "boxLabel": "im OP-Saal zu sein",
                            "name": "erinvor",
                            "inputValue": "b. im Operationssaal zu sein"
                              },{
                            "boxLabel": "mit Angehörigen zu sein",
                            "name": "erinvor",
                            "inputValue": "c. mit Ihren Angehörigen zusammen zu sein"
                              },{
                            "boxLabel": "Stimmen zu hören",
                            "name": "erinvor",
                            "inputValue": "d. Stimmen zu hören"
                            }]
                         },{
                              "xtype": "panel",
                             "html": "<img src='http://www.google.com/images/srpr/logo11w.png' width='200'/>"
                         }]
                     }
                  }],
      "header" : true
    }],
    "showCounts" : false,
    "layout" : "card"
  }
}

I decided to use the Google Logo just to show that you can use a full URL with the HTML tag.

You'll have to do some tweaking of the widths within each item/cell, but I think this should work as a decent template for you to build off of.

Regards,

Jon