test
This commit is contained in:
@@ -120,19 +120,26 @@
|
|||||||
// }
|
// }
|
||||||
shuffle($randomArray);
|
shuffle($randomArray);
|
||||||
for($i = 1;$i <= $p;$i++){
|
for($i = 1;$i <= $p;$i++){
|
||||||
|
$flag = 0;
|
||||||
$random = $randomArray[$i];
|
$random = $randomArray[$i];
|
||||||
$result = mysqli_query($con,"SELECT * FROM Persons WHERE num='$random'");
|
$result = mysqli_query($con,"SELECT * FROM Persons WHERE num='$random'");
|
||||||
while($row = mysqli_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
//html
|
//html
|
||||||
|
$flag = 1;
|
||||||
echo "<div class=\"spbq\" name=\"div_e\"><div class=\"biankuang biankuang_1\"></div><div class=\"biankuang biankuang_2\"></div><div class=\"biankuang biankuang_3\"></div><div class=\"biankuang biankuang_4\"></div>";
|
echo "<div class=\"spbq\" name=\"div_e\"><div class=\"biankuang biankuang_1\"></div><div class=\"biankuang biankuang_2\"></div><div class=\"biankuang biankuang_3\"></div><div class=\"biankuang biankuang_4\"></div>";
|
||||||
echo "<h6 id=\"question_".$i."\">". $i. ".". $row['q'] ."</h6>\n<p>";
|
echo "<h6 id=\"question_".$i."\">". $i. ".". $row['q'] ."</h6>\n<p>";
|
||||||
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"1\" id=\"test". $i. "1\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "1\">". $row['A'] ."</label>\n";
|
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"1\" id=\"test". $i. "1\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "1\">". $row['A'] ."</label>\n";
|
||||||
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"2\" id=\"test". $i. "2\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "2\">". $row['B'] ."</label>\n";
|
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"2\" id=\"test". $i. "2\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "2\">". $row['B'] ."</label>\n";
|
||||||
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"3\" id=\"test". $i. "3\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "3\">". $row['C'] ."</label>\n";
|
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"3\" id=\"test". $i. "3\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "3\">". $row['C'] ."</label>\n";
|
||||||
|
if($row['D']){
|
||||||
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"4\" id=\"test". $i. "4\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "4\">". $row['D'] ."</label>\n";
|
echo "<input class=\"with-gap\" type=\"radio\" name=\"answer_". $i. "\" value=\"4\" id=\"test". $i. "4\" onclick=\"addOne(this)\"/>\n<label for=\"test". $i. "4\">". $row['D'] ."</label>\n";
|
||||||
|
}
|
||||||
echo "</p></div>\n";
|
echo "</p></div>\n";
|
||||||
echo "<div class=\"input-field col s12\" style=\"height:1px;overflow:hidden\"><input value=\"".$random."\" type=\"text\" class=\"validate\" style=\"color:#fff\" name=\"question_".$i."\"></div>\n";
|
echo "<div class=\"input-field col s12\" style=\"height:1px;overflow:hidden\"><input value=\"".$random."\" type=\"text\" class=\"validate\" style=\"color:#fff\" name=\"question_".$i."\"></div>\n";
|
||||||
}
|
}
|
||||||
|
if($flag == 0){
|
||||||
|
$i--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "<!-- </div><div class=\"section\"> --><h5> 二、判断题</h5>";
|
// echo "<!-- </div><div class=\"section\"> --><h5> 二、判断题</h5>";
|
||||||
|
|||||||
@@ -241,6 +241,11 @@ $(document).ready(function() {
|
|||||||
function showResponse(responseText) {
|
function showResponse(responseText) {
|
||||||
clearT[0] = 0;
|
clearT[0] = 0;
|
||||||
alert(responseText);
|
alert(responseText);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window.location.href = "https://wall.kaionji.com/wj/anser.php";
|
window.location.href = "https://wall.kaionji.com/wj/anser.php";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user