Hello everyone!
I'm currently facing some difficulties in linking a random number generator with SoSci Survey and I'm hoping for your assistance.
I have a PHP code that generates a random number and, based on this number, displays a single image. Now, I want to link this random number with one specific items in SoSci Survey so that depending on which image is displayed, the corresponding item appears on the next page of the survey. I basically have three items PD_RD (PD01), PD_FM (PD02), PD_KLI (PD03) corresponding to the images.
Here's my current code for the ramdomizer:
$number = value('RD02'); // Read out the random number drawn
// Display graphic depending on the number
// (HTML code is used for this)
if ($number == 1) {
html('<p><img src="RD.JPEG"></p>');
} elseif ($number == 2) {
html('<p><img src="FM.JPEG"></p>');
} elseif ($number == 3) {
html('<p><img src="KLI.JPEG"></p>');
The problem is that the item is only displayed on a later page, so I probably need to use the random generator again on the new page? However, I'm not sure how to best implement this.
I would greatly appreciate it if someone could help me solve this issue. Thank you very much in advance for your assistance!