My JavaScript solution...
Create a multiple-numeric type question, hide it with a CSS class and place this script in the question source:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify this question
var thisQuestion = $('#question{QID}');
// Define the pool
var pool = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
// Shuffle the pool
shuffleArray(pool);
console.log('log - pool: '+ pool);
// Define the exclusions
var exclusions = {
1: [3,5,7,9,13],
2: [4,6,8,10,14],
3: [1,5,7,11,15],
4: [2,6,8,12,16],
5: [1,3,7,9,13],
6: [2,4,8,10,14],
7: [1,3,5,11,15],
8: [2,4,6,12,16],
9: [11,13,15,1,5],
10: [12,14,16,2,6],
11: [9,13,15,3,7],
12: [10,14,16,4,8],
13: [9,11,15,1,5],
14: [10,12,16,2,6],
15: [9,11,13,3,7],
16: [10,12,14,4,8]
}
// Loop through the multiple-numeric inputs
$('input:text', thisQuestion).each(function(i){
// Load the input with the first element of the pool array
var thisNumber = pool[0];
$('input:text:eq('+i+')', thisQuestion).val(thisNumber).trigger('keyup');
// Now, remove the first element of the pool array
pool.splice(0, 1);
// Remove pool elements per the exclusions
var theseExclusions = exclusions[thisNumber];
console.log('log - exclusions: '+ theseExclusions);
$.each(theseExclusions, function(i, val) {
var index = pool.indexOf(val);
if (index > -1) {
pool.splice(index, 1);
}
});
console.log('log - pool: '+ pool);
});
});
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
return array;
}
</script>
This will randomize the pool and sequentially load the inputs of the multiple-numeric with pool values, removing "exclusions" as it does so.
Here is a sample survey attached with the multiple-numeric left visible and console log items to indicate the sequential state of the pool array: