MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 剩下最后一个有关问题未解决了,望前辈指点

剩下最后一个有关问题未解决了,望前辈指点

www.MyException.Cn  网友分享于:2013-12-27  浏览:2次
剩下最后一个问题未解决了,望前辈指点
a.jsp   页面   (从表tiku提取考试题目,都是选择题)

<%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.io.*,java.sql.* "   %>
<jsp:useBean   id= "connBean "   scope= "session "   class= "bean.ConnDB "/>
<jsp:useBean   id= "employ "   class= "bean.employ "   scope= "session "/>  
<%
ResultSet   rs=connBean.executeQuery( "select   *   from   tiku ");
%>
<html>    
    <body>
    <form   name= "form1 "   method= "post "   action= "b.jsp "   target= "_top ">
    <%
int   question_index=1;
int   tmp_questionid=0;
while(rs.next())   {
tmp_questionid=rs.getInt( "id ");
%>
<table   width= "75% "   border= "0 ">
<tr>  
            <td   width= "15% "   align= "left "   valign= "top "> 答案 </td>
            <td   width= "85% "> <%= " <font   color=blue> ( "   +   question_index   +   ") </font>   "   +   rs.getString( "question ")%> (单选题) </td>
        </tr>

<tr>
                    <td>   <input   type= "radio "   name= " <%=tmp_questionid%> "   value= "A "> A </td> <td> <%=rs.getString( "keya ")%> </td> </tr>
  <tr>
                    <td>   <input   type= "radio "   name= " <%=tmp_questionid%> "   value= "B "> B </td> <td> <%=rs.getString( "keyb ")%> </td> </tr>
<tr>
                    <td>   <input   type= "radio "   name= " <%=tmp_questionid%> "   value= "C "> C </td> <td> <%=rs.getString( "keyc ")%> </td> </tr>
<tr>
                    <td>   <input   type= "radio "   name= " <%=tmp_questionid%> "   value= "D "> D </td> <td> <%=rs.getString( "keyd ")%> </td> </tr>
   
            </table> <p> </p>
<%
question_index++;
}  
%>
<p   align= "center ">  
        <input   type= "hidden "   name= "totaltime "   value= "0 ">
        <input   type= "button "   name= "submita "   value= "提交答卷 "     onclick= "JavaScript:subit() ">
    </p>
</form>

怎么在b.jsp   页面实现总分数多少?
(写过,但是总是不行)

sql2000   数据库
表名:tiku  
字段:id,question,keya,keyb,keyc,keyd,answer

表名:score
字段:id,s_id,score

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有