Start by coding the necessary constructed list. The parent list should be a list of all the CBC attributes. The constructed list should include all the same elements as the parent list but randomized as necessary. For example, if you want to randomize the first two attributes and the last two attributes, the constructed list needs to look like one of these: [1,2,3,4], [1,2,4,3], [2,1,3,4], or [2,1,4,3].
Now put this code in the CBC footer:
<script>
// Ordering
var order = [% ListValuesArray(RandAttList) %];
var order2 = [];
for (var i = 0; i < order.length; i++) {
var origVal = order[i];
var newVal = origVal;
for (var j = 0; j < i; j++) {
if (order[j] < origVal) {
newVal--;
}
}
order2.push(newVal);
}
// Remove spacers
var spacers = document.getElementsByClassName('spacer');
while (spacers.length > 0) {
spacers[0].parentNode.removeChild(spacers[0]);
}
// Reorder rows
var tbody = document.getElementsByClassName('cbc')[0].getElementsByTagName('tbody')[0];
var trs = tbody.getElementsByTagName('tr');
for (var i = 0; i < order2.length; i++) {
var ithOrder = order2[i] - 1;
var tr = trs[ithOrder].parentNode.removeChild(trs[ithOrder]);
tbody.appendChild(tr);
}
var inputTr = trs[0].parentNode.removeChild(trs[0]);
tbody.appendChild(inputTr);
// Fix none option
var noneOption = document.getElementsByClassName('none_option')[0];
var noneTd = noneOption.parentNode.removeChild(noneOption);
trs[0].appendChild(noneTd);
// Add spacers
var firstTr = trs[0];
var firstTrTds = firstTr.getElementsByTagName('td');
for (var i = firstTrTds.length - 1; i > 0; i--) {
var node = document.createElement('td');
node.className = 'spacer';
node.setAttribute('rowspan', order.length + 1);
node.innerHTML = ' ';
firstTr.insertBefore(node, firstTrTds[i]);
}
</script>
"RandAttList" should be replaced with the name of the constructed list. Lines 33-36 should be removed if you do not have a none option in the CBC.
When you want to know the order in which the attributes were randomized, you can simply read the values from the constructed list.
Please test this thoroughly to make sure it is working as you require.