Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Multiple choice subquestion logic

Multiple choice subquestion logic 9 Monate 2 Tage her #101665

  • rui_b
  • rui_bs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
Hello all,

is it possible to filter/exclude subquestions in a multiple choice type, according to a token attribute?

Ex: I want to exclude subquestion 2, if TOKEN:attribute_1 == 1

Best regards
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Multiple choice subquestion logic 9 Monate 2 Tage her #101668

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4117
  • Dank erhalten: 760
  • Karma: 346
Untested, but placing this in the source of the multiple-choice question should do the trick:

<script type="text/javascript" charset="utf-8">	
	var attribute_1 = '{TOKEN:ATTRIBUTE_1}';
 
	$(document).ready(function() { 
 
		if(attribute_1 == 1) {
			// Hide the second sub-question			
			$('#question{QID} .question-item:eq(1)').hide();
		}
	});
</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.
Letzte Änderung: 9 Monate 2 Tage her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: rui_b

Multiple choice subquestion logic 9 Monate 1 Tag her #101672

  • rui_b
  • rui_bs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
Thank you for the quick response!

Isn't it possible to do it through relevance equation or array filter? Or even in the sub-question title by using an expression?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Multiple choice subquestion logic 9 Monate 1 Tag her #101673

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4117
  • Dank erhalten: 760
  • Karma: 346
Not as far as I know.
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.
Moderatoren: ITEd
Ladezeit der Seite: 0.141 Sekunden
Donation Image