I am using Javascript received from someone else (I have no JS knowledge) to display a table to run a conjoint experiment in Qualtrics. It displays fine, but when I eliminate one of the attributes for the second block (the control), the table stops displaying. I have played around with a bunch of stuff and can't figure out where I'm going wrong. Is there something wrong with this script? Thanks!
if (attribute_array.length !== values_array.length) {
alert("Your attributes array and values array do not match.");
}
var numbers_array = [];
for (var i = 0; i < attribute_array.length; i++) {
numbers_array.push(i);
}
if (!sessionStorage.random_result) {
sessionStorage.random_result = shuffle(numbers_array);
}