Check out the LimeSurvey source code on GitHub!

A survey with dynamic questions?

  • brandtb
  • brandtb's Avatar Topic Author
  • Visitor
  • Visitor
3 years 6 months ago #99010 by brandtb
I have a research project where I would like participants to take two surveys. The first survey consists of rating a large number (100 to 200) of pairwise comparisons. When this survey is complete, I would like to run an algorithm on these results that will produce a list of "significant" pairs, approximately 20. I then want to ask the participants to provide short answer descriptions for these 20 pairs. The number of questions in the second survey would be constant, but the pairs to ask about would depend on the answers to the first survey.

My current plan is to have the end URL from the first survey link to some PHP to run the algorithm to identify the "significant" pairs. I can pass the token from the first survey through to retrieve their answers and calculate the 20 pairs. I can store this in my database, in PHP, whatever. But the issue is how to get the text into the second survey. For example, I may want questions to read:

Q1: Please describe the relationship between "cat" and "mouse":
Q2: Please describe the relationship between "cat" and "dog":
Q3: Please describe the relationship between "mouse" and "frog":
Q20: Please describe the relationship between "snake" and "pig":

From reviewing the documentation and a little experimentation, the only way I can see to do this is to create the second survey with 20 URL parameters, have the PHP pass in the minimally necessary text for the 20 questions in the URL, load them into 20 dummy questions, then access the values of the 20 questions in the text of the actual questions via. the Expression Manager. For example, the URL may look like,dog&pQ03=mouse,frog ...

This is kind of ugly, so I thought I'd ask the community if there is a better way. This post suggests an AJAX call. Any other suggestions?

Thanks in advance!


Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form