How to use RECODE_ROTATE_ORDER and ROTATE_ORDER
Using the {!RECODE_ROTATE_ORDER} and the {!ROTATE_ORDER} commands, will capture the rotation order of response items and questions respectively.
This command captures the order of response items displayed. It has the same format and meaning as the !ROTATE_ORDER command, except that it is designed to capture the order of items on a !FIELD rotate list.
The syntax is:
{ HIDDENVAR: .<LENGTH> HIDE!VARIABLE }{!RECODE_ROTATE_ORDER,<LABEL OF HIDDENVAR>,[,NOBLOW] }
You first need a question to store the result in. This needs to be long enough to store the order, for instance, if you have 101 codes, it needs to be3 * 101 = 303 columns long to store the order for all questions.
Then the statement just requires “!Recode_rotate_order,label”. It will store the position of the questions in the order they are asked, for instance, “4321” if the 4th code was displayed first, the 3rd code displayed second, the 2nd code displayed third, and the 1st code displayed last.
NOTE: If you have 5 !ROTATE blocks but only one !Recode_rotate_order statement, each !Rotate block in succession will save its order to the question referenced in the !Recode_rotate_order statement unless you use {!-Recode_rotate_order} to turn it off.
Sometimes you will only want to record the first “N” items asked; to do so, set the variable length to the length need for that many items and add the parameter “noblow“ to the statement. This will allow the program to save just that many items without blowing due to lack of space.
Example:
''Set up a hidden variable to hold the rotate order - this must be large enough to hold all items{ RECODEVAR: .10 HIDE !VARIABLE }''Recode Statement using the Hidden Variable{ !RECODE_ROTATE_ORDER,RECODEVAR }''Rotate seed to rotate the list items { ROTLOC: HIDE !VARIABLE,NUMERIC_ONLY,10,10 }{ Q1:Which do you prefer?!FIELD!ROTATE,SCRAMBLE,,[ROTLOC]01 Sony02 Toshiba03 Apple04 IBM05 Dell!ENDROTATE }''Turn off so that it does not record any other rotated items{ !-RECODE_ROTATE_ORDER }
The “ROTATE_ORDER” compiler directive stores the order of the questions asked in a following !ROTATE block. It will work for all rotate types, but is most useful for !ROTATE,SCRAMBLE as there was no easy way to record the order.
The syntax is:
{ HIDDENVAR: .<LENGTH> HIDE!VARIABLE }{ !ROTATE_ORDER,<LABEL OF HIDDENVAR>, [ASKED/NOBLOW] }
Then the “Rotate_order” statement just requires “!Rotate_order,label”. It will store the position of the questions in the order they are asked, for instance, “4321” if the 4th question was asked first, the 3rd question asked second, the 2nd question asked third, and the 1st question asked last.
NOTE: If you have 5 !ROTATE blocks but only one !Rotate_order statement, each !Rotate block in succession will save its order to the question referenced in the !Rotate_order statement unless you use {!-Rotate_order} to turn off the storing of rotate orders.
To limit the list to the items that are askable, eg. to exclude !generate or !expression statements in the rotate, add the parameter “asked”.
Example:
''Hidden Variable to hold the rotate order - This must be large enough to hold all questions{ ROTATEVAR: .5 HIDE !VARIABLE }''Rotate order statement using the hidden Variable{ !ROTATE_ORDER,ROTATEVAR } ''Rotate seed to rotate the questions{ ROTLOC: HIDE !VARIABLE,NUMERIC_ONLY,10,10 }{ !ROTATE,SCRAMBLE,,[ROTLOC] }>REPEAT $A=1,2,3,4,5{ Q$A:$A QUESTION TEXT!FIELD1 12 2 }>ENDREPEAT{ !ENDROTATE }''Turn off so that it does not record any other rotated questions{ !-ROTATE_ORDER }
NOTE: To figure out how many columns are needed, if your list items or questions are 1-9 then 1 column per item or question is needed, 10-99 then 2 columns per item or question is needed, 100-999 then 3 columns per item or question is needed, and so forth.