Welcome, Guest
Username: Password: Remember me

TOPIC: Conditions don't stop from advancing

Conditions don't stop from advancing 2 years 8 months ago #73979

  • aaron13
  • aaron13's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
I'm trying to make a survey that requires users to select a certain answer before moving forward. My conditions seem to only slightly work.

With my multiple choice question, if you select the correct choices, the conditions will kick in and present more questions.

If you select the wrong question, you'll never see the additional questions.

The problem is if you select the wrong answers, you can just hit next and move forward, skipping a number of questions that I'd like to get presented.

I've tried to disable the next button, but can't seem to figure it out. Can someone give more advice on how to get this to work right?

I'm using Version 1.91+ Build 12170
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #73986

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2845
  • Thank you received: 358
  • Karma: 124
I am not quite sure what you exactly mean. Either you want them to skip the questions, when they didn't mark the right questions, or you want them to get kicked out of the survey.

Maybe you can explain a little more or give a real (simple) example.
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.

Re: Conditions don't stop from advancing 2 years 8 months ago #73995

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
Maybe you can also solve your problem by using quotas?

When using conditions, please explain everything in more detail and also attach your survey so we can have a look.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #74060

  • aaron13
  • aaron13's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
I've attached the survey.

On the third page, there is a question "have you scheduled your physical". We want our guards to choose yes. With how the conditions are setup, if you choose yes, you are presented with more questions that must be answered.

Right now, if you choose no, you can still move forward with the survey.

I'd like the no to be a dead end, so that if you select no, you can't go any further.

The same thing happens again on page 4 and I believe 6. With six being the bigger issue. We want the guards to select only "Contra Loma, Cull Canyon, Shadow and Temescal" If that combo is chosen, another question is presented. If it isn't chosen, I'd like it to stop until that combo is chosen.

Can I do this with limesurvey?
Attachments:
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #74063

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
I'd add a question on the page asking whether they had the physical. If they say No, have the question appear, and say something like "You must get a physical before you can continue with this survey" (or whatever you need it to say). Make that question mandatory, and set the validation criteria such that it can never be answered (e.g. make a numeric input, and set the Validation regular expression to "/I had a physical/"). Once they say Yes that they had a physical, that question would disappear, and they could proceed with the survey.
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #74064

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2845
  • Thank you received: 358
  • Karma: 124
It should be quite simple. Either you create a quota for "no" that is zero, if the questionnaire should be completely finished. So when someone answers "no" the quota is checked by limesurvey and the questionnaire will be closed, because the quota is always full.

If you just want to skip some later questions but they should for example answer some questions at the end or see an end-page, then you need to apply a condition to every following question which should not be shown in case they answer no.
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!
Last Edit: 2 years 8 months ago by holch.
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #74066

  • aaron13
  • aaron13's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
Looking into what quotas do, I don't think I want it to end the survey, I just want it to be a locked door that doesn't let them progress until they answer correctly.

The validation might be a better choice in this instance, although I'm not exactly sure how to set that up.

Also, in the questions where they have to select only the 4 specific locations, I'm not sure the validation will work there. Will it?
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #74088

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
aaron13 wrote:
Looking into what quotas do, I don't think I want it to end the survey, I just want it to be a locked door that doesn't let them progress until they answer correctly.
In this case you can use some customized Javascript which is called when clicking next and shows a pop up as long as the correct answer wasn't chosen.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Conditions don't stop from advancing 2 years 8 months ago #74133

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 804
  • Karma: 368
You could use javaScript to disable the Next/Submit button until the question is answered as required. You can put some text in the question indicating that it must be answered "Yes" to continue with the survey.

So in group 3...

1) Set up your survey to use JavaScript.

2) Add the following script to the source of the yes-no question.

The script initially checks if the yes-no is answered and sets the "disabled" attribute of the "Next" button accordingly. It also puts a listener on the yes-no radios to toggle the "disabled" attribute of the "Next" button.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() { 
 
		// Set the initial state of the "Next" button
		if($('.yes-no input.radio[value="Y"]').attr('checked') != true) {
			$('#movenextbtn').attr('disabled', true);
		}
 
		// A listener on the Yes-No radios to toggle the disabled attribute of the "Next" button
		$('.yes-no input.radio').click(function(){
			if($(this).attr('value') == 'Y') {
				$('#movenextbtn').attr('disabled', false);
			}
			else {
				$('#movenextbtn').attr('disabled', true);
			}
		});
    });
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.162 seconds
Donation Image