<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String driver = "jdbc:microsoft:sqlserver://localhost:1433";
String user="jsp";
String password="820728";
Connection conn = DriverManager.getConnection(driver,"","");
Statement stmt = conn.createStatement();
//String uid="fafa";
int i=0;
int zongfen=0;
int shijuanbianhao=Integer.parseInt(request.getParameter("shijuanbianhao"));
int timuzongshu=Integer.parseInt(request.getParameter("timuzongshu"));
String timuleixing=new String();
for(i=1;i<=timuzongshu;i++)
{
timuleixing=request.getParameter("timuleixing"+i);
     if(timuleixing.charAt(0)=='x'||timuleixing.charAt(0)=='p')
	 {
		String myans=request.getParameter("myans"+i);
		String daan=(String)session.getAttribute("Ans"+i);
		int fenzhi=Integer.parseInt(request.getParameter("fenzhi"+i));
		if(myans==null)
		{%>
		第<%=i%>题错
		<%}
		else if(myans.equals(daan))
		{%>
		第<%=i%>题对
		<%
		 zongfen=zongfen+fenzhi;
		}
		else
		{%>
		第<%=i%>题错
		<%}
	 }
}
%>
<font size="+1" color="#0099CC">除主观题外，客观题的得分是<%=zongfen%>分</font>
</body>
</html>
