From eb0a3e6512125e01c11ff93a0391bee4688db6cc Mon Sep 17 00:00:00 2001 From: xice Date: Sat, 14 Jul 2018 22:46:39 +0800 Subject: [PATCH] remove the testpage ang fix the bug --- index.php | 1 + testdb.php | 58 ------------------------------------------------------ 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 testdb.php diff --git a/index.php b/index.php index 8e53aa3..1a1793a 100644 --- a/index.php +++ b/index.php @@ -150,6 +150,7 @@ if($_SESSION[Student_ID] != ""){ echo "
\n"; } if($flag == 0){ + $randomArray[$i]++; $i--; sleep(0.4); } diff --git a/testdb.php b/testdb.php deleted file mode 100644 index 3c5b9a0..0000000 --- a/testdb.php +++ /dev/null @@ -1,58 +0,0 @@ -\n
  单选题
\n"; - //创建随机数组 - $randomArray = array_rand(range(1,99),$p+1); - // for($i = 1;$i <= $p;$i++){ - // echo $randomArray[$i]." "; - // } - shuffle($randomArray); - for($i = 1;$i <= $p;$i++){ - $flag = 0; - $random = $randomArray[$i]; - $result = mysqli_query($con,"SELECT * FROM Persons WHERE num='$random'"); - while($row = mysqli_fetch_array($result)){ - //html - $flag = 1; - echo "
"; - echo "
". $i. ".". $row['q'] ."
\n

"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - if($row['D']){ - echo "\n\n"; - } - echo "

\n"; - echo "
\n"; - } - if($flag == 0){ - $randomArray[$i]++; - $i--; - sleep(0.4); - } - } - - // echo "
  二、判断题
"; - // $randomArray = range(1,10); - // shuffle($randomArray); - // for($i = 1;$i <= $pp;$i++){ - // $random = $randomArray[$i] + 60; - // $result = mysqli_query($con,"SELECT q FROM Persons WHERE num='$random'"); - // while($row = mysqli_fetch_array($result)){ - // $j = $i + $p; - // //echo "

".$row."

"; - // echo "
". $j. ".". $row['q'] ."
\n

\n\n\n\n

\n"; - // echo "
\n"; - // } - // } - - echo "
"; - //close linking - mysqli_close($con); - ?> \ No newline at end of file