====== Single Factorial Design ====== This tutorial explains how to implement a simple single factorial questionnaire experiment (split ballot) with SoSci Survey without [[en:create:php|PHP code]]. It also explains the basics of randomization. Please read through these instructions first, even if you want to use an experimental design. In further instructions more complex implementations will be explained ([[en:create:randomization]]). ===== Basics ===== Randomization (without repeated measures) means randomly assigning a participant to an experimental group. Depending on the assigned group, a question, text, image, or video is then varied (the treatment or stimulus). **Note:** Even if the goal is "only" that, for example, half of the participants should answer question A and the other half of the participants should answer question B (random selection), or that the groups are presented with different stimuli, conceptually a division into experimental groups A and B occurs. The assignment of participants to groups (randomization) can be thought of as if each participant were to draw a lot from a large lottery drum. On this lot, first of all, there is a number (code) for the experimental group. Then it's on to the experimental lab -- Lab 1 for all with code 1, Lab 2 for all with code 2, and so on. In the questionnaire it is a bit easier with the notes: Here you only need a question type [[en:create:questions:random]] in which you enter which "notes" there are. In addition, it is immediately noted what is hidden behind the code in each case. You can enter here, for example, the name of the group, the stimulus (if it is a short text) or its file name (if it is an image). The random generator is then placed in the questionnaire on a page like a normal question. When the participant comes to the page, he is assigned one of these notes. During the draw, the random number generator writes the code of the drawn note into the data set. This is needed for the evaluation and possibly for more sophisticated variants of randomization. The next step is to apply the experimental treatment, which in the online survey is usually the presentation of a stimulus. The following explains the experimental variation of images, audio and video. If questions and texts (not just words) need to be randomized, you will need the [[en:create:randomization-php|Randomization with PHP-Code]] later. ===== Preparation ===== Images, videos and audios are basically randomized the same way, only the HTML codes for displaying them look slightly different. This tutorial first describes how to randomize images, and then explains what changes for videos and audio files. ==== Step 1: Stimuli Upload ==== If you want to use images, you may first need to save them in a web-ready format with a suitable pixel size. This is explained in more detail under [[en:create:images]]. The media files (images, videos, audio files) are uploaded to the survey server under **Image and Media Files**. More about this under [[en:create:media|Media files in the questionnaire (audio, video, documents)]]. **Note:** Make a note of the file names after uploading, as you will need them in a later step! ==== Step 2: Random Generator ==== For the next step you have to create a random generator. A random generator is a question type, which means that you need to create a **New Question** of the type "random generator". To do this, create a new section in the **List of Questions** or open one of the existing sections. In the section you create a **New Question**. As //Type// select the "Random Generator". **Tip:** You can simply click the selection field for the //Type// and enter the name. The question type will already be suggested to you after a few letters. Now give your question (the random generator) a **Description**. After saving, the random generator receives an identifier. Using this identifier, you will later also find the associated variable in the data set. **Note:** If you have difficulties creating questions, or have never done this before, please read the chapter [[en:create:basics|]]. To make the random generator display one of the uploaded images directly in the questionnaire, you need to enter the file names of the images in the random generator (3) and enter some HTML code (4) in the random generator so that the image is also displayed. ==== Step 3: Enter Filenames ==== In the random generator you have just created, now enter the file names of the images in the //Codes (contents):// field (see [[#step_1stimuli_upload|step 1]]). This could look like this, for example: giraffe.jpg car.jpg books.jpg **Important:** Pay precise attention to upper and lower case, also for the file name extension. If the filename is ''Giraffe.JPG'', neither ''giraffe.JPG'' or ''Giraffe.jpg'' would work! After saving ({{:button.save.png?nolink|button to save}}), the random generator automatically assigns a numerical code to the images. It will look like this: 1 = giraffe.jpg 2 = car.jpg 3 = books.jpg **Note:** If you do not want to show any image at all to an experimental group (control group), enter a tilde (~) in one line. The tilde ensures that the random generator does not display any HTML code (see below) when this note is dragged. 1 = giraffe.jpg 2 = car.jpg 3 = books.jpg 4 = ~ ==== Step 4: HTML-Code ==== The random generator can now pull one of the filenames -- but it doesn't know what you want to do with it yet. In this case, we want to display the image saved under the file name in the questionnaire. Therefore we use a small piece of HTML code. Enter the following HTML code in [[en:create:questions:random]] under //Display Contents//:
But maybe you want to make sure that the image is centered (''text-align: center''), and that there is a little space at the top and bottom (''margin: 3em 0'') and that oversized images (e.g. also when displayed on mobile devices) are automatically reduced to the page width (''max-width: 100%'')? Therefore you can use the following refined HTML-Code:
When the random generator is then displayed in the questionnaire, it replaces the [[:en:create:placeholders]] ''%random%'' with the drawn note. ==== Step 5: Questionaire ==== Finally, you need to tell SoSci Survey where you want the image to be displayed in the questionnaire in the first place. To do this, place the random generator in the desired position under **Compose Questionnaire** (for further reading: [[:en:create:questionnaire]]). For testing, start the questionnaire on the page with the random generator ({{:button.debug.here.gif?nolink|Start questionnaire from current page}}). **Tip:** If you just reload the questionnaire page in the browser (F5 key), the questionnaire will always show the same image. Under **Compose Questionnaire**, start a new interview ({{:button.debug.here.gif?nolink|Start Questionnaire from Current Page}}) so that a new note is drawn. ===== Variants: Audio und Video ===== Videos and audio files can in principle be integrated in the same way as images. But the HTML code in [[en:create:questions:random]] looks different. More about this in the tutorial [[en:create:media|Media files in questionnaire]]. ==== Stimulus: Video ==== Enter the file names of the videos under //Codes (Contents)// in the random generator, e.g. slow01.mp4 slow02.mp4 fast01.mp4 fast02.mp4 Under //Display contents// you then have to enter an HTML code which will embed the corresponding video into the questionnaire. This could look like the following for videos: When it comes to the HTML code for embedding videos, you have numerous design options. For example, you can show/hide certain controls or start the video automatically. You can read more about this in [[:en:create:media#embedding_videos_using_HTML5|Embedding Videos using HTML5]] and in the many documentations on the HTML tag ''