Thanks @jonatandor35 so what you’re saying is in the rest of my code, for each section I’m supposed place the variable in the function? Like I have below in bold?
const section1 = [$w(“#radioGroup1”), $w(“#radioGroup2”), $w(“#radioGroup3”), $w(“#radioGroup4”)];
let s1totalCount = 0;
section1.forEach(e => {
e.onChange((event) => {
let selected = section1.filter(o => o.valid);
s1totalCount = selected.reduce((a, c) => a + Number(c.value), 0);
avg1 = Math.round(s1totalCount / section1.length);
$w(“#text57”).text = avg1.toString();
calculateFinalAvg(avg1);
})
})