Can a no condition be added in looping

More
5 years 7 months ago #78203 by krishna1088
krishna1088 created the topic: Can a no condition be added in looping
Hi,

I have a survey where a question group is looped for 20 times. In that say a surveyor has exit the loop at 5th time then he clicks no button at the end of the 5th time, here the condition would be no.Then the control from the loop must come out and go to different group.

How can this be done?


you can check the sample link of the test survey:

119.226.87.69/limesurvey/index.php?sid=51766&lang=en

in the above test survey link i have 5 questions where i can jump directly from question 1 to last on clicking no, but where as i can not jump from rest questions i.e 2 to 4 on clicking no. how do for questions 2 to 4 as mentioned?

thanks,
Krishna

Please Log in to join the conversation.

More
5 years 7 months ago #78211 by tfj
tfj replied the topic: Can a no condition be added in looping
Please set the permissions on your survey so that it may be viewed.

When clicking on your link, I get the following:

ERROR

We are sorry but you don't have permissions to do this.

Please contact Modelytics Admin ( This email address is being protected from spambots. You need JavaScript enabled to view it. ) for further assistance.

Thanks!

tfj

Please Log in to join the conversation.

More
5 years 7 months ago #78215 by krishna1088
krishna1088 replied the topic: Can a no condition be added in looping
now you can see

Please Log in to join the conversation.

More
5 years 7 months ago #78217 by TMSWhite
TMSWhite replied the topic: Can a no condition be added in looping
What version of LimeSurvey are you using?

1.92 makes looping easy. Take a look at this example .

I you aren't using 1.92, try loading your survey to the Demo site to see whether it works better there. If it doesn't, the issue is probably with the way the conditions are set.

Please Log in to join the conversation.

More
5 years 7 months ago #78218 by krishna1088
krishna1088 replied the topic: Can a no condition be added in looping
i m using 1.92

119.226.87.69/limesurvey/index.php?sid=51766&lang=en

you can try the above link. you will get an idea what i am asking

Please Log in to join the conversation.

More
5 years 7 months ago #78219 by tfj
tfj replied the topic: Can a no condition be added in looping
tmswhite is a great resource for the answer to your question, since, as I understand, he was behind many, if not most, of the new changes to version 1.92. I just wanted to give credit where credit is due.

That being said, I made up a quick survey of 5 questions and set the conditions as follows. I apologize if I have misunderstood your requirement:

1) For question 2, show only if the answer to question 1 is "yes"
2) For question 3, show only if the answer to question 1 is "yes" and question 2 is "yes"
3) For question 4, show only if the answer to question 1 is "yes" and question 2 is "yes" and question 3 is "yes"

For an example of the new feature in 1.92, the relevance would be set as follows:

((Q1.NAOK == "Y") and (Q2.NAOK == "Y") and (Q3.NAOK == "Y"))

I "cheated" a little and used the conditional feature in 1.92, but it converted it to the relevance. I did this until I get more familiar with the new feature.

tfj

Please Log in to join the conversation.

More
5 years 7 months ago #78221 by TMSWhite
TMSWhite replied the topic: Can a no condition be added in looping
I tried the link, but I'd need to see the actual survey logic to make recommendations.

Please Log in to join the conversation.

More
5 years 7 months ago - 5 years 7 months ago #78223 by krishna1088
krishna1088 replied the topic: Can a no condition be added in looping
The logic is:

I have 5 groups with each question per group

G1 question yes/No, if yes then go to G2 ,if no then go G5
G2 question yes/no, if yes then g3,if no then g5
g3 question yes/no, if yes then g4,if no then g5
g4 question yes/no,if yes then g5 then submit after completing g5

how to put the relevance equation for this?

hope you understood the survey logic.


thanks,
Krishna
Last Edit: 5 years 7 months ago by krishna1088.

Please Log in to join the conversation.

More
5 years 7 months ago #78228 by TMSWhite
TMSWhite replied the topic: Can a no condition be added in looping
Sorry, I'd need to see the actual survey .lss file to assess whether the conditions in it are consistent with the logic you specified.

Assuming your variable names are q1-q5, with one question per group, the relevance equations for q1-q5 should be:
q11
q2q1=='Y'
q3q2=='Y'
q4q3=='Y'
q51

Please Log in to join the conversation.

More
5 years 7 months ago #78229 by krishna1088
krishna1088 replied the topic: Can a no condition be added in looping
I am attaching the .lss file.

File Attachment:

File Name: limesurvey...1766.lss
File Size:31 KB
Attachments:

Please Log in to join the conversation.

More
5 years 7 months ago - 5 years 7 months ago #78235 by TMSWhite
TMSWhite replied the topic: Can a no condition be added in looping
There were errors in the logic file:



Here is a corrected version of the survey:

File Attachment:

File Name: limesurvey...4-05.lss
File Size:19 KB


and a screen shot of its logic file:



I've enabled the index and previous button so you can see that it works if you navigate back and forth and change your answers.

You can also put the relevance logic at the question level instead of the group level and it will behave identically - if there are no relevant and visible questions within a group, the entire group will be skipped going both forwards and backwards.
Attachments:
Last Edit: 5 years 7 months ago by TMSWhite. Reason: attached wrong image

Please Log in to join the conversation.

More
5 years 7 months ago #78237 by TMSWhite
TMSWhite replied the topic: Can a no condition be added in looping
I have updated the documentation to show how to access the Show Survey Logic feature, and how to use it to detect and fix such survey logic errors.
The following user(s) said Thank You: krishna1088

Please Log in to join the conversation.

More
5 years 7 months ago #78242 by krishna1088
krishna1088 replied the topic: Can a no condition be added in looping
hi White,

thanks for the help. how do i download the updated lss file from the forum?

thanks,
krishna

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!