tt
This commit is contained in:
@@ -115,9 +115,9 @@
|
|||||||
echo "<div id=\"ppp\" ppp=\"".$ppp."\"></div>\n<div class=\"section\" id=\"hiddenBefore\" style=\"display:none\"><h5> 单选题</h5>\n";
|
echo "<div id=\"ppp\" ppp=\"".$ppp."\"></div>\n<div class=\"section\" id=\"hiddenBefore\" style=\"display:none\"><h5> 单选题</h5>\n";
|
||||||
//创建随机数组
|
//创建随机数组
|
||||||
$randomArray = array_rand(range(1,107),$p+1);
|
$randomArray = array_rand(range(1,107),$p+1);
|
||||||
for($i = 1;$i <= $p;$i++){
|
// for($i = 1;$i <= $p;$i++){
|
||||||
echo $randomArray[$i]." ";
|
// echo $randomArray[$i]." ";
|
||||||
}
|
// }
|
||||||
shuffle($randomArray);
|
shuffle($randomArray);
|
||||||
for($i = 1;$i <= $p;$i++){
|
for($i = 1;$i <= $p;$i++){
|
||||||
$random = $randomArray[$i];
|
$random = $randomArray[$i];
|
||||||
|
|||||||
2
test.php
2
test.php
@@ -49,7 +49,7 @@
|
|||||||
$sql5 = "UPDATE UserAnswer SET $c=$d WHERE Student_ID=$_POST[student_id]";
|
$sql5 = "UPDATE UserAnswer SET $c=$d WHERE Student_ID=$_POST[student_id]";
|
||||||
$sql7 = "SELECT * FROM Persons WHERE num=$_POST[$b]";
|
$sql7 = "SELECT * FROM Persons WHERE num=$_POST[$b]";
|
||||||
$rowquestion = mysqli_fetch_array(mysqli_query($sql7))['answer'];
|
$rowquestion = mysqli_fetch_array(mysqli_query($sql7))['answer'];
|
||||||
if($_POST[$a] == $rowquestion){
|
if($_POST[$a] == $rowquestion && $_POST[$a] >= 1) {
|
||||||
$scort++;
|
$scort++;
|
||||||
}
|
}
|
||||||
if (!mysqli_query($con,$sql5))
|
if (!mysqli_query($con,$sql5))
|
||||||
|
|||||||
Reference in New Issue
Block a user