Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Access All Questions in JS

  • Speakerator
  • Speakerator's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 10 months ago #137399 by Speakerator
Access All Questions in JS was created by Speakerator
Hi experts,

This is probably a rather simple question, but I am not yet that familiar with the more in-depth features of limesurvey. I want to do some kind of analysis right at the end of a survey. Its complexity surpasses the capabilities of the built-in 'assessment', which is why I'd like to do it client-side inside of a boilerplate question. Currently, everything works fine - but I access the questions and their answer using a large json structure containing all the qcodes.

However, I'd like the survey to be extendable, hence it should be possible to add / remove questions and have that change automatically taken into account in the analysis.

Is there a method to gain access to a list of all questions of a given survey (at JS runtime). That way, I'd be able to loop said list, check each question regarding its relevance for the analysis and calculate the results. Changes in the surveys structure 'd be automatically reflected, since the "looped list" is fetched at runtime rather than a hardcoded model. (Currently, I'd have to add a question and also add its QCode to the json / array of relevant qcodes)

Best regards
Chris
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 10 months ago - 7 years 10 months ago #137408 by tpartner
Replied by tpartner on topic Access All Questions in JS
As far as I know, there is no built-in method to iterate through all questions. You may be able to make an AJAX call to a remote script that uses the RemoteControl 2 API with the list_questions() method .

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 10 months ago by tpartner.
The topic has been locked.
  • Speakerator
  • Speakerator's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 10 months ago #137413 by Speakerator
Replied by Speakerator on topic Access All Questions in JS
Dang it, I hoped I'd get away without additional custom scripts.. Anyway, thanks for the input
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose