First of all to reduce that large code use jquery, my solution is with jquery,
first include jquery.js in your page first then in script block write following to validate :
function validate() {
if ($("input[name=q1]:checked").val() == undefined)
return msg(1);
if ($("input[name=q2]:checked").val() == undefined)
return msg(2);
if ($("input[name=q3]:checked").val() == undefined)
return msg(3);
}
function msg(qNo) {
alert('You missed Question ' + qNo + '.');
return false;
}