From e8291e1a208bc7f550937ea3720f7273bd4e1d86 Mon Sep 17 00:00:00 2001 From: xice09 Date: Thu, 31 May 2018 00:37:00 +0800 Subject: [PATCH] tt --- index.php | 6 +++--- test.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 03dc430..dfff9ef 100644 --- a/index.php +++ b/index.php @@ -115,9 +115,9 @@ echo "
\n
  单选题
\n"; //创建随机数组 $randomArray = array_rand(range(1,107),$p+1); - for($i = 1;$i <= $p;$i++){ - echo $randomArray[$i]." "; - } + // for($i = 1;$i <= $p;$i++){ + // echo $randomArray[$i]." "; + // } shuffle($randomArray); for($i = 1;$i <= $p;$i++){ $random = $randomArray[$i]; diff --git a/test.php b/test.php index d91d89f..c29b30e 100644 --- a/test.php +++ b/test.php @@ -49,7 +49,7 @@ $sql5 = "UPDATE UserAnswer SET $c=$d WHERE Student_ID=$_POST[student_id]"; $sql7 = "SELECT * FROM Persons WHERE num=$_POST[$b]"; $rowquestion = mysqli_fetch_array(mysqli_query($sql7))['answer']; - if($_POST[$a] == $rowquestion){ + if($_POST[$a] == $rowquestion && $_POST[$a] >= 1) { $scort++; } if (!mysqli_query($con,$sql5))