## Question relevance and looping/conditional looping 8 months 2 days ago #97912

 Mike_W 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 The administrator has disabled public write access.

## Question relevance and looping/conditional looping 7 months 3 weeks ago #98146

 Mike_W Still no thoughts on this? Thanks, Mike The administrator has disabled public write access.

## Question relevance and looping/conditional looping 7 months 3 weeks ago #98147

 holch OFFLINE LimeSurvey Team Posts: 2376 Thank you received: 239 Karma: 93 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. Have a look at the manual! It is a really valuable source for information. Here some helpful links: Manual (EN) | Question Types | Question Attributes | Workarounds If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going! The administrator has disabled public write access.

## Question relevance and looping/conditional looping 7 months 3 weeks ago #98149

 Mike_W 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 The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.093 seconds