henfeng
新手上路

UID 119837
精华
0
积分 21
帖子 15
金钱 21 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2008-4-23
状态 离线
|
[广告]: q
m
十万火急!!考试系统 评分问题?叩谢了
我在做在线考试系统 有单选 多选 填空 判断 简答五种题型 不同的科目可选出不同的题型 不同的题型可以设定不同的出题道数(也就是出几道题) 然后生成一个整套完整的席卷
我用下面的方法读出了题 可是要怎么样才能 提交后得到 所有的题的答案(考生所在的答案也就是表单提交上来的所有的值)
我用了好多方法都没成功
评分这好难啊 就差这了 大家帮帮忙吧 叩谢了
/*试题列表信息*/
//总数
$result=sql_select("select * from big_test where test_subject_id=$_GET[sid] order by bigtitle asc");
while ($brows=mysql_fetch_array($result)){
if($brows['bigtitle']>=1 and $brows['bigtitle']<=4){
for($i=1;$i<=4;$i++){
if($brows['bigtitle']==$i){ //判断题型
tb($brows['bigtitle']); //题型名
echo $b_score.$brows['sscore'].$l_score.'<br />';
$num=$brows['test_num']; //随机数判断
$smtitle=sql_select("select * from small_test WHERE bigtitle_id=$i and subject_id=$_GET[sid] order by rand() LIMIT $num");
while($sresult=mysql_fetch_array($smtitle)){ //小题题干
echo $sresult['smalltitle'].'<br>';
echo "<input name=\"tid[]\" id=\"tid[]\" value=\"$sresult[id]\">";
$smresult=sql_select("select * from small_result where smalltitle_id=$sresult[id]");
while($xx=mysql_fetch_array($smresult)){ //小题对应选项
if($brows['bigtitle']==1){
echo '<input type="radio" name="t_'.$sresult['id'].'[]" value="'.$xx['xx'].'" id="t_'.$sresult['id'].'[]" checked>'.$xx['xx'].' '.$xx['smalltitle_c'].'<br>';
}
if($brows['bigtitle']==2){
echo '<input type="checkbox" name="t_'.$sresult['id'].'[]" value="'.$xx['xx'].'" id="t_'.$sresult['id'].'[]" checked>'.$xx['xx'].' '.$xx['smalltitle_c'].'<br>';
}
if($brows['bigtitle']==3){
echo '<input type="text" name="t_'.$sresult['id'].'[]" value="1" id="t_'.$sresult['id'].'[]">'.$xx['smalltitle_c'].'<br>';
}
if($brows['bigtitle']==4){
echo $xx['smalltitle_c'].'<input type="radio" name="t_'.$sresult['id'].'[]" value="0" id="t_'.$sresult['id'].'[]">是<input type="radio" name="t_[]" value="1" id="t_[]">否<br>';
}
} echo '<br>';
}
}
}
}
if($brows['bigtitle']==5){
echo '<a name="jd"></a><font color="blue">简答题</font>'.$b_score.$brows['sscore'].$l_score.'<br />';
$smtitleb=sql_select("select * from brief_answer WHERE subject_id=$_GET[sid] order by rand() LIMIT $brows[test_num]");
while($sresultb=mysql_fetch_array($smtitleb)){
echo $sresultb['brief_topic'].'<br>';
echo "<input name=\"tid[]\" id=\"tid[]\" value=\"$sresultb[id]\">";
echo "<textarea name=\"t_.$sresult[id].[]\" id=\"t_.$sresult[id].[]\"></textarea><br>";
}
}
}
|
|