这是用来算GPA的,是不是我的function写错了。。(急)
<script language="javascript">function convertToGradePoint(grade)
{ var grade_point;
if(grade="A+")
grade_point="4.3";
else if(grade="A")
grade_point="4";
else if(grade="A-")
grade_point="3.7";
else if(grade="B+")
grade_point="3.3";
else if(grade="B")
grade_point="3";
else if(grade="B-")
grade_point="2.7";
else if(grade="C+")
grade_point="2.3";
else if(grade="C")
grade_point="2";
else if(grade="C-")
grade_point="1.7";
else if(grade="D")
grade_point="1";
else
grade_point="--"
return grade_point;
}
function convertAll( )
{ document.F1.BCH1408grade_point.value=convertToGradePoint(document.F1.BCH1408grade.value);
document.F1.CS1101grade_point.value=convertToGradePoint(document.F1.CS1101grade.value);
document.F1.EL1101grade_point.value=convertToGradePoint(document.F1.EL1101grade.value);
document.F1.MA1002grade_point.value=convertToGradePoint(document.F1.MA1002grade.value);
document.F1.PED1603grade_point.value=convertToGradePoint(document.F1.PED1603grade.value);
document.F1.SS1100grade_point.value=convertToGradePoint(document.F1.SS1100grade.value);
document.F1.AP1200grade_point.value=convertToGradePoint(document.F1.AP1200grade.value);
document.F1.CS1301grade_point.value=convertToGradePoint(document.F1.CS1301grade.value);
document.F1.EL1102grade_point.value=convertToGradePoint(document.F1.EL1102grade.value);
document.F1.MA1004grade_point.value=convertToGradePoint(document.F1.MA1004grade.value);
}
</script>
这段function是用来算GPA的,A+是4.3,A是4,以此类推。。。可是编完运行时,GPA显示的都是4.3,请问为什么?谢