I have a survey with 90 statements, grouped in categories. Easy category has apporximate 10 statements. On each statement the user has to put a score from 0 to 3, presented by radiobuttons. When all statements of a category have a score, the mean has to be calculated.
At the moment I have the calculation, but it's executed after every check of a radio-button and not only when all statements have a score. How can I only execute it after all statements have a score? (and not after giving a score after every statement)
The code for calculating and showing the mean:
var avg = $('input[id^=' + answer[0] + ']:checked').avg();
$('span[id=avg_' + answer[0] + ']').text(avg);
An example with HTML-code: http://jsfiddle.net/SFPue/