⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _score__jsp.java

📁 通子的考试系统 本程序版权属于通子 程序功能: 1。考生可以选择科目进行考试 2. 考过科目不再重新登陆考试 2。考题时随机的
💻 JAVA
字号:
/*
 * JSP generated by Resin-3.0.8 (built Tue, 08 Jun 2004 02:25:40 PDT)
 */

package _jsp;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.Date;

public class _score__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;

  

  Connection con = null;

  Statement stmt = null;

  ResultSet rs = null;

  ResultSet rsScore=null;

  public void jspInit()

  {

  	try

  	{

  		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

  		//\u8f7d\u5165\u9a71\u52a8\u7a0b\u5f0f\u7c7b\u522b

  

  		con = DriverManager.getConnection("jdbc:odbc:test");

  		//\u5efa\u7acb\u6570\u636e\u5e93\u8fde\u7ebf

  

  		stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,

  					     ResultSet.CONCUR_READ_ONLY);

  		//\u5efa\u7acbStatement\u53d8\u91cf, \u5e76\u8bbe\u5b9a\u8bb0\u5f55\u6307\u6807\u7c7b\u578b\u4e3a\u53ef\u524d\u5f8c\u79fb\u52a8

  	}

  	catch(Exception ex)

  	{

  		System.out.println(ex.toString());

  	}

  }

  public void jspDestroy()

  {

  	try

  	{

  		stmt.close(); //\u5173\u95edStatement\u53d8\u91cf

  		con.close();  //\u5173\u95edConnection\u53d8\u91cf

  		rs.close(); //\u5173\u95edResultSet\u53d8\u91cf

  		rsScore.close();

  	}

  	catch(Exception ex)

  	{

  		System.out.println(ex.toString());

  	}

  }


  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    javax.servlet.http.HttpSession session = request.getSession(true);
    com.caucho.server.webapp.Application _jsp_application = _caucho_getApplication();
    javax.servlet.ServletContext application = _jsp_application;
    com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true);
    javax.servlet.jsp.JspWriter out = pageContext.getOut();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    response.setContentType("text/html;charset=GB2312");
    request.setCharacterEncoding("GB2312");
    try {
      out.write(_jsp_string0, 0, _jsp_string0.length);
       
	String Lesson = (String)session.getAttribute("Lesson");
	String No=(String)session.getAttribute("No");
	String Name=(String)session.getAttribute("Name");	

      out.write(_jsp_string1, 0, _jsp_string1.length);
            int total=50;
	    int Score = 0;	
	    for(int j=1;j<6;j++){			
		String Ans=(String)session.getAttribute("Ans"+j);		
		String tihao=(String)session.getAttribute("tihao"+j);
		//String TestType=(String)session.getAttribute("leixing");
		/*try{
		if(TestType.equals("\u5355\u9009")){
		if (request.getParameter("No" +tihao)!=null)
		{ 
		String Sel = request.getParameter("No" +tihao);			
			if (Ans.equals(Sel))
			{
			Score = Score +10;        
			}		
		}
		//}else{*/
		 if(request.getParameterValues("No"+tihao)!=null){
		 String sel[]=request.getParameterValues("No"+tihao);
		 String Se="";
		 for(int i=1;i<sel.length;i++){
		 Se=Se+sel[i];		 
		 }
		 if(Ans.equals(Se)){
		 Score = Score +10; 
		 }else{
		 Score = Score +0; 
		 }
		}
		//}
		//}catch(Exception ex){}
		}
//******************************************************************************************
	if(Score>=30){
	out.print("<script>{alert('\u606d\u559c\u4f60\uff01\u4f60\u901a\u8fc7\u8ba4\u8bc1\u8003\u8bd5\u4e86\u3002\u4f60\u7684\u6210\u7ee9\u5982\u4e0b\uff1a')}</script>");
	}else{
	out.print("<script>{alert('\u5bf9\u4e0d\u8d77\u4f60\u6ca1\u80fd\u901a\u8fc7\uff0c\u4f60\u8fd8\u9700\u7ee7\u7eed\u52aa\u529b\u3002\u4f60\u7684\u6210\u7ee9\u5982\u4e0b\uff1a')}</script>");
	}
      out.write(_jsp_string2, 0, _jsp_string2.length);
      out.print((total*4));
      out.write(_jsp_string3, 0, _jsp_string3.length);
      out.print(((Score*100)/total));
      out.write(_jsp_string4, 0, _jsp_string4.length);
      out.print((Score*4));
      out.write(_jsp_string5, 0, _jsp_string5.length);
      
	String SQL = "Select * From \u6210\u7ee9\u5355 ";
	SQL = SQL + "Where \u5b66\u53f7=" + "'" + No + "'" + " And \u59d3\u540d='" + Name + "'";
	int iJSP = 0;
	int iXML = 0;			
		rsScore=stmt.executeQuery(SQL);
		rsScore.next();
		String kaoshi = rsScore.getString(Lesson);			
		iJSP=(!Lesson.equals("JSP"))?rsScore.getInt("JSP"):Score;
		iXML=(!Lesson.equals("XML"))?rsScore.getInt("XML"):Score;
						
		if (kaoshi.equals("-1"))		
		{ 
		SQL = "update \u6210\u7ee9\u5355 set " + Lesson + " = "  + Score + 
				" where \u5b66\u53f7=" + "'" + No + "'" +
				" And \u59d3\u540d='" + Name + "'";
		 
		stmt.executeUpdate(SQL);
		}
		else
		{
		 out.print("<script>{alert('\u4f60\u5df2\u7ecf\u8003\u8fc7\u4e86')}</script>");
		}
	

      out.write(_jsp_string6, 0, _jsp_string6.length);
      out.print((Name));
      out.write(_jsp_string7, 0, _jsp_string7.length);
      try{
	long l=(new Date().getTime()-Long.parseLong(request.getParameter("Time")))/1000 ;
	out.println(l);
	}catch(Exception e){}
	
	
      out.write(_jsp_string8, 0, _jsp_string8.length);
      out.print((iJSP));
      out.write(_jsp_string9, 0, _jsp_string9.length);
      out.print((iXML));
      out.write(_jsp_string10, 0, _jsp_string10.length);
      out.print((No));
      out.write(_jsp_string11, 0, _jsp_string11.length);
      out.print((Name));
      out.write(_jsp_string12, 0, _jsp_string12.length);
    } catch (java.lang.Throwable _jsp_e) {
      pageContext.handlePageException(_jsp_e);
    } finally {
      com.caucho.jsp.QJspFactory.freePageContext(pageContext);
    }
  }

  private com.caucho.java.LineMap _caucho_line_map;
  private java.util.ArrayList _caucho_depends = new java.util.ArrayList();

  public java.util.ArrayList _caucho_getDependList()
  {
    return _caucho_depends;
  }

  public void _caucho_addDepend(com.caucho.make.PersistentDependency depend)
  {
    super._caucho_addDepend(depend);
    _caucho_depends.add(depend);
  }

  public boolean _caucho_isModified()
  {
    if (_caucho_isDead)
      return true;
    if (com.caucho.util.CauchoSystem.getVersionId() != 1174304630)
      return true;
    for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
      com.caucho.make.Dependency depend;
      depend = (com.caucho.make.Dependency) _caucho_depends.get(i);
      if (depend.isModified())
        return true;
    }
    return false;
  }

  public long _caucho_lastModified()
  {
    return 0;
  }

  public com.caucho.java.LineMap _caucho_getLineMap()
  {
    return _caucho_line_map;
  }

  public void destroy()
  {
      _caucho_isDead = true;
      super.destroy();
  }

  public void init(com.caucho.java.LineMap lineMap,
                   com.caucho.vfs.Path appDir)
    throws javax.servlet.ServletException
  {
    com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
    com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
    mergePath.addMergePath(appDir);
    mergePath.addMergePath(resinHome);
    com.caucho.loader.DynamicClassLoader loader;
    loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
    String resourcePath = loader.getResourcePathSpecificFirst();
    mergePath.addClassPath(resourcePath);
    _caucho_line_map = new com.caucho.java.LineMap("_score__jsp.java", "foo");
    _caucho_line_map.add("/Conn.jsp", 2, 15);
    _caucho_line_map.add("/score.jsp", 4, 71);
    _caucho_line_map.add(12, 77);
    _caucho_line_map.add(52, 116);
    _caucho_line_map.add(54, 118);
    _caucho_line_map.add(55, 120);
    _caucho_line_map.add(57, 122);
    _caucho_line_map.add(82, 148);
    _caucho_line_map.add(82, 150);
    _caucho_line_map.add(91, 157);
    _caucho_line_map.add(92, 159);
    _caucho_line_map.add(95, 161);
    _caucho_line_map.add(95, 163);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(appDir.lookup("score.jsp"), "GyZ4msOVmLAj+P+fy854jA==", false);
    _caucho_depends.add(depend);
    depend = new com.caucho.vfs.Depend(appDir.lookup("Conn.jsp"), "RfAIAIG26G1VcP1cIkfxrA==", false);
    _caucho_depends.add(depend);
  }

  private final static char []_jsp_string9;
  private final static char []_jsp_string3;
  private final static char []_jsp_string5;
  private final static char []_jsp_string11;
  private final static char []_jsp_string6;
  private final static char []_jsp_string12;
  private final static char []_jsp_string1;
  private final static char []_jsp_string8;
  private final static char []_jsp_string0;
  private final static char []_jsp_string10;
  private final static char []_jsp_string2;
  private final static char []_jsp_string7;
  private final static char []_jsp_string4;
  static {
    _jsp_string9 = "</TD></TR>\r\n	  <TR><TD>XML</TD><TD Align=Right>".toCharArray();
    _jsp_string3 = "\"  border=\"0\" height=\"30\">\r\n<tr><td  bgcolor=\"red\"></td></tr></table>\r\n\u6240\u8003\u6210\u7ee9".toCharArray();
    _jsp_string5 = "\"  border=\"0\" height=\"30\">\r\n<tr><td bgcolor=\"red\"> </td></tr></table><br>\r\n".toCharArray();
    _jsp_string11 = "+Name=".toCharArray();
    _jsp_string6 = "\r\n	".toCharArray();
    _jsp_string12 = "\">\u53c2\u52a0\u5176\u4ed6\u79d1\u76ee\u8003\u8bd5</A>\r\n	</BODY>\r\n\r\n</HTML>\r\n".toCharArray();
    _jsp_string1 = "\r\n<HTML>\r\n	<BODY  BGCOLOR=#CCCCCC>\r\n	<H2>\u6210\u7ee9\u5355<HR></H2>\r\n".toCharArray();
    _jsp_string8 = "\u79d2\uff0c\u4f60\u7684\u8003\u8bd5\u6210\u7ee9\u7edf\u8ba1\u4e3a\uff1a<BR>\r\n	<CENTER>\r\n	  <TABLE BORDER=2 BGCOLOR=\"#F1F1F1\" WIDTH=80%>\r\n	  <TR BGCOLOR=\"#DDDDDD\"><TD>\u4f60\u53c2\u52a0\u7684\u79d1\u76ee</TD><TD>\u4f60\u7684\u5206\u6570</TD></TR>\r\n	  <TR><TD>JSP</TD><TD Align=Right>".toCharArray();
    _jsp_string0 = "\r\n\r\n\r\n\r\n".toCharArray();
    _jsp_string10 = "</TD></TR>\r\n	  </TABLE></center>\r\n	<HR>\r\n	<A HREF=\"login.jsp?No=".toCharArray();
    _jsp_string2 = "\r\n	\u603b\u6210\u7ee9\u4e0e\u6240\u8003\u6210\u7ee9\u5bf9\u6bd4\uff1a<br>\r\n\u603b\u6210\u7ee9:100%\r\n<table  width=\"".toCharArray();
    _jsp_string7 = "\u540c\u5b66\u4f60\u597d\uff0c\u6240\u7528\u65f6\u95f4".toCharArray();
    _jsp_string4 = "%\r\n<table width=\"".toCharArray();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -