For more complex randomizations, such as the combination of questions and stimuli, or even for more complex HTML coding of the stimuli, it makes sense to integrate the randomization into the questionnaire using a PHP code. How it works will be explained with some examples on this page.
Note: If you want to randomize only one stimulus (image or other media files), the simple procedure described in Single Factorial Experimental Design should suffice.
Note: If you want to display only part of the random stimuli, please refer to the Randomization: within-subject (Measurement Repetition) chapter.
In any case, the first step for the following examples is to use a random generator to classify the participants into different experimental groups. Therefore a new question type Random Generator has to be created (see Create Questions).
Example:
Note shows the number “1
Number “1” is the assigned number of “group 1” and group 1 is to receive a certain stimulus
By creating this question type, you define the subdivision into different groups. Each participant is assigned to one of these groups, described below as the participant figuratively draws a “slip of paper” with the number of the group. In the field Codes (contents) write a short description of your experimental groups, e.g.:
Control group Positive case studies Negative case studies
Nach dem Speichern ergänzt SoSci Survey für jede Gruppe einen numerischen Code, z.B.
1 = Control group 2 = Positive case studies 3 = Negative case studies
What will be displayed to which group later is determined only in the next step – that is, when the corresponding PHP code is included.
As described above, so far it is only defined to which group the participant belongs (defined by the random number).
To define which group is now presented which stimulus, you need a PHP code for a filter. This is placed when Composing the Questionnaire under the random generator on the page on which the stimulus is to be displayed. This will look something like this:
Note: After placing the random generator and the PHP code, the stimuli must not be additionally explicitly embedded on the questionnaire page!
Tip: If you want to present a stimulus multiple times on different pages, you can simply embed the PHP code multiple times on different pages. You only have to include the random generator once in the questionnaire.
There are different ways to integrate a stimulus or treatment via PHP-Code into the questionnaire and also for the different stimuli the code looks slightly different in each case. The following links will redirect you to the individual explanations of the different stimuli: