').appendTo(msg);
let colmsg = $('
').appendTo(msg);
$('.otree-btn-next').prop('disabled', true);
$(target)
.append(render_game(game))
.append(msg)
;
rowmsg.html('Please choose a row.');
var timer = makeTimer(min_time);
$('.game-row').click(function() {
$('#please_wait').show();
timer.then(value => {
$('.otree-btn-next').prop('disabled', false);
$('#please_wait').hide();
});
let row = parseInt($(this).attr('value'));
rowmsg.html(`You chose row ${row+1}.`);
$('.game-cell').addClass('unchosen');
for (let i in game) {
if (i == row) {
// Mark chosen row
$(`.game-row-${i}`)
.removeClass('unchosen')
.addClass('chosen')
;
}
else {
$(`.game-row-${i}`)
.removeClass('chosen')
.addClass('unchosen')
;
}
}
$('#id_choice').val(String(row)); // record choice
// $('.otree-btn-next').prop('disabled', false);
});
}