User Tools

Site Tools


questionoptionsguide

Steps to Fill in the QuestionOptions Table (Complete Guide)

This guide provides a step-by-step approach to correctly fill the fw_questionoptions table. This table stores the answer options (choices) for each question in your survey. It also manages display settings like the answer order, graph color, open answer text boxes, dynamic queries, and many more.

The table is directly linked to the fw_questionnairedetails table via qdetailid, meaning each question from QuestionnaireDetails has one or more corresponding answer options in fw_questionnairedetailsoptions.

You can find the detailed structure of the QuestionOptions table here: 👉 Question Options Table Structure

1. Add the ID (id)

This is the primary key (auto-incremented) for the table.
Do not manually enter this value if inserting data directly via the database.
It is automatically generated when you insert a new record.

qdetailid is the foreign key that links the option to a specific question from the fw_questionnairedetails table.
Without this linkage, the option will not appear in the survey.

Example: Suppose you have a question in fw_questionnairedetails with:

  • id = 1001 → Question: *How satisfied are you with our service?*

If you want to add an option like *“Very Satisfied”*, the qdetailid must be: `qdetailid = 1001`

3. Set the Option Display Order (optionorder)

This column controls the order in which options appear in the survey.

Example:

optionorder Option Text
1 Very Satisfied
2 Satisfied
3 Neutral
4 Dissatisfied
5 Very Dissatisfied

So, the order in the survey will appear exactly as defined in optionorder.

4. Set the Graph Order (graphorder)

This column allows you to define the display order of options in graph reports, which may differ from the survey display order.

Example: If you want the graph to show: - Very Dissatisfied → Left side of the graph - Very Satisfied → Right side of the graph

You can configure it like this:

optionorder Option Text graphorder
1 Very Satisfied 5
2 Satisfied 4
3 Neutral 3
4 Dissatisfied 2
5 Very Dissatisfied 1

So the graph will show Negative to Positive results.

5. Set the Option Type (optiontype) (Optional)

This column is not standardized but can be used for custom purposes.

Possible use cases:

  • 1 → Image Option
  • 2 → Text Option
  • 3 → Dynamic Option
  • 4 → Audio Option

If unsure, leave this column as 0.

6. Enable Open Answer Textbox (openanswer)

This column determines if the option should display an open text box next to it.
It is useful for options like “Other, please specify”.

Possible values:

  • 0 → No open text box
  • 1 → Open text box appears next to the option
  • 2 → Large open text box appears
  • 3 → Open text box only appears when selected

Example: Option: *Other, please specify* `openanswer = 1`

7. Enable Open Answer Without Option (openanswerforopt)

If you want to show an open text box without any radio/checkbox, use this field.

Example: If you ask: *“What is your postal code?”*, you can configure: `openanswerforopt = 1`

8. Set Graph Bar Color (graphcolor)

This column allows you to set a custom color for the graph bar representing this option.

Example: - Hex Code: #FF0000 → Red - Hex Code: #00FF00 → Green

Set: `graphcolor = #00FF00`

9. Set Option Text Color (textcolor)

This defines the text color of the option in the survey.

Example: - Black → #000000 - Red → #FF0000 - Blue → #0000FF

Set: `textcolor = #FF0000`

10. Set App Text Color (apptextcolor)

If you have a mobile app showing survey results, you can set a custom text color for app display.

Example: `apptextcolor = #00FF00`

11. Set Emotion-Based Colors (emotioncolors) (Optional)

For emotion-based questions (like smileys), you can define multiple colors separated by `^||^`.

Example: `emotioncolors = #FF0000^||^#00FF00^||^#0000FF`

12. Upload Icon (icon) (Optional)

You can upload an image/icon (like smileys or logos) for this option.
The file must be uploaded as BLOB (Binary Large Object).

Supported formats: - PNG - JPG - GIF

13. Upload Enlarged Icon (enlargeicon) (Optional)

This column is specifically for Image Picker Questions where clicking an option shows an enlarged image.
Upload it as BLOB.

14. Set Icon Size (iconsize)

This controls the display size of the icon.
Default: 40px

Set: `iconsize = 60`

15. Set Option Status (status)

Defines whether the option is active or inactive.

Possible Values: - 1 → Active (shown in the survey) - 0 → Inactive (hidden)

16. Redirect Option to Info Page (redirecttoinfo)

If selecting an option should redirect the user to an information page, set this value.

Example: `redirecttoinfo = 1` → Redirect to info page.

17. Add Dynamic Option Query (optionquery) (Optional)

This field allows you to dynamically load options from another table based on previous answers.

Example:

18. Add Update Parameters (updateparams)

If selecting this option should trigger a database update, enter the query here.

Example: UPDATE fw_responses SET is_followup=1 WHERE optionid=5;

19. Add Display Condition (optiondisplayparamcond)

This column defines conditional display rules.

Example:

20. Exclude Other Options (excludeotheropts)

If selecting this option should disable/fade other options, set this as: `excludeotheropts = 1`

21. Hide in Reports (hideinreports)

If selecting this option should hide others from reports, enter their IDs separated by comma.

Example: `hideinreports = 5,6,7`

22. Randomize Option Order (randomorder)

If you want options to randomize on each survey load, set: `randomorder = 1`

23. Hide in Bubble Graph (hideinbubblegraph)

If this option should not appear in bubble graphs, set: `hideinbubblegraph = 1`

24. Assign Score (optionscore)

This assigns a score to the option (useful for NPS or scoring-based questions).

Example: - Very Satisfied → Score 5 - Dissatisfied → Score 1

✅ Notes

  1. Always link options to questions via qdetailid.
  2. Use graphcolor and textcolor for better visual representation. .
  3. Always test options after insertion.
questionoptionsguide.txt · Last modified: 2025/03/10 06:56 by gloria