$(document).ready ( function(){
var score;
var prescore;
var sum;
$(".sub-insert").keyup(function() {
if ($("#sub1").prop('checked')) {
sum = sum + 1;
prescore = prescore + ("#sub-insert-1");
}
if ($("#sub2").prop('checked')) {
sum = sum + 1;
prescore = prescore + ("#sub-insert-2");
}
if ($("#sub3").prop('checked')) {
sum = sum + 1;
prescore = prescore + ("#sub-insert-3");
}
if ($("#sub4").prop('checked')) {
sum = sum + 1;
prescore = prescore + ("#sub-insert-4");
}
score = prescore / sum;
});
});