Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: QUOTA - Terminate if a specific answer has not been checked

QUOTA - Terminate if a specific answer has not been checked 3 Monate 3 Wochen her #108009

Hi,
I'm having some trouble with QUOTA for this specific question (see image attached).

All responents have to check "product B". So I want to automatically terminate the survey if a respondent has not answered "product B".

So, if someone chooses Product B and D, they would continue the survey. If they choose only D, or only A or only C (plus a few other combinations), the survey would automatically terminate.

Can someone help me in this? :blink:
Thank you
Dario
Anhang:
Letzte Änderung: 3 Monate 3 Wochen her von holch.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 3 Wochen her #108025

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4118
  • Dank erhalten: 760
  • Karma: 346
I think you will need to use JavaScript to interrupt the "Next" function and, if "B" is not checked, click a hidden select-radio question. The quota could the be based on the hidden radio question.


.
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108118

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2608
  • Dank erhalten: 302
  • Karma: 111
Hi Tpartner!

Thank you for the response. Dario is working with me and is trying a few things in Limesurvey at the moment.

We were wondering, if we could do all this with a simple equation. The results of an equation should be written into the database, right? Or do we still have to write the results of the equation via Javascript into a hidden question?

In this case, how would we do this?
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!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108119

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4118
  • Dank erhalten: 760
  • Karma: 346
Hi Holch,

I don't think an equation question will help in this case. As far as I can see, the equation is not a supported question type for quotas.

When I get a chance, I'll attach a small sample survey.

LS 2.0 or 2.05?
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108121

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2608
  • Dank erhalten: 302
  • Karma: 111
At the moment LS 2.0, but I would like to move it to 2.05. Is there a difference between those two?
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!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108122

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4118
  • Dank erhalten: 760
  • Karma: 346
There may be small differences in the JS - 2.05 uses a much newer version of jQuery and some stuff has been deprecated.

I'll do it up for 2.0


.
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108126

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2608
  • Dank erhalten: 302
  • Karma: 111
I really need to freshn up my Javascript. I actually learned it, but then forgot most of it, because I did not use it much. And since then, the importance of Javascript has changed a lot. Before it was more for gimmicks (everyone looked down on it), now it really has found its place and is very important for webdevelopment.

Unfortunately there are still some things that LS (while quite good already), does not offer out of the box. Real screenouts for example. And this is a case where the workaround with the zero quotas fails misserably. But in market research, this is quite a common scenario.
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!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108131

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4118
  • Dank erhalten: 760
  • Karma: 346
Okay, so here's a working example.

The survey consists of the product multiple-choice question, followed by a radio question with a single answer. The radio question must be place directly after the multiple-choice.

The radio question is hidden by JavaScript and toggled depending on the "checked" state of a "mandatory" option in the products question.

A quota of 0 is placed on the single answer of the radio question.

The following script is placed in the source of the multiple-choice (I think the comments in the script adequately describe what it does). In this case I defined sub-question code "b" as mandatory.

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		// Identify the questions
		var qID = {QID};
		var thisQuestion = $('#question'+qID);
		var quotaQuestion = $(thisQuestion).nextAll('.list-radio:eq(0)');
 
		// The sub-question code of the mandatory option
		var mandatoryOptionCode = 'b';
 
		// Hide the quota question
		$(quotaQuestion).hide();
 
		// Interrupt the Next/Submit function
		$('form#limesurvey').submit(function(){
 
			// Is the mandatory option checked?
			if($('input.checkbox[id$="X'+qID+mandatoryOptionCode+'"]').is(':checked') == false) {
				// No, so click the quota radio
				$('input.radio', quotaQuestion).click();
			}
			else {
				// Yes, so uncheck the quota radio
				$('input.radio', quotaQuestion).attr('checked', false);
			}
		});
	});
</script>

Dateianhang:

Dateiname: limesurvey_survey_263439.lss
Dateigröße: 19 KB
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: dariodallago

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108135

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2608
  • Dank erhalten: 302
  • Karma: 111
Hi Tony!

Many thanks for this. I'll have a look at it later today and then adapt it to our survey.
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!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

QUOTA - Terminate if a specific answer has not been checked 3 Monate 2 Wochen her #108194

IT WORKS!
I'll make sure to addapt all things correctly, but most of the work is now done.
Thank you a lot for this, tpartner!

"Sorry, we don't care what you think - get lost!"
:lol:
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.158 Sekunden
Donation Image