0 votes
in SoSci Survey (English) by s334063 (110 points)

Hello.

I am currently designing an experimental survey for my master’s thesis using SoSci Survey and I am encountering difficulties with implementing treatment variation through the randomization of images or messages shown to participants.

Here is what I aim to achieve:

I want to randomly assign participants to one of two groups.

Each group should be shown a different version of a promotional image or text block (as a treatment condition).

After viewing the stimulus, all participants should answer the same set of Likert-scale questions related to their perception.

Despite following tutorials, I am not able to:

Correctly link the random generator to the display of images/text.

Ensure that only one image is shown to each participant based on the random assignment.

Verify if the display conditions are being applied properly (e.g., image 1 with code 1, image 2 with code 2).

Could you kindly assist me with:

A step-by-step guide or example for correctly implementing treatment variation using the random generator?

Guidance on how to assign images/text to specific codes and make sure only the corresponding content is displayed?

by SoSci Survey (348k points)
I would like to ask you for some details:

> Correctly link the random generator to the display of images/text.

Let's start with this one. How does you trial look like? Did you use PHP code?

> Ensure that only one image is shown to each participant based on the random assignment.

Did you drag the image into the page? If so, remove it.

> A step-by-step guide or example for correctly implementing treatment variation using the random generator?

Well, ... you probably have already read the step-by-step guid: https://www.soscisurvey.de/help/doku.php/en:create:randomization-media

Instead, let's find out where your code stucks.
by s334063 (110 points)
Hello,

I’m currently using the PHP code from your documentation to randomly display two different treatment images using a Random Generator. Here's the code I implemented:

php
Copy
Edit
if (value('RG01') == 1) {
  text('BT01');
  //The shown text is the HTML-Text of the image with the ID BT01
} elseif (value('RG01') == 2) {
  text('BT02');
  //The shown text is the HTML-Text of the image with the ID BT02
}
I replaced the “shown text” part with the HTML code for the images, and I also created two text elements (BT01 and BT02) containing the image HTML. However, when I run the survey, the both images appear.

Could you please let me know what might be going wrong?
by SoSci Survey (348k points)
Did you drag the BT01/BT02 element on the page? If yes, then please remove them.

Same for the images. Only the PHP-Code should be on the page - and eventually questions you want to ask about the stimulus.

If that does not solve the issue, please post the page's debug information: https://www.soscisurvey.de/help/doku.php/en:create:debugging
ago by s334063 (110 points)
This is my code:

 if (value('RG01') == 1) {
  text('BT01');
  //<img src="pro://65b3629fbe4fad42736c93ab_hardgraft-new-arrival-email.jpeg">
} elseif (value('RG01') == 2) {
  text('BT02');
  //<img src="pro://H1.jpg">
}

There is no error code shown.
Both pictures are shown instead of one. Text is also partwise shown with the pictures. Pictures are removed so this can not be the issue.

1 Answer

0 votes
ago by SoSci Survey (348k points)

Text is also partwise shown with the pictures.

In that case, you most likely used an element "HTML code" for the above code.

Please insert an element "PHP code", copy the code there, and remove the "HTML code" element.

ago by s334063 (110 points)
I don't understand it.

I will ask in German now.

Wo bekommen wir für die Bilder einen PHP Code her? Laut der Anleitung nutzen wir den korrekten Code.
ago by SoSci Survey (348k points)
Warum fragen Sie nicht gleich auf Deutsch ;) Also, soweit ich sehe, haben Sie den Code in ein Element "HTML-Code" geschrieben und nicht ein Element "PHP-Code" dafür verwendet. PHP-Code läuft aber nur, wenn es im "PHP-Code" Element steht - sonst wird es einfach nur als HTML-Code in die Seite eingebunden, Ihre Kommentare //<img..> werden dann als Bilder dargestellt, und der Filter wird als Text angezeigt.

Ziehen Sie von rechts ein Element "PHP-Code" in die Seite und verschieben Sie den Code dort hinein.

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

...