I don't see any purely Expression Manager solution but you may want to try this JavaScript solution.
1) Directly after the array question, insert a hidden (via CSS) multiple-short-text question with two sub-questions.
2) Place relevance on the two short-text "
random product" questions based on the sub-questions of the hidden question so they are only shown if the corresponding sub-question is populated.
3) Pipe text into the two short-text questions from the sub-questions of the hidden question.
4) Place this script in the source of the array question. The script will place a listener on the array and create an array of the labels for all rows with values < 3. This array is then randomized and the first two items are loaded into the sub-questions of the hidden question. This results in those labels being displayed in the text of the two short-text "
random product" questions.
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify the questions
var thisQuestion = $('#question{QID}');
var randomProducts = $(thisQuestion).nextAll('.multiple-short-txt:eq(0)');
// Listener on the array
$('input:radio', thisQuestion).on('click', function(e) {
// Build an array of products
var products = [];
$('input:radio:checked', thisQuestion).each(function(i) {
if($(this).val() < 3) {
products.push($.trim($(this).closest('tr').find('.answertext').text()));
}
});
// Randomize the array
shuffleArray(products);
// Load the hidden question inputs
$('input:text:eq(0)', randomProducts).val(products[0]).trigger('keyup');
$('input:text:eq(1)', randomProducts).val(products[1]).trigger('keyup');
});
});
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>
Sample survey attached: