- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Access All Questions in JS
- Speakerator
- Topic Author
- Offline
- New Member
Less
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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
7 years 10 months ago - 7 years 10 months ago #137408
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
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.