Access All Questions in JS

More
2 years 8 months ago #137399 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

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago - 2 years 8 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: 2 years 8 months ago by tpartner.

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #137413 by Speakerator
Dang it, I hoped I'd get away without additional custom scripts.. Anyway, thanks for the input

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!