Question relevance and looping/conditional looping

• Mike_W
• Topic Author
• Visitor
3 years 11 months ago #97912 by Mike_W
Mike_W created the topic: Question relevance and looping/conditional looping
Hello,

I am trying to add the ability to create a looping group of questions to LimeSurvey. My ultimate goal is to create a group of questions, and allow users to specify how many times and under what conditions the group should be displayed. I know that there is a workaround using conditional display of questions, but this does not scale well for large numbers, nor does it allow you to limit the number of "follow-up" questions, or randomize within the group.

I have looked through the code and tried to trace down the relevant sections, but I need some help. In the helpers\expressions\em_manager_helper.php file, there are two functions that I thought would be the main control point: QuestionIsRelevant($qid) and GroupIsRelevant($gid), but modifying them so that they always return true does not force questions to be displayed (they are still displayed only when their relevance equation is satisfied). What else do I need to do/where else should I look for this? I've been struggling with this for a while and have not been able to get any help in the IRC channel, so I'm about out of ideas.

Thanks,

Mike

• Mike_W
• Topic Author
• Visitor
3 years 11 months ago #98146 by Mike_W
Mike_W replied the topic: Question relevance and looping/conditional looping
Still no thoughts on this?

Thanks,

Mike

3 years 11 months ago #98147 by holch
holch replied the topic: Question relevance and looping/conditional looping
While not an expert on this, I think the main problem is the database design. Because from what I can see, Limesurvey needs to reserve columns for each question/answer, therefore somehow needs a limit/max number of iterations.

But as I said, I am not an expert.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.

• Mike_W
• Topic Author
• Visitor
3 years 11 months ago #98149 by Mike_W
Mike_W replied the topic: Question relevance and looping/conditional looping
Certainly, there will be some (probably significant) challenges with the database access portion, but I have been unable to get even the simplest initial hack to work- to make all questions/groups relevant (and thus displayed) regardless of their relevance equation. I originally put in logic that would return true if the question was relevant by virtue of being inside a loop (a hard-coded test), but when even that didn't work, I tried simply forcing the previously mentioned functions to return true, saying that all questions and groups were always relevant. Unfortunately, this was not sufficient to make all groups and questions be displayed on a standard survey (no loops or custom features) that used relevance conditions, so there must be something else that is controlling whether a question/group gets shown or not, but I can't figure out what that is.

Thanks,

Mike