How would I pass the student's final score to a hidden form field?
<script language="javascript" type="text/javascript">
<!--
var score = 0;
var answer = new Array("1","2","3","4","5","6","7","8");
//Check and display score
function check(){
for(i=0;i<answer.length;i++){
//answer.lenght is the lenght of the answer array (in this case 8 answers
if(document.myform.elements[i].value.toLowerCase()==answer[i]){
score++;
var p=i+1;
var str="showpicture"+p;
document.getElementById(str).style.visibility="vis ible";
}
else
{
if(document.myform.elements[i].value!=""){
document.myform.elements[i].value="Wrong!";
var p=i+1;
var str="showpicture"+p;
document.getElementById(str).style.visibility="hid den";
}
}
}
score = 0;
}
//-->
</script>
<form name="form1" method="post" action="">
<input type="hidden" name="hiddenField">
</form>