0 votes
in SoSci Survey (dt.) by s158467 (110 points)

Guten Tag!

Ich arbeite an einem Fragebogen für Dolmetscher. Die Nutzer sollen auf S. 1 in einer "Offenen Nennung" ihre Arbeitssprachen angeben (und eine weitere Frage beantworten). Wird hier mehr als eine Sprache angegeben, soll auf S. 2 eine Bemerkung erscheinen ("Sie haben mehr als zwei Sprachen angegeben.") sowie die Bitte, aus den angegebenen Sprachen diejenige auszuwählen, für die weiteren Fragen beantwortet werden sollen.

Leider funktioniert die Übergabe der Eingaben nicht (und damit auch nicht der Filter); der Fragebogen springt automatisch auf S. 3. Klicke ich aber in S. 3 auf "Zurück" und dann von S. 1 wieder auf "Weiter", funktioniert die Übergabe plötzlich (und auch der Filter).

php-Code auf S. 1:

question('IA13');

$frage = 'IA13';
$items = array();
for ($i=1; $i<=9; $i++) {
  $itemID = id($frage, $i);
  $antwort = value($itemID);
  if (trim($antwort) != '') {
    replace('%text'.$i.'%', $antwort);
    $items[] = $i;
        }
   }
registerVariable($items);

php-Code auf S. 2:

if (count($items) > 1) {
    question('IA10');
}

und

if (count($items) > 1) {
    question('IA14', $items);  // Welche der SAS am häufigsten?
}

Beim Debuggen auf S. 3 wird Folgendes ausgegeben:

[Verarbeitung]	Lese Antworten von Seite 1
[Information]	Antwort auf IA13x01 = Chinesisch
[Information]	Antwort auf IA13x02 = Japanisch
[Information]	Keine Antwort für IA13x03
[Information]	Keine Antwort für IA13x04
[Information]	Keine Antwort für IA13x05
[Information]	Keine Antwort für IA13x06
[Information]	Keine Antwort für IA13x07
[Information]	Keine Antwort für IA13x08
[Information]	Keine Antwort für IA13x09
[Information]	Antwort auf IA13x01 = Chinesisch
[Information]	Antwort auf IA13x02 = Japanisch
[Information]	Keine Antwort für IA13x03
[Information]	Keine Antwort für IA13x04
[Information]	Keine Antwort für IA13x05
[Information]	Keine Antwort für IA13x06
[Information]	Keine Antwort für IA13x07
[Information]	Keine Antwort für IA13x08
[Information]	Keine Antwort für IA13x09
[Information]	Antwort auf IA13 = 2
[Information]	Antwort auf IA05_01 = 2
[Information]	Antwort auf IA05_02 = 2
[Information]	Antwort auf IA05_03 = 2
[Information]	Antwort auf IA05 = 3
[Information]	Fragen bisher zu 100% vollständig beantwortet
[Verarbeitung]	Erstelle Seite 2 in Fragebogen base
[Information]	Die Seite zeigt keine Inhalte, automatisch weiter mit Seite Nr. 3
[Verarbeitung]	Erstelle Seite 3 in Fragebogen base
[Inhalt]	Erstelle Frage IA01
[Inhalt]	Erstelle Frage IA02
[Inhalt]	Erstelle Frage IA03

Beim Debuggen nach dem Zurückspringen auf S. 1:

[Verarbeitung]	Lese Antworten von Seite 2+3
[Information]	Keine Antwort für IA01x01
[Information]	Keine Antwort für IA01x02
[Information]	Keine Antwort für IA01x03
[Information]	Keine Antwort für IA01x04
[Information]	Keine Antwort für IA01x05
[Information]	Keine Antwort für IA01x01
[Information]	Keine Antwort für IA01x02
[Information]	Keine Antwort für IA01x03
[Information]	Keine Antwort für IA01x04
[Information]	Keine Antwort für IA01x05
[Information]	Antwort auf IA01 = 0
[Information]	Ungültige Antwort für IA01
[Information]	Keine Antwort für IA02x01
[Information]	Keine Antwort für IA02x02
[Information]	Keine Antwort für IA02x03
[Information]	Keine Antwort für IA02x04
[Information]	Keine Antwort für IA02x05
[Information]	Keine Antwort für IA02x01
[Information]	Keine Antwort für IA02x02
[Information]	Keine Antwort für IA02x03
[Information]	Keine Antwort für IA02x04
[Information]	Keine Antwort für IA02x05
[Information]	Antwort auf IA02 = 0
[Information]	Ungültige Antwort für IA02
[Information]	Keine Antwort für IA03x01
[Information]	Keine Antwort für IA03x02
[Information]	Keine Antwort für IA03x03
[Information]	Keine Antwort für IA03x04
[Information]	Keine Antwort für IA03x05
[Information]	Keine Antwort für IA03x01
[Information]	Keine Antwort für IA03x02
[Information]	Keine Antwort für IA03x03
[Information]	Keine Antwort für IA03x04
[Information]	Keine Antwort für IA03x05
[Information]	Antwort auf IA03 = 0
[Information]	Ungültige Antwort für IA03
[Information]	Fragen bisher zu 33% vollständig beantwortet
[Verarbeitung]	Erstelle Seite 1 in Fragebogen base
[Inhalt]	Erstelle Frage IA15
[Inhalt]	Erstelle Frage IA13
[Information]	value("IA13x01") = "Chinesisch"
[Information]	value("IA13x02") = "Japanisch"
[Information]	value("IA13x03") = ""
[Information]	value("IA13x04") = ""
[Information]	value("IA13x05") = ""
[Information]	value("IA13x06") = ""
[Information]	value("IA13x07") = ""
[Information]	value("IA13x08") = ""
[Information]	value("IA13x09") = ""
[Inhalt]	Erstelle Frage IA05
[Information]	Folgende Platzhalter sind vorbereitet:
%text1% = (Text) Chinesisch
%text2% = (Text) Japanisch

Könnte mir vielleicht jemand weiterhelfen?

Herzlichen Dank!

1 Answer

0 votes
by SoSci Survey (306k points)
question('IA13');
$frage = 'IA13';
...
$antwort = value($itemID);

Sie haben die Frage und die Abfrage der Antwort auf derselben Seite. Das heißt, dass Sie mittels value() versuchen, auf die Antwort zuzugreifen noch bevor die Fragebogenseite überhaupt beim Teilnehmer ankommt.

Setzen Sie den PHP-Code für die Ermittlung der Items bitte einfach auf die nächste Seite.

by s158467 (110 points)
Super, jetzt klappt es. Herzlichen Dank für die schnelle Hilfe!

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

...