0 votes
ago in SoSci Survey (dt.) by s259587 (135 points)

Hallo liebe SoSci-Community,

ich hätte eine Frage zu einer "verschachtelten" Randomisierung.

Das aktuelle Setup sieht wie folgt aus:

    Es wurden 5 Fragen mit je 44-51Items pro Frage angelegt.
    Diese 5 Fragen stehen je auf einer Seite (nicht direkt, sondern durch Code zur Randomisierung der Item-Reihenfolge aufgerufen).
    In dem Setup für die Seite befinden sich neben dem (1) Code zur Randomisierung der Itemreihenfolge noch (2) Javascript-Code um das Antwortverhalten von Versuchspersonen zu registrieren, (3) eine IV, in welcher der String welcher mittels besagtem Code generiert wird gespeichert wird und (4) eine weitere IV, in welcher die (durch den PHP-Code randomisierte) Itemreihenfolge gespeichert wird.

Der Code zur Randomisierung der Items sieht wie folgt aus:

if (!isset($items)) {
$items= getItems('FL01', 'all');
shuffle($items);
for ($i=0; $i< count($items); $i++) {
$id = id('FL07', $i + 1);
put($id, $items[$i]);
}
$items = array_chunk($items, 10);
registerVariable($items);
}
$currentItemIndex = loopPage(count($items));
question('FL01', $items[$currentItemIndex]);

Der Code zur Randomisierung der Seiten sieht wie folgt aus (auf der Seite vor den zu randomisierenden Seiten dargestellt):

question('FL06');
$pages = valueList('FL06', NULL, 'label');
setPageOrder($pages, 'postblock');

Für die Randomisierung der Seiten wurde ein Zufallsgenerator ("FL06") angelegt, welcher im PHP-Code referenziert wird. Die Seite nach den zu randomisierenden Seiten ist auch entsprechend benannt.

Nun zum Problem:
Die Randomisierung der Items und Seiten funktioniert soweit super, nur dass immer ein Abbruch nach Seite 5/5 ("Seite 5" im Sinne des statischen Setups in SoSci) stattfindet, unabhängig davon, ob schon alle Seiten in ihrer zufällig randomisierten Reihenfolge gezeigt wurden.

Aus diesem Umstand ergibt sich die Frage, ob es möglich wäre, die Randomisierung aller 5 Seiten zu Ende auszuführen und dann erst auf die post-Randomisierungsseite weitergeleitet zu werden und wenn dem möglich wäre, an welcher Stelle das Setup hierfür modifiziert werden sollte?

Beste Grüße und bereits vielen Dank im Voraus für Ideen und Vorschläge!

ago by SoSci Survey (324k points)
> ein Abbruch nach Seite 5/5

Was zeigt die Debug-Information denn zu dem Abbruch an?

Beachten Sie bitte außerdem, dass die Kombination aus isset() und registerVariable() für jede Frage einen eigenen Variablennamen braucht - also nicht immer $items, sonst wird nur beim ersten Mal gemischt.
ago by s259587 (135 points)
Vielen Dank für Ihren Hinweis! Die Variablenbezeichnung wurde entsprechend im jeweiligen PHP-Code modifiziert.

Das Problem kann konkretisiert werden: Die Frage, welche laut Zufallsgenerator als erstes gezeigt werden soll, wird zwar angezeigt, nach dieser jedoch nicht alle weiteren Fragen in der Reihenfolge des Zufallsgenerators, sondern in ihrer "richtigen" Reihenfolge mit aufsteigender Seitenzahl.

Folgend die Debug-Information der Seite vor Beginn der randomisierten Seitenreihenfolge:

[Information]    The random generator FL06 drew these codes: 1, 5, 2, 4, 3
[Information]    valueList(FL06) = Array [FL06x01:block1, FL06x02:block5, FL06x03:block2, ...]
[Information]    According to setPageOrder() the subsequent pages will be shown next:
5 [block1], 9 [block5], 6 [block2], 8 [block4], 7 [block3], 10 [postblock]

Wie beschrieben würde hier nun block1 angezeigt werden und anschließend nicht wie gewünscht block5, block2, block4 und block3, sondern block2, block3, block4 und block5.

Folgend die Debug-Information der präsentierten Seiten ab ihrem zweiten Aufruf, also i = 1, weitere Verweise auf eine einst angelegte Seitenreihenfolge waren auf den ersten Blick nicht erkennbar:
[Information]    According to the previously set page order, page 8 [block4] is shown

Könnte die Ursache des Problems daran liegen, dass die Information für die nächste Seite (im Sinne der zufallsgenerierten Reihenfolge) beim Neuaufrufen einer Seite für die Darstellung von nur 10 Items einer "block-Frage" verloren geht? Falls ja, wie könnte die individuell generierte Information der Seitenreihenfolge mit übergeben werden? Falls nein, hätten Sie eine Idee, in welcher Richtung weiter nach dem Problem gesucht werden könnte, oder es umgangen werden könnte?
ago by SoSci Survey (324k points)
Wenn die beiden Debug-Infos aus demselben Interview stammen, dann passt da schon etwas nicht: Und zwar müsste da eigentlich stehen, dass block1 bzw. block5 gezeigt wird - aber nicht block4.

Könnten Sie bitte aus einem Interview die vollständige (!) Debug-Information der ersten 2-3 Seiten ab der Seite mit der Seiten-Randomisierung posten? Danke.
ago by s259587 (135 points)
Vielen Dank für Ihre Antwort! Verzeihen Sie bitte die verwirrende Darstellung der Informationen, die Debug-Information zu block4 diente zur Veranschaulichung fernab der ersten Randomisierung.

Im Folgenden nun die Debug-Information der ersten 3 Seiten ab der Seite mit dem Zufallsgenerator für die Seiten-Randomisierung:

Seite 1 (ab dem "Seiten-Zufallsgenerator"):
[Information]    Interview started (new case no. 26)
[Information]    Questionnaire 01 from project inattentivebehaviorfl will be used
[Processing]    Create page 4 in questionnaire 01
[Content]    Create question FL10
[Content]    Create question FL06
[Information]    The random generator FL06 drew these codes: 3, 4, 1, 5, 2
[Information]    valueList(FL06) = Array [FL06x01:block3, FL06x02:block4, FL06x03:block1, ...]
[Information]    According to setPageOrder() the subsequent pages will be shown next:
7 [block3], 8 [block4], 5 [block1], 9 [block5], 6 [block2], 10 [postblock]
[Content]    Create question FL27
[Content]    Create question FL40


