0 votes
in SoSci Survey (English) by s210296 (270 points)

I have an error hier, because I get always an screenout

PHP Code
if ((value ('SD19')!=12) || (value ('SD19')!=1)
||(value ('SD19')!=5) || (value ('SD19')!=4)
|| (value ('SD19')!=6) || (value ('SD19')!=10)
&& (value ('SD14_08')==5))
{
redirect('https://survey.maximiles.com/screenout?p=89490_9e16951e&m=%reference%');
}

What i want
SD14_08')==5 && value ('SD19')!=12), then screenout OR
SD14_08')==5 && value ('SD19')!=11), then screenout OR
.....

Pls help me, I guess there must be an error in my synatac.

Looking forward to hear form you

by SoSci Survey (304k points)
Please post the debug information of the page (https://www.soscisurvey.de/help/doku.php/de:create:debugging). Replace the

redirect('https://survey.m...

with this to actually see the information

// redirect('https://survey.m...
html('<p>Redirect</p>');
pageStop();

1 Answer

0 votes
by SoSci Survey (304k points)

Please not the || is a logical "OR"

So, let's assume that SD19 has any value, so this condition

(value ('SD19')!=12) || (value ('SD19')!=1)

will always result in a "true", and your screenout triggers.

What i want
SD14_08')==5 && value ('SD19')!=12), then screenout OR
SD14_08')==5 && value ('SD19')!=11), then screenout OR

Why don't you write it that way, then? Watch the brackets.

if (
  (value('SD14_08') == 5 && value('SD19') != 12)) ||
  (value('SD14_08') == 5 && value('SD19') != 11))
) {
  ...
}
by s210296 (270 points)
Hello,
this looks good. But I know regnoizse that I do not clearly describe what I want

If SD14_08')==5 is selected then always screenhout
BUT if  SD14_08')!=5 && SD19_08')!=5 it should be screenout too


Sorry for the confusion.  
I look forward to hearing from you.

I put now:

if (
 (value ('SD14_08')==5))
{
  redirect('https://survey.maximiles.com/screenout?p=89490_9e16951e&m=%reference%');
}


if (
(value ('SD19')!=12) && (value ('SD14_08')!=5)
|| (value ('SD19')!=1) && (value ('SD14_08')!=5)
||(value ('SD19')!=5) && (value ('SD14_08')!=5)
|| (value ('SD19')!=4) && (value ('SD14_08')!=5)
|| (value ('SD19')!=6) && (value ('SD14_08')!=5)
|| (value ('SD19')!=10) && (value ('SD14_08')!=5))
{
  redirect('https://survey.maximiles.com/screenout?p=89490_9e16951e&m=%reference%');
}
==> but this does not work too
by SoSci Survey (304k points)
Why do you write so many condition in the second IF?

> BUT if  SD14_08')!=5 && SD19_08')!=5 it should be screenout too

(value ('SD19_08') != 12) && (value ('SD14_08') != 5)

should be sufficient for what you wrote. What question type is SD19 ?

And you can easily combine that with the first one, too, because you sy that everything that is SD14_08 = 5 OR (!) SD19_08 = 5 should result in a screenout.

(value('SD14_08') == 5) || (value('SD19_08') == 5)

Because, if you had SD14_08 == 5, than you are screened out, anyway, so no need to check this in condition 2.
by s210296 (270 points)
Hi, I could figure out my issue. Now it is solved. Nethertheless, thx for your help.

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

...