x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

ExpressionAnswerOptions

From LimeSurvey Manual

 Hint: This features is available starting in version 5.3.0


Usage

Make answer option text available inside survey by expression function.

The function getAnswerOptionText get 3 parameters

  • The question id or title
  • The answer code to get
  • The scale (for array dual scale question)

More detail

The function can be used with question id or question code. The result are not updated on same page.

Each parameters can use expression, the expression are checked before send to function.

The function use the result of the expression then, for question parameter: if it's a numeric value : start to check if the question id exist in this survey, and get the primary question if it's a sub question; if it's a string search the primary question title in this survey.

For the answer code : the result of the expression is used directly.

  Before using these functions : the plugin must be activated in Plugin Manager.


Example

  • Get the answer text of option A1 of current single choice question : {getAnswerOptionText(self.qid,"A1")}
  • Get the answer text of option A1 of array question with code 'Qcode' : {getAnswerOptionText("Qcode","A1")}
  • Get the answer text of same option choice done in a previous question with code prev of current single choice question : {getAnswerOptionText(self.qid,prev.NAOK)} (if 'prev' question are in same group, the answer was not updated).