Hello, my question is regarding randomization of attributes order. I know that there is a tutorial on it , but my doubt is with understanding what they meant in the steps in real terms, can someone help me with it ? I have uploaded the steps and highlighted the parts I did not understand how to actually put in Survey engine, for example first how to store it in derived value, and next if I add textfield (blue colour) and put that command just before the choice tasks begin , then nothing changes and rather a textbox full of codes are shown in preview. Kindly help me with it.
sure,
Step 1. tells you to create a ‘derived value’ - this is added like any other element like questions.
The derived value allows on the fly calculations - which will be stored in a variable that is the same as the name you give the element. Name it a name ‘order’ and ay calculations will appear in this variable - which can be accessed in other code as $order - this is how perl refers to variables.
The code snippet below that just produces a random sequence of 1,2,3,4,5 as a string separated b a comma. From then on, accessing $order in code will pipe back that generated sequence - which is important for the next step.
- The textfield - this is a generic surveyengine text output - which can also be html and javascript.
In this case we are using it to display/execute a javascript program that
- pulls the $order string into javascrip
- shuffles screen elements based on the sequence in $order
- This is hopefully self evident. If you have multiple experiments, you need to repeat the process for each - otherwise you’ll have everything ordered the same way - or worse you’ll have difference sequence lengths that wont work.
I hope this helps