0 votes
in SoSci Survey (dt.) by s139447 (140 points)

Lieber SoSci-Support,

ich erstelle grade ein Between-Subjects-Design (2x2x2) und möchte mittels des Zufallgenerators gleichmäßig auf meine Stichprobe die 8 Varianten verteilen. Hierzu habe ich auf einer Seite zunächst den Zufallsgenerator mit dem folgenden Zettel erstellt (Anzahl der Zettel pro Interview = 1):

1 = Man, Attractive, Challenging Voice
2 = Man, Attractive, Supporting Voice
3 = Man, Unattractive, Challenging Voice
4 = Man, Unattractive, Supporting Voice
5 = Woman, Attractive, Challenging Voice
6 = Woman, Attractive, Supporting Voice
7 = Woman, Unattractive, Challenging Voice
8 = Woman, Unattractive, Supporting Voice

Anschließend habe ich unterhalb des Zufallgenerators den folgenden PHP Code eingefügt (siehe unten). EX01 ist mein oben aufgeführter Zufallsgenerator und die 8 verschiedenen Gruppen sind EX02 bis EX09. Ex02 bis EX09 sind jeweils formatierter Text inkludive eines eingefügten Bildes via HTML (aus hochgeladenen Bildern).

Leider wird mir bei der Vorschau jeder Textbaustein (EX02-EX09) angezeigt. Was mache ich falsch? Ich habe auch schon über jeweils einzelne PHP codes versucht.

Vielen Dank!

if (value('EX01') == 1) {
  text('EX02');
} else {
if (value('EX01') == 2) {
  text('EX03');
} else {
if (value('EX01') == 3) {
  text('EX04');
} else {
if (value('EX01') == 4) {
  text('EX05');
} else {
if (value('EX01') == 5) {
  text('EX06');
} else {
if (value('EX01') == 6) {
  text('EX07');
} else {
if (value('EX01') == 7) {
  text('EX08');
} else {
if (value('EX01') == 8) {
  text('EX09');
}
}
}
}
}
}
}
} 

1 Answer

0 votes
by SoSci Survey (305k points)

Leider wird mir bei der Vorschau jeder Textbaustein (EX02-EX09) angezeigt.

Vermutlich liegt es an Top 3: Problemlösung bei Filterfragen

Unabhängig davon würde ich dringend empfehlen, den PHP-Code zu vereinfachen und geschweifte Klammern wegzulassen:

if (value('EX01') == 1) {
  text('EX02');
} elseif (value('EX01') == 2) {
  text('EX03');
} elseif (value('EX01') == 3) {
  text('EX04');
}
by s139447 (140 points)
Vielen Dank für die Antwort. Mein PHP Code sieht jetzt wie folgt aus:

if (value('EX01') == 1) {
  text('EX02');
} elseif (value('EX01') == 2) {
  text('EX03');
} elseif (value('EX01') == 3) {
  text('EX04');
} elseif (value('EX01') == 4) {
  text('EX05');
} elseif (value('EX01') == 5) {
  text('EX06');
} elseif (value('EX01') == 6) {
  text('EX07');
} elseif (value('EX01') == 7) {
  text('EX08');
} elseif (value('EX01') == 8) {
  text('EX09');
}

Die Debug Information gibt das folgende an:

[Information]    Interview started (new case no. 299)
[Information]    Questionnaire 2 from project test199411 will be used
[Processing]    Create page 5 in questionnaire 2
[Content]    Create question EX01
[Information]    The random generator EX01 drew these codes: 2
[Information]    value("EX01") = 2
[Information]    value("EX01") = 2
[Content]    Show text EX03
[Content]    Create question EX02
[Content]    Create question EX03
[Content]    Create question EX04
[Content]    Create question EX05
[Content]    Create question EX06
[Content]    Create question EX07
[Content]    Create question EX08
[Content]    Create question EX09

Was sagt mir das nun?
by SoSci Survey (305k points)
Das was ich oben schon schrieb: Klicken Sie bitte auf die verlinkte Anleitung "Problemlösung bei Filterfragen" und lesen Sie dort "Top 3" :)
by s139447 (140 points)
Entschuldigung, ich hatte Top 3 zunächst nicht korrekt verstanden! Es funnktioniert!! :)

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

...