0 votes
in SoSci Survey (English) by s276668 (140 points)

I want to insert different titles for my pages based on the randomized order in which they appear. So the frist two pages shall always have the title "A", the next two pages always the title "B" and so on, even when the content differs based on the randomization of the pages (they are randomized in pairs). How can I do that?
Thank you!

1 Answer

0 votes
by SoSci Survey (305k points)

Please take a look at the function loopIndex() (which is not that easy, as I just realized, it has no manual page on its own). It will tell you the position within a loop OR a page order. So, you code might look like this:

$i = loopIndex();
if ($i < 2) {
  $title = 'A';
} elseif ($i < 4) {
  $title = 'B';
} else {
  $title = 'C';
}
html('<h1>'.$title.'</h1>');

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

...