Mandatory questions and still jump

More
4 years 4 months ago - 4 years 4 months ago #88642 by Andre_DE
Hi,

A recent survey is causing me quite some headache. All questions should be mandatory but due to the # of questions, participants should be able to move freely in the survey (next/previous, jump).

Currently I can think of two solutions, neither of which I am in favor of -
  1. Create a batch of mandatory questions at the end of the survey which have a condition checking if questions have been completed. --> Too much for 200 potential questions
  2. Write a small script which blocks the save buttun unless the answer table has been completly filled

Has anyone tried something similar already?

Thank you,
André

Version 2.05+ Build 150310
Last Edit: 4 years 4 months ago by Andre_DE.

Please Log in to join the conversation.

More
4 years 4 months ago - 4 years 4 months ago #88657 by tpartner
In the question index, questions that are unanswered are given a "missing" class so you could look for those to toggle the display of the submit button (and possibly a couple of text-display questions to explain what is happening).

Add something like this to the end of template.js:
$(document).ready(function() {
	if($('#movesubmitbtn').length > 0 && $('#index .missing').length > 0) {
		$('#movesubmitbtn').hide();
		$('.boilerplate').hide();
		$('.boilerplate:first').show();
	}
	else if ($('#movesubmitbtn').length > 0) {
		$('.boilerplate').hide();
		$('.boilerplate:last').show();
	}
});

I would also remove the submit button from the index for the whole survey.

Add this to the end of template.css:
#index .submit {
    display: none;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 years 4 months ago by tpartner.

Please Log in to join the conversation.

More
4 years 4 months ago #88676 by Andre_DE
Thank you for the feedback! Didn't expect something so quick.

Your solution implies everything to be on one page. In my case its 6 groups with a total of 200 questions.
I will try using your snippet to set the status of a hidden question at the end of each group if one or more missing class(es) has/have been found. On the last page I can then evaluate if there are any pages still to be completed and hide the send button according to your code. Sounds logic?!

Cheers,
André

Version 2.05+ Build 150310

Please Log in to join the conversation.

More
4 years 4 months ago #88683 by tpartner

Your solution implies everything to be on one page.

No, this solution is for group-by-group or question-by-question modes - otherwise there would be no question index.

Cheers,
Tony Partner

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

Please Log in to join the conversation.

More
4 years 4 months ago #88686 by Mazi
If you need the question index to check for the "missing" calss but don't want to show it to the user, you can simply use a display: none CSS style for the #index element.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.