01.
<form name=
"form1"
method=
"post"
action=
"send_score.php?qs_id=<?=$objResult2['question_set_id'];?>"
">
02.
<?
03.
04.
$sql
=
"Select * From question q, question_set qs WHERE q.question_set_id=qs.question_set_id and q.question_set_id='"
.
$_GET
['id
']."'
order by rand()";
05.
$db_query
=mysql_query(
$sql
);
06.
$i
=0;
07.
while
(
$result
=mysql_fetch_array(
$db_query
))
08.
{
09.
$i
++;
10.
?><br/>
11.
<table width=
"95%"
border=
"0"
align=
"center"
>
12.
<tr>
13.
<td align=
"left"
><b><?=
$i
;?><input name=
"id[<?=$i;?>]"
type=
"hidden"
value=
"<?=$result["
question_id
"];?>"
>
14.
<?=
$result
[
"question_name"
];?></b></td>
15.
</tr>
16.
<tr>
17.
<td width=
"14%"
> <input name=
"choice<?=$i;?>"
type=
"radio"
value=
"1"
>
18.
<?=
$result
[
"choice1"
];?>
19.
</td>
20.
</tr>
21.
<tr>
22.
<td><input type=
"radio"
name=
"choice<?=$i;?>"
value=
"2"
>
23.
<?=
$result
[
"choice2"
];?></td>
24.
</tr>
25.
<tr>
26.
<td><input type=
"radio"
name=
"choice<?=$i;?>"
value=
"3"
>
27.
<?=
$result
[
"choice3"
];?></td>
28.
</tr>
29.
<tr>
30.
<td><input type=
"radio"
name=
"choice<?=$i;?>"
value=
"4"
>
31.
<?=
$result
[
"choice4"
];?></td>
32.
</tr>
33.
<tr>
34.
<td><input type=
"radio"
name=
"choice<?=$i;?>"
value=
"5"
>
35.
<?=
$result
[
"choice5"
];?>
36.
<input name=
"answer<?=$i;?>"
type=
"hidden"
value=
"<?=$result["
answer
"];?>"
></td>
37.
</tr>
38.
</table>
39.
<? }?>
40.
<br />
41.
<br />
42.
<?
43.
$sql2
=
"select * from question2 q2, question_set qs WHERE q2.question_set_id=qs.question_set_id and q2.question_set_id='"
.
$_GET
['id
']."'
order by rand()";
44.
$db_query2
=mysql_query(
$sql2
);
45.
$a
=0;
46.
while
(
$result2
=mysql_fetch_array(
$db_query2
))
47.
{
48.
$a
++;
49.
?><br/>
50.
<table width=
"95%"
border=
"0"
align=
"center"
>
51.
<tr>
52.
<td align=
"left"
><b><?=
$a
;?><input name=
"id[<?=$a;?>]"
type=
"hidden"
value=
"<?=$result2["
question2_id
"];?>"
>
53.
<?=
$result2
[
"question2_name"
];?></b></td>
54.
</tr>
55.
<tr>
56.
<td width=
"14%"
> <input name=
"choice1<?=$a;?>"
type=
"radio"
value=
"1"
>
57.
<?=
$result2
[
"choice1"
];?>
58.
</td>
59.
</tr>
60.
<tr>
61.
<td><input type=
"radio"
name=
"choice1<?=$a;?>"
value=
"2"
>
62.
<?=
$result2
[
"choice2"
];?>
63.
<input name=
"answer2<?=$a;?>"
type=
"hidden"
value=
"<?=$result2["
answer2
"];?>"
></td>
64.
</tr>
65.
</table>
66.
<?
67.
}
68.
?>
69.
<br />
70.
<div align=
"center"
><br>
71.
<input type=
"hidden"
name=
"line"
value=
"<?=$i;?>"
>
72.
<input type=
"hidden"
name=
"line2"
value=
"<?=$a;?>"
>
73.
<input type=
"submit"
name=
"Submit"
value=
"ส่งข้อสอบ"
>
74.
</div>
75.
</form>