0 votes
in SoSci Survey (English) by s139974 (175 points)

Hi there, I need a PHP Filter for the following scenario:

Depending on the answer of a question [SG01] I want to jump to a specific page.

I 've set it up in a way that there is one page with a video (html-code) and underneath the video is the question SG01.

Next I have a page with a PHP-Code:

if (value('SG01') <= 5) {
goToPage('CG3a');
} elseif (value('SG01') > 5) {
goToPage('CG3b');
}

Then I created a page CG3a and CG3b.

However, it is not working and I get the feedback that there is no variable SG01.

I don't know what to do. Thank for your help in advance.

1 Answer

+1 vote
by s109993 (10.3k points)
selected by s139974
 
Best answer

Depending on the question type, the variable might not be SG01, but something like SG01_01. You should check the variable name under the question. There is a field which states "Variables" and should give you the information you need.

A second reason ca be, that you placed the php code on the same page you placed the question. Remember that php code has to be placed on the page after the page with the question you are refering to.

by s139974 (175 points)
Thank you so very much for your fast help! The problem was indeed solved when I added _01 (e.g. SC01_01).

Thanks again!

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

...