0 votes
in SoSci Survey (English) by s312396 (110 points)

I have a scale question ranging from 0 to 3 that I want to use as a filter. If the response is 1, 2, or 3, it should trigger a follow-up question on the next page. If the response is 0, the follow-up question should be skipped and not displayed. I’ve tried everything using PHP, but it’s not working as intended.

ideas:

A)
if (value('SM') == 1 || value('SM') == 2 || value('SM') == 3) {

question('IN41');

}

if (value('SM') == 0) {

goToPage('AND');

}

B)
if (value('SM') >= 1) {
question('IN41');
}

1 Answer

0 votes
by s109993 (12.4k points)

I think that could be a bracket issue:

if ((value('SM') == 1) or (value('SM') == 2) or (value('SM') == 3)) {

question('IN41');

} else {

goToPage('AND');

}

Else is maybe safer, in case the question SM has not been answered at all.

If you write "but it’s not working as intended" it would be helpful if you say, what happened exactly. Was there an error? Or was the outcome wrong?

Please also check, if your scale question has really the id "SM" - usually I would expect something like A001 (four digits).

by s312396 (110 points)
Thank you for your kind response. I have renamed the question IN39 to SM.  My issue is that when the user selects 0 on a scale from 0 to 3, the next page (let’s call it AA) appears. However, it should only open if the user selects 1-3. If 0 is selected, the user should be directed to AND instead of AA.
by s312396 (110 points)
And yeah the issue is still there :/
by s109993 (12.4k points)
Then I would work with goToPage();

if (value('SM') == 0) {

goToPage('AND');

}

Here everyone else would get the next page "AA", only when someone would answer "0", they jump over the page "AA" and go directly to page "AND". This code has to be on the very top of page "AA".

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

...