dinamiği adı radyo düğmesini bir döngü değerini göndermek nasıl?

0 Cevap

i kullanıcıların veritabanından rastgele oluşturulacak bir sınav cevap sağlayan bir sistem geliştirmek için çalıştı. sorunlar artık sınav işaretlemek için. farklı adı var çünkü ne ben bir radyo düğmesi değerini gönderebilirsiniz.

this is some of my code. thanks.

$selq="SELECT * FROM question WHERE q_subject_kod = '$subkod' AND q_chapter= '$chap' order by RAND() limit $bil ";
    $result=mysql_query($selq);?>

    <form name="quiz" action="mark.php?bil=<?php echo $bil?>&chap=<?php echo $chap?>&action=1&subject=<?php echo $subkod?>" method="post">
<?php

##Cycle through randomly selected questions
if (mysql_num_rows($result)>=0) {
$qi = 1;
$e=0?>
<table name="q" border="1" cellpadding="2"  width="100%">
<tr><td></td><td></td></tr>
<?php
while ($qry = mysql_fetch_array($result)) {
    $idsol=$qry['id'];
    $sol=$qry['q_quest'];
    $jwpn=$qry['q_ranws'];?>
<tr><td><?php echo $qi?></td> <td><?php echo $sol?></td></tr>
<tr><td></td><td>
A<input type="radio" name="ans.<? echo $e?>" id="<? echo $idsol?>"value="<?php echo $qry['q_anws'];?>" /><?php echo $qry['q_anws'];?><br />
B <input type="radio" name="ans.<? echo $e?>" id="<? echo $idsol?>" value="<?php echo $qry['q_anws1'];?>"  /><?php echo $qry['q_anws1'];?><br />
C <input type="radio" name="ans.<? echo $e?>" id="<? echo $idsol?>" value="<?php echo $qry['q_anws2'];?>"  /><?php echo $qry['q_anws2'];?><br />
D <input type="radio" name="ans.<? echo $e?>" id="<? echo $idsol?>" value="<?php echo $qry['q_anws3'];?>"  /><?php echo $qry['q_anws3'];?><br />
<input type="text" name="val.<? echo $idsol?>" value="<? echo $idsol?>">
</td>
</tr>



<?php
$qi++;
$e++;}}}?>>

0 Cevap