Introduction:
This table outlines the detailed structure of the QuestionnaireDetailsOptions table, which stores information about the options (answer choices) associated with each question in a questionnaire. Each record corresponds to an option with specific settings, such as display order, graph order, open answer configuration, colors, icons, and special display conditions. Additionally, the table allows configuring option-level behavior, such as excluding other options when one is selected, hiding options in reports, or defining conditions for displaying options.
The table is linked to the QuestionnaireDetails table via the qdetailid column and plays a crucial role in defining the behavior of options in the survey.
Below is the list of fields in the QuestionnaireDetailsOptions table along with their descriptions, data types, and comments.
| Sr. No. | Name | Type | Description | Comments |
|---|---|---|---|---|
| 1 | id | int | Unique identifier of the option record. | AUTO_INCREMENT |
| 2 | qdetailid | int | Foreign key referring to id of the fw_questionnairedetails table. | Links the option to its question. |
| 3 | optionorder | int | Defines the display order of the option in the survey. | Determines the sequence of options in the question. |
| 4 | graphorder | int | Defines the order of the option in graph reports. | Allows different order in the report graph. |
| 5 | optiontype | int | Type of option (future use or custom use). | Currently not standardized. |
| 6 | openanswer | int | Determines if an open-answer textbox should appear along with the option. | Multiple modes for open text are available based on selection. Refer comments. |
| 7 | openanswerforopt | int | Defines if the open text box should appear without radio/checkbox. | Used specifically for Rapportcifer-type questions. |
| 8 | graphcolor | varchar(10) | Sets the color of the graph bar for this option. | Hex color code. |
| 9 | textcolor | varchar(10) | Sets the color of the option text. | Typically used to enhance visibility of the option text. |
| 10 | apptextcolor | varchar(10) | Text color to be displayed in mobile app case details. | Specifically used in mobile apps to highlight certain options. |
| 11 | emotioncolors | text | Saves emotion-based colors separated by “^||^”. | Used when displaying emotion-based questions. |
| 12 | icon | longblob | Stores the image/icon to represent the option. | Typically used for NPS, Image Picker, or Rapportcifer questions. |
| 13 | enlargeicon | longblob | Enlarged image of the option that appears in follow-up questions. | Specifically for Image Picker (questiontypecode=6). |
| 14 | iconsize | int | Defines the size of the icon in pixels. | Default is 40px. |
| 15 | status | int | Status of the option (1=active, 0=inactive). | Active options appear in the survey. |
| 16 | redirecttoinfo | int | Determines if the option should redirect to another information screen. | Typically used in dynamic questionnaire flows. |
| 17 | optionquery | text | Query to fetch dynamic options from another table. | Allows dynamically loaded options based on user input. |
| 18 | updateparams | text | Contains parameters to update another table based on the answer. | Useful for dynamic content or external data updates. |
| 19 | selectparams | text | Defines the select parameters for dynamically loaded options. | Typically used when fetching options from another source. |
| 20 | optiondisplayparamcond | text | Condition to display the option based on prior answers. | Allows hiding or showing options based on conditions. |
| 21 | excludeotheropts | int | Determines if selecting this option should exclude other options. | When selected, other options become disabled or faded out. |
| 22 | hideinreports | varchar(100) | List of option IDs to be hidden in reports if this option is selected. | Useful for internal use where certain responses should not appear in reports. |
| 23 | randomorder | int | Defines if the option should appear in random order. | Typically used in multi-response questions to avoid bias. |
| 24 | hideinbubblegraph | int | Determines if the option should appear in the bubble graph. | Used in visual representation of survey results. |
| 25 | optionscore | int | Score assigned to the option for calculating overall results. | Can be used for scoring-based questions. |
Explanation of Special Columns
1. openanswer (Column 6) - This column is crucial for configuring open-ended answers in options. Below are its possible values: 0 = No open answer box. 1 = Show open answer box next to option. 2 = Show open answer box with a long text area. 3 = Open answer appears only when the option is selected. 4 = Email input type. 5 = Phone input type. 6 = Postal code input type. 7 = Textbox appears without radio or checkbox. 8 = Date picker input. 9 = OTP (One-Time Password) input for verification. 10 = Max value input type. 11 = Phone input with SMS/Google Review triggers. 12 = Number input with a 0-100 range. 13 = Number input with a 1-100 range. 14 = Accepts any positive number.
2. optiondisplayparamcond (Column 20) - This column controls the display of options based on previous answers. For example: if Q1=2 then show Option A, else hide Option A
3. excludeotheropts (Column 21) - If enabled (value = 1), selecting this option will disable/fade out all other options for the same question.
4. emotioncolors (Column 11) - For emotion-based questions, this column stores multiple color codes separated by “^||^” for each emotion option.
5. optionquery (Column 17) - This allows dynamic loading of options from external tables based on user input. Example query:
SELECT optiontext FROM fw_options WHERE questionid=1;
