Welcome, Guest
Username: Password: Remember me

TOPIC: Mandatory questions and still jump

Mandatory questions and still jump 1 year 10 months ago #88642

  • Andre_DE
  • Andre_DE's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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é
Last Edit: 1 year 10 months ago by Andre_DE.
The administrator has disabled public write access.

Re: Mandatory questions and still jump 1 year 10 months ago #88657

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4193
  • Thank you received: 788
  • Karma: 359
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 1 year 10 months ago by tpartner.
The administrator has disabled public write access.

Re: Mandatory questions and still jump 1 year 10 months ago #88676

  • Andre_DE
  • Andre_DE's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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é
The administrator has disabled public write access.

Re: Mandatory questions and still jump 1 year 10 months ago #88683

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4193
  • Thank you received: 788
  • Karma: 359
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Mandatory questions and still jump 1 year 10 months ago #88686

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.178 seconds
Donation Image