Welcome, Guest
Username: Password: Remember me

TOPIC: Idiot Detector

Idiot Detector 1 year 8 months ago #89775

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
I thought that I had seen most everything... whoa, wrong assumption.

The request that I received includes validating a question and/or group (depending on how the admin settings are setup) at submit (or next). If the user did not answer the question(s) then they should get a javascript confirm - if the user selects cancel then it will return false back to the question(s) otherwise the submit goes through. The use case they gave is a validation message to either skip the question (confirm) or return to the question (return false).

Seems to be another usability idiot detector to me...

Has anybody else ran into this type of requirement and how did you resolve?
The administrator has disabled public write access.

Re: Idiot Detector 1 year 8 months ago #89781

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4134
  • Thank you received: 767
  • Karma: 347
It's easy to interrupt the submit with a confirm message but the code that triggers it (if questions are unanswered) would depend on the question types on the page.
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: Idiot Detector 1 year 8 months ago #89891

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
Is the global $notanswered boolean common to all questions and would that be a better catch/trigger?
The administrator has disabled public write access.

Re: Idiot Detector 1 year 8 months ago #89935

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4134
  • Thank you received: 767
  • Karma: 347
I don't know if it's common but regardless, it's server-side which would require modifying the core code.

After a little thought it gets a little messy anyway.You would need to put in something to prevent repeat confirms if the respondent goes back and modifies/answers a question. And if it were me taking the survey, I would get real cranky after a few pages with the confirms. Most surveys are onerous enough without extra clicks.
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.

Idiot Detector 1 year 3 months ago #96572

  • cmrodgers
  • cmrodgers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
I am having this same issue. Did you ever figure out a resolution?

I was thinking that the script will have to be customized based on question type but I don't even know where to start!
The administrator has disabled public write access.

Idiot Detector 1 year 3 months ago #96574

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4134
  • Thank you received: 767
  • Karma: 347
Here is a post about applying "unanswered" and "answered" classes to questions.

You could then interrupt the "Next" function, look for unanswered questions and pop up a confirm message:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
 
		// Interrupt the Next/Submit function
		$('form#limesurvey').submit(function(){
 
			// Override the built-in "disable navigation buttons" feature
			$('#moveprevbtn, #movenextbtn, #movesubmitbtn').attr('disabled', '');
 
			// Oops, found some unanswered questions...
			if ($('.unanswered').length > 0) {
				if(confirm('You have not answered all of the questions. Do you want to continue?')) { 
					return true;
				}
				else { 
					return false;
				}
			}
		});
	});
</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.
Last Edit: 1 year 3 months ago by tpartner.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.134 seconds
Donation Image