急急急~最近用servlet做一个在线考试系统,在答题部分出现了问题
用list将数据库的题目传到jsp页面,然后用submit提交表单,全部是单选题,但是全部题目做完之后,无法计算出成绩。。。。下面是代码:
</TABLE>
<%
if(list!=null){
for(Pq t:list){
%>
<table width="101%" border=0 align=center cellPadding=0 cellSpacing=1 class=editTable>
<TBODY>
<TR>
<TD width="4%" align=right bgcolor="#FFFDF0"><div align="center"><%=t.getQuestion_id()%></div></TD>
<TD width="4%" align=right bgcolor="#FFFDF0"><div align="center">:</div></TD>
<TD width="92%" align=right bgcolor="#FFFDF0"><div align="left"><%=t.getQuestion_stem() %></div></TD>
</TR>
<TR>
<TD align=right bgcolor="#FFFDF0"><div align="center">A</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="center">
<input type="radio" name="<%=t.getQuestion_id() %>" id="A" value="A">
</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="left"><%=t.getA() %></div></TD>
</TR>
<TR>
<TD align=right bgcolor="#FFFDF0"><div align="center">B</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="center">
<input type="radio" name="<%=t.getQuestion_id() %>" id="A" value="B">
</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="left"><%=t.getB() %></div></TD>
</TR>
<TR>
<TD align=right bgcolor="#FFFDF0"><div align="center">C</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="center">
<input type="radio" name="<%=t.getQuestion_id() %>" id="A" value="C">
</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="left"><%=t.getC() %></div></TD>
</TR>
<TR>
<TD align=right bgcolor="#FFFDF0"><div align="center">D</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="center">
<input type="radio" name="<%=t.getQuestion_id() %>" id="A" value="D" >
</div></TD>
<TD align=right bgcolor="#FFFDF0"><div align="left"><%=t.getD() %></div></TD>
</TR>
</TBODY>
</TABLE>
<%}
} %>
<p> </p>
<table width="101%" border=0 align=center cellPadding=0 cellSpacing=1 class=editTable>
<TBODY>
<TR>
<TD align=right bgcolor="#FFFDF0"><div align="center"> </div><br></TD>
<input type="submit" name="Submit" value="提交" >
----