package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
public final class user_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.Vector _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=utf-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n");
out.write("<script language=\"JavaScript\" type=\"text/javascript\" >\r\n");
out.write(" function IsSubmit(){\r\n");
out.write(" //alert(strnum)\r\n");
out.write(" var ret = confirm(\"确定要交卷吗?\")\r\n");
out.write(" return ret;\r\n");
out.write(" }\r\n");
out.write("</script>\r\n");
out.write("<title>试卷</title>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write(" ");
String userName = (String)session.getAttribute("userName");
String test="";
String testID="";
int counter=0;//题目计数器
java.sql.Connection conn; //数据库连接对�
java.sql.PreparedStatement preparedStmt; //SQL语句对象
java.sql.ResultSet sqlRst; //结果集对�
java.lang.String strCon; //数据库连接字符串
testBaseServlet.DBConn dbcon = new testBaseServlet.DBConn();
conn = dbcon.getConn();
String testContent="";
out.write("\r\n");
out.write(" <form action=\"judge\" method=\"post\">\r\n");
out.write(" <table width=\"60%\" border=\"0\" align=\"center\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td><p align=\"right\">欢迎");
out.print(userName);
out.write("使用</p></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td><h2>一、单项选择题</h2></td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
//执行SQL语句并获取结果集
preparedStmt = conn.prepareStatement("select * from test where testType=?");
preparedStmt.setInt(1, 1);
sqlRst = preparedStmt.executeQuery();
while(sqlRst.next()){
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td><h4>");
out.print(++counter);
out.write('.');
out.print(sqlRst.getString("testContent"));
out.write("</h4>\r\n");
out.write(" ");
testID=String.valueOf(sqlRst.getInt("testID"));
test+=testID+",";
String srcstring="http://localhost:8080"+request.getContextPath()+"/showIma?testID="+
Integer.parseInt(testID);
java.sql.Blob blob=sqlRst.getBlob( "testImage" );
int len=0;
if(blob==null)
len=0;
else
len=1;
out.write("\r\n");
out.write(" ");
if(len==1){
out.write("\r\n");
out.write(" <img border=\"1\" src=\"");
out.print(srcstring);
out.write("\"/><br/>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" <input type=\"radio\" name=\"");
out.print(testID);
out.write("\" value=\"A\" /> ");
out.print(sqlRst.getString("AContent"));
out.write("<br/> \r\n");
out.write(" <input type=\"radio\" name=\"");
out.print(testID);
out.write("\" value=\"B\" /> ");
out.print(sqlRst.getString("BContent"));
out.write("<br/> \r\n");
out.write(" <input type=\"radio\" name=\"");
out.print(testID);
out.write("\" value=\"C\" /> ");
out.print(sqlRst.getString("CContent"));
out.write("<br/> \r\n");
out.write(" <input type=\"radio\" name=\"");
out.print(testID);
out.write("\" value=\"D\" /> ");
out.print(sqlRst.getString("DContent"));
out.write("<br/> \r\n");
out.write(" </td> \r\n");
out.write(" </tr>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td><h2>二、填空题</h2></td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
//执行SQL语句并获取结果集
preparedStmt = conn.prepareStatement("select * from test where testType=?");
preparedStmt.setInt(1, 2);
sqlRst = preparedStmt.executeQuery();
counter=0;
while(sqlRst.next()){
testContent=sqlRst.getString("testContent");
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <h4>");
out.print(++counter);
out.write('.');
out.print(testContent);
out.write(" </h4>\r\n");
out.write(" ");
testID=String.valueOf(sqlRst.getInt("testID"));
test+=testID+",";
String srcstring="http://localhost:8080"+request.getContextPath()+"/showIma?testID="+
Integer.parseInt(testID);
java.sql.Blob blob=sqlRst.getBlob( "testImage" );
int len=0;
if(blob==null)
len=0;
else
len=1;
out.write("\r\n");
out.write(" ");
if(len==1){
out.write("\r\n");
out.write(" <img border=\"1\" src=\"");
out.print(srcstring);
out.write("\"/><br/>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" <p>请输入您的回答(多个回答用逗号隔开)<input type=\"input\" name=\"");
out.print(testID);
out.write("\" /></p>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" <input type=\"hidden\" name=\"test\" value=\"");
out.print(test);
out.write("\"/>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" \r\n");
out.write(" <input type=\"submit\" name=\"Submit\" value=\"交卷\" onClick=\"return IsSubmit()\"/>\r\n");
out.write(" \r\n");
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
JAVA WEB 题库管理系统 (203个子文件)
user_jsp.class 8KB
sendMail.class 5KB
changeTest.class 5KB
addTest.class 4KB
judge.class 4KB
addFillTest.class 4KB
showIma.class 3KB
login.class 3KB
deleteTest.class 3KB
queryTest.class 2KB
DBConn.class 1KB
Thumbs.db 61KB
Thumbs.db 61KB
gfv3ee6.dpf 468B
sp_bg.gif 518KB
sp_bg.gif 518KB
head_bg.gif 83KB
head_bg.gif 83KB
lz_2.gif 61KB
lz_2.gif 61KB
sp_bg1.gif 47KB
sp_bg1.gif 47KB
yx.gif 44KB
yx.gif 44KB
lz_1.gif 36KB
lz_1.gif 36KB
xx.gif 32KB
xx.gif 32KB
tj_5.gif 13KB
tj_5.gif 13KB
tj_3.gif 12KB
tj_3.gif 12KB
tj_4.gif 12KB
tj_4.gif 12KB
tj_1.gif 10KB
tj_1.gif 10KB
gif_8.gif 6KB
gif_8.gif 6KB
gif_5.gif 6KB
gif_5.gif 6KB
gif_7.gif 6KB
gif_7.gif 6KB
gif_6.gif 5KB
gif_6.gif 5KB
gif_new.gif 5KB
gif_new.gif 5KB
gif_4.gif 4KB
gif_4.gif 4KB
gif_3.gif 4KB
gif_3.gif 4KB
bg.gif 3KB
bg.gif 3KB
tabrightJ.gif 2KB
tabrightJ.gif 2KB
gif_j.gif 2KB
gif_j.gif 2KB
gif_1.gif 1KB
gif_1.gif 1KB
zhuce.gif 1KB
login.gif 1KB
zhuce.gif 1KB
login.gif 1KB
next.gif 1KB
prev.gif 1KB
next.gif 1KB
prev.gif 1KB
gif_9.gif 913B
gif_9.gif 913B
gif_2.gif 773B
gif_2.gif 773B
zhaohui.gif 677B
zhaohui.gif 677B
tableftJ.gif 666B
tableftJ.gif 666B
yy_bg.gif 516B
yy_bg.gif 516B
xx.html 2KB
xx.html 2KB
left.html 2KB
left.html 2KB
index.html 1KB
index.html 1KB
zhuce.html 1KB
zhuce.html 1KB
sendMail.html 1KB
sendMail.html 1KB
manage.html 1KB
manage.html 1KB
forgetPassword.html 977B
forgetPassword.html 977B
frame.html 855B
frame.html 855B
main.html 311B
main.html 311B
mysql-connector-java-5.1.13-bin.jar 736KB
user_jsp.java 9KB
changeTest.java 7KB
addTest.java 5KB
sendMail.java 5KB
addFillTest.java 5KB
共 203 条
- 1
- 2
- 3
dnfyum
- 粉丝: 46
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页