我在设计测验时需要帮助 [英] I need help in designing my quiz

查看:49
本文介绍了我在设计测验时需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的代码显示10个问题及其选项,但我想以适当的设计显示它,即有正确的边框,我如何插入面板标题的问题和面板主体的选项??



我也需要帮助将所有问题编号从1到10

我们怎么做?

请帮助

感谢提前



我尝试过:



< ;?php









$ result = mysql_query(select *来自问题顺序由rand()限制0,10);

$ i = 1;



while($ row = mysql_fetch_assoc ($ result))



{

$ result1 = mysql_query(select * from options where qid ='。$ row [' qid']。');



echo $ row ['questions'];

echo< br>;

$ i = 0;

while($ row1 = mysql_fetch_assoc($ result1))

{



$ q id = $ row1 ['qid'];

$ value = $ row1 ['oid'];

?>



< input type ='radio'value ='<?php echo $ value;?>'name ='answer [<?php echo $ qid;?>]'>< ;?php echo $ row1 ['options'];?>



<?php

$ i ++;

echo'< br />';



}

echo'< br />';

// echo $ Correct_answer ='选项ID - '。$ row ['oid'];

echo'< br />';

echo'< br />';





}



?>



< input type =submit

value =submitname =submit />

< / form>

Below code display 10 questions with their options but i want to display it in proper design ie with proper border, how can i insert panel-header for questions and panel body for options??

also i need help in numbering all the questions from 1 to 10
How can we do this?
Please help
Thanku in advance

What I have tried:

<?php




$result = mysql_query("select * from questions order by rand() limit 0,10");
$i=1;

while($row = mysql_fetch_assoc($result))

{
$result1 = mysql_query("select * from options where qid='".$row['qid']."'");

echo $row['questions'];
echo "<br>";
$i=0;
while($row1 = mysql_fetch_assoc($result1))
{

$qid=$row1['qid'];
$value=$row1['oid'];
?>

<input type='radio' value='<?php echo $value ;?>' name='answer[<?php echo $qid;?>]'><?php echo $row1['options'];?>

<?php
$i++;
echo '<br/>';

}
echo '<br/>';
//echo $Correct_answer='Option ID-'.$row['oid'];
echo '<br/>';
echo '<br/>';


}

?>

<input type="submit"
value="submit" name="submit" />
</form>

推荐答案

result = mysql_query(select * from question order by rand()limit 0,10) ;
result = mysql_query("select * from questions order by rand() limit 0,10");


i = 1;



while(
i=1;

while(


row = mysql_fetch_assoc(
row = mysql_fetch_assoc(


这篇关于我在设计测验时需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