时间:2021-07-01 10:21:17 帮助过:15人阅读
$qc_q1=$_POST['q1'];$qc_q2=$_POST['q2'];$qc_q3=$_POST['q3'];$qc_q4=$_POST['q4'];$qc_q5=$_POST['q5'];$qc_q6=$_POST['q6'];$qc_q7=$_POST['q7'];$qc_q8=$_POST['q8'];$qc_q9=$_POST['q9'];$qc_q10=$_POST['q10'];$qc_Choice = array($qc_q1,$qc_q2,$qc_q3,$qc_q4,$qc_q5,$qc_q6,$qc_q7,$qc_q8,$qc_q9,$qc_q10);$qc_Answer = array('a','d','d','b','b','c','d','d','c','c');$qc_total = qcFunction($qc_Choice,$qc_Answer);function qcFunction($qc_Choice,$qc_Answer){ $total=0; for($i=0;$i<10;$i++) { if($qc_Choice[i]==$qc_Answer[i]) { $total = $total + 10; }else { $total = $total + 0; } } return $total;}