CVA_Record the design data while the survey is running

Hello :)

In the past, I used a free format question to record the design data while the CBC is running. The code is below (thanks @Zachary).
I would like now to do the same with a CVA. However, I cannot find
with what I should replace "CBCDESIGNLEVELVALUE".
"CVADESIGNLEVELVALUE" doesn't work, and I couldn't find anything on the Unverified Perl page ( https://sawtoothsoftware.com/help/lighthouse-studio/manual/unverfiedperl.html)

Do you have any suggestions?
Thank you very much for your help!!!!!

best



<script>
$(document).ready(function(){
[% Begin Unverified Perl
# Parameters
my $concepts = 1;
my $levels = 12;

# Run
my @conceptDesigns = ();
for (my $i = 1; $i <= $concepts; $i++) {
my @levels = ();
for (my $j = 1; $j <= $levels; $j++) {
push(@levels, CBCDESIGNLEVELVALUE(QUESTIONNAME(), $i , $j));
}
push(@conceptDesigns, '[' . join(',', @levels) . ']');
}
return 'var design = [' . join(',', @conceptDesigns) . '];';
End Unverified %]

var ff = $('#[% QuestionName() %]_div').nextAll('.freeformat').get(0).id.replace(/_div$/, '');
for (var i = 1; i <= design.length; i++) {
for (var j = 1; j <= design[i - 1].length; j++) {
$('#' + ff + '_C' + i + 'A' + j).val(design[i - 1][j - 1]);
}
}
})
</script>

Resolved
5 replies