Seite 2 (ab dem "Seiten-Zufallsgenerator"):
[Information]    Interview number 26 is to be continued
[Information]    Questionnaire 01 from project inattentivebehaviorfl will be used
[Information]    Retention period on page 4 has been 13 seconds
[Processing]    Reading answers from page 4
[Information]    Answer missing for FL10_01
[Information]    Answer missing for FL10_02
[Information]    Answer missing for FL10_03
[Information]    Answer missing for FL10_04
[Information]    Answer missing for FL10_05
[Information]    Answer missing for FL10_06
[Information]    Answer missing for FL10_07
[Information]    Answer missing for FL10_08
[Information]    Answer missing for FL27_01
[Information]    Answer missing for FL27_02
[Information]    Answer missing for FL27_03
[Information]    Answer to FL27_04 = 1
[Information]    Answer missing for FL27_05
[Information]    Answer missing for FL27_06
[Information]    Answer missing for FL27_07
[Information]    Answer missing for FL27_08
[Information]    Answer missing for FL27_09
[Information]    Answer missing for FL27_10
[Information]    Answer missing for FL27_11
[Information]    Answer missing for FL27_12
[Information]    Answer missing for FL27_13
[Information]    Answer missing for FL27_14
[Information]    Answer missing for FL27_15
[Information]    Answer missing for FL27_16
[Information]    Answer missing for FL27_17
[Information]    0% of the questions have been answered so far
[Information]    According to the previously set page order, page 7 [block3] is shown
[Processing]    Create page 7 in questionnaire 01
[Information]    The internal variable FL12_01 gets a value of 8.
[Information]    The internal variable FL12_02 gets a value of 42.
[Information]    The internal variable FL12_03 gets a value of 6.
[Information]    The internal variable FL12_04 gets a value of 22.
[Information]    The internal variable FL12_05 gets a value of 19.
[Information]    The internal variable FL12_06 gets a value of 13.
[Information]    The internal variable FL12_07 gets a value of 18.
[Information]    The internal variable FL12_08 gets a value of 48.
[Information]    The internal variable FL12_09 gets a value of 25.
[Information]    The internal variable FL12_10 gets a value of 28.
[Information]    The internal variable FL12_11 gets a value of 36.
[Information]    The internal variable FL12_12 gets a value of 45.
[Information]    The internal variable FL12_13 gets a value of 2.
[Information]    The internal variable FL12_14 gets a value of 33.
[Information]    The internal variable FL12_15 gets a value of 40.
[Information]    The internal variable FL12_16 gets a value of 1.
[Information]    The internal variable FL12_17 gets a value of 17.
[Information]    The internal variable FL12_18 gets a value of 12.
[Information]    The internal variable FL12_19 gets a value of 3.
[Information]    The internal variable FL12_20 gets a value of 9.
[Information]    The internal variable FL12_21 gets a value of 34.
[Information]    The internal variable FL12_22 gets a value of 49.
[Information]    The internal variable FL12_23 gets a value of 4.
[Information]    The internal variable FL12_24 gets a value of 43.
[Information]    The internal variable FL12_25 gets a value of 27.
[Information]    The internal variable FL12_26 gets a value of 38.
[Information]    The internal variable FL12_27 gets a value of 29.
[Information]    The internal variable FL12_28 gets a value of 24.
[Information]    The internal variable FL12_29 gets a value of 46.
[Information]    The internal variable FL12_30 gets a value of 20.
[Information]    The internal variable FL12_31 gets a value of 37.
[Information]    The internal variable FL12_32 gets a value of 51.
[Information]    The internal variable FL12_33 gets a value of 47.
[Information]    The internal variable FL12_34 gets a value of 31.
[Information]    The internal variable FL12_35 gets a value of 32.
[Information]    The internal variable FL12_36 gets a value of 14.
[Information]    The internal variable FL12_37 gets a value of 7.
[Information]    The internal variable FL12_38 gets a value of 15.
[Information]    The internal variable FL12_39 gets a value of 5.
[Information]    The internal variable FL12_40 gets a value of 54.
[Information]    The internal variable FL12_41 gets a value of 39.
[Information]    The internal variable FL12_42 gets a value of 52.
[Information]    The internal variable FL12_43 gets a value of 53.
[Information]    The internal variable FL12_44 gets a value of 23.
[Information]    The internal variable FL12_45 gets a value of 30.
[Information]    The internal variable FL12_46 gets a value of 16.
[Information]    The internal variable FL12_47 gets a value of 21.
[Information]    The internal variable FL12_48 gets a value of 26.
[Information]    The internal variable FL12_49 gets a value of 10.
[Information]    The internal variable FL12_50 gets a value of 11.
[Information]    The internal variable FL12_51 gets a value of 41.
[Information]    The internal variable FL12_52 gets a value of 50.
[Information]    The internal variable FL12_53 gets a value of 35.
[Information]    The internal variable FL12_54 gets a value of 44.
[Information]    loopPage() will now repeat page 7 for 5 times, starting with value 0
[Content]    Create question FL03
[Content]    Create question FL12
[Content]    Create question FL16
[Content]    Create question FL20
[Content]    Create question FL27
[Content]    Create question FL43


Seite 3 (ab dem "Seiten-Zufallsgenerator"):
[Information]    Interview number 26 is to be continued
[Information]    Questionnaire 01 from project inattentivebehaviorfl will be used
[Information]    Retention period on page 7 has been 29 seconds
[Processing]    Reading answers from page 7
[Information]    Answer missing for FL03_06
[Information]    Answer missing for FL03_08
[Information]    Answer missing for FL03_13
[Information]    Answer missing for FL03_18
[Information]    Answer missing for FL03_19
[Information]    Answer missing for FL03_22
[Information]    Answer missing for FL03_25
[Information]    Answer missing for FL03_28
[Information]    Answer missing for FL03_36
[Information]    Answer missing for FL03_42
[Information]    Answer missing for FL03_48
[Information]    Answer to FL12_01 = 8
[Information]    Answer to FL12_02 = 42
[Information]    Answer to FL12_03 = 6
[Information]    Answer to FL12_04 = 22
[Information]    Answer to FL12_05 = 19
[Information]    Answer to FL12_06 = 13
[Information]    Answer to FL12_07 = 18
[Information]    Answer to FL12_08 = 48
[Information]    Answer to FL12_09 = 25
[Information]    Answer to FL12_10 = 28
[Information]    Answer to FL12_11 = 36
[Information]    Answer to FL12_12 = 45
[Information]    Answer to FL12_13 = 2
[Information]    Answer to FL12_14 = 33
[Information]    Answer to FL12_15 = 40
[Information]    Answer to FL12_16 = 1
[Information]    Answer to FL12_17 = 17
[Information]    Answer to FL12_18 = 12
[Information]    Answer to FL12_19 = 3
[Information]    Answer to FL12_20 = 9
[Information]    Answer to FL12_21 = 34
[Information]    Answer to FL12_22 = 49
[Information]    Answer to FL12_23 = 4
[Information]    Answer to FL12_24 = 43
[Information]    Answer to FL12_25 = 27
[Information]    Answer to FL12_26 = 38
[Information]    Answer to FL12_27 = 29
[Information]    Answer to FL12_28 = 24
[Information]    Answer to FL12_29 = 46
[Information]    Answer to FL12_30 = 20
[Information]    Answer to FL12_31 = 37
[Information]    Answer to FL12_32 = 51
[Information]    Answer to FL12_33 = 47
[Information]    Answer to FL12_34 = 31
[Information]    Answer to FL12_35 = 32
[Information]    Answer to FL12_36 = 14
[Information]    Answer to FL12_37 = 7
[Information]    Answer to FL12_38 = 15
[Information]    Answer to FL12_39 = 5
[Information]    Answer to FL12_40 = 54
[Information]    Answer to FL12_41 = 39
[Information]    Answer to FL12_42 = 52
[Information]    Answer to FL12_43 = 53
[Information]    Answer to FL12_44 = 23
[Information]    Answer to FL12_45 = 30
[Information]    Answer to FL12_46 = 16
[Information]    Answer to FL12_47 = 21
[Information]    Answer to FL12_48 = 26
[Information]    Answer to FL12_49 = 10
[Information]    Answer to FL12_50 = 11
[Information]    Answer to FL12_51 = 41
[Information]    Answer to FL12_52 = 50
[Information]    Answer to FL12_53 = 35
[Information]    Answer to FL12_54 = 44
[Information]    Answer missing for FL20_01
[Information]    Answer missing for FL27_01
[Information]    Answer missing for FL27_02
[Information]    Answer missing for FL27_03
[Information]    Answer to FL27_04 = 1
[Information]    Answer missing for FL27_05
[Information]    Answer missing for FL27_06
[Information]    Answer to FL27_07 = 1
[Information]    Answer missing for FL27_08
[Information]    Answer missing for FL27_09
[Information]    Answer missing for FL27_10
[Information]    Answer missing for FL27_11
[Information]    Answer missing for FL27_12
[Information]    Answer missing for FL27_13
[Information]    Answer missing for FL27_14
[Information]    Answer missing for FL27_15
[Information]    Answer missing for FL27_16
[Information]    Answer missing for FL27_17
[Information]    0% of the questions have been answered so far
[Information]    According to the previously set page order, page 7 [block3] is shown
[Processing]    Create page 7 in questionnaire 01
[Information]    loopPage() i=1
[Content]    Create question FL03
[Content]    Create question FL12
[Content]    Create question FL16
[Content]    Create question FL20
[Content]    Create question FL27
[Content]    Create question FL43

1 Answer

0 votes
ago by SoSci Survey (324k points)

Danke für die ausführliche Debug-Information ... und da sehe ich auch das Problem:

[Information] loopPage() will now repeat page 7 for 5 times, starting with value 0

Sie können in der aktuellen Version von SoSci Survey die Befehle setPageOrder() und loopPage() nicht mischen. Diese Befehle wie auch loopToPage() und setNextPage() beenden jeweils die vorher definierte Seitenabfolge.

Wenn Sie mit rotierter Seitenabfolge und Seiten-Wiederholungen arbeiten möchten, können Sie entweder gleich zu Beginn beim setPageOrder() die Wiederholungen mit einplanen und dann mit loopIndex() arbeiten - das ist aber mitunter nicht ganz trivial. Oder Sie können mit multiLevelDown() arbeiten, und jeden Block in einem separaten Fall ablaufen lassen. Dann keommen sie aber mehrere Fälle pro Interview im Datensatz, was die Auswertung nicht gerade erleichtert.

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

...