ttttt
This commit is contained in:
11
anser.php
11
anser.php
@@ -76,8 +76,8 @@
|
||||
$chongfu="SELECT Student_ID FROM UserAnswer WHERE Student_ID=$_SESSION[Student_ID]";
|
||||
$result2 = mysqli_query($con,"SELECT * FROM UserAnswer WHERE Student_ID = '$_SESSION[Student_ID]'";
|
||||
if(!mysqli_fetch_array(mysqli_query($con,$chongfu))[0]==$_SESSION[student_id]){
|
||||
die('请先完成问卷');
|
||||
}
|
||||
echo '请先完成问卷';
|
||||
}else{
|
||||
$list = array(
|
||||
1=> 'A',
|
||||
2=> 'B',
|
||||
@@ -86,14 +86,15 @@
|
||||
);
|
||||
$row = mysqli_fetch_array($result2)
|
||||
for($i = 1;$i <= 20;$i++){
|
||||
$q = floor($row[ap_$i] / 10);
|
||||
$a = floor($row[ap_$i] % 10);
|
||||
$q = floor($row['ap_'.$i] / 10);
|
||||
$a = floor($row['ap_'.$i] % 10);
|
||||
$result = mysqli_query($con,"SELECT * FROM Persons WHERE num='$q'");
|
||||
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><h6 id=\"question_".$i."\">". $i. ".". $result['q'] ."</h6>";
|
||||
echo "<p><p>正确答案是: $result[$list[$result[answer]]] </p><p>你的答案是: $result[$list[$a]]</p></p>"
|
||||
echo "<p><p>正确答案是: ".$result[$list[$result['answer']]]." </p><p>你的答案是: ".$result[$list[$a]]."</p></p>"
|
||||
//echo "<p><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<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<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<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</p></div>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// echo "<!-- </div><div class=\"section\"> --><h5> 二、判断题</h5>";
|
||||
// $randomArray = range(1,10);
|
||||
|
||||
Reference in New Issue
Block a user