    /**
    	Javascript used in all SelfAssessment jsp/html files.
     **/



    /**
    	Validate the form elements to ensure that at least one choice has been selected, before allowing the actual submission to occur.

    	REQUIREMENT
    		The name of all single-choice question answer elements must be "answer".

    	PARAMETER
    		form  The form object to be validated.

    	RETURNS
    		true
    			If at least one answer choice has been selected, meaning the form may be safely submitted to the servlet.
    		false
    			If zero answer choices have been selected, meaning the form *should not* be submitted.  An alert dialog box is displayed to the user.
     **/
    function alertIfPrivacyNotChecked(form){
        if(!validate.agree.checked) {
    	    alert('Please check the box to consent to the collection of information as governed by the privacy policy of this site.');
    		return false;
    	}
    	return alertIfNoAnswerSelected(form);
    }
    function alertIfNoAnswerSelected(form) {

    	var oneChecked = false;
    	for(var i = 0; i < form.answer.length; i++)  {
            if(form.answer[i].checked)  {
                oneChecked = true;
            }


    	}
        if (oneChecked == false){
             alert("Please answer the question to continue.\n");
    		 return false;
    	    }


    	return true;
    }


