0 votes
in SoSci Survey (English) by s073024 (120 points)

In my survey I ask them to choose their languages. If they choose only one language, another question in relation to bilingualism is not relevant anymore. How can I filter that question? The condition would be: if only one item is chosen, question XY should be skipped.
Thanks very much for your help!

PS: It should be the html- code

1 Answer

0 votes
by SoSci Survey (301k points)

Using PHP code, you can use the function getItems() to retrieve a list of checked items.

$checked = getItems('AB01', 'is', 2);

And the you can use count() to count this list:

if (count($checked) > 1) {
  question('BB02');
}

Tip: Ic case that AB01 is asking for the spoken languages and BB02 for the primary language, than it may be useful to copy the primary language (either from AB01 oder BB02) to an internal variable via put().

$checked = getItems('AB01', 'is', 2);
if (count($checked) > 1) {
  question('BB02', $checked);
} else {
  put('IV01_01', $checked[0]);
}

... and on next page

$checked = getItems('AB01', 'is', 2);
if (count($checked) > 1) {
  put('IV01_01', value('BB02'));
}
by s073024 (120 points)
Thank you very much! It worked! :)

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...