Problem with Scale Item Randomization
Dear SoSci Survey Support Team,
We are requesting your assistance with implementing item randomization in our questionnaire.
Our Goal:
Within one question, 10 randomly selected situations from 22 available situations should be presented to participants for evaluation on a scale.
Our Implementation:
- Question Type: Scale (labeled intermediate values) with 22 items (A302_01 to A302_22)
- Randomization: Via internal variable (A301) with 12 items to store the selected situations
- PHP Code:
- Randomization and storage of the 10 selected item numbers
- At the scale question:
question('A302', $itemsZuZeigen)
to display only the selected items
The Problem:
The randomization works only in debug mode when we jump directly to the page with the scale. During normal clicking through the questionnaire, only error messages are displayed.
What we have already tried:
- Scale question hidden and displayed only via PHP code
- Internal variable placed on separate page
- Various PHP code variants tested
- Page order verified
Our current structure:
- Page 3: Internal variable A301 (hidden)
- Page 4: PHP code for randomization
- Page 5: PHP code + question() call for A302
Our assumption:
There seems to be a problem with the execution order or storage of PHP variables between page calls.
Could you please help us solve this problem? We would be happy to provide you with access to our test questionnaire.
Thank you for your support!