?? random2.jsp
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
@import url("_notes/ccc");
-->
</style>
</HEAD>
<BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page language="java" import="java.sql.*"%>
<jsp:useBean id="db" scope="page" class="exam.exam"/>
<jsp:useBean id="db1" scope="page" class="exam.exam"/>
<jsp:useBean id="db2" scope="page" class="exam.exam"/>
<%
String sbnum=(String) session.getValue("kname");
String pnum=request.getParameter("pnum");
String type=request.getParameter("type");
String mark=request.getParameter("mark");
String diff=request.getParameter("diff");
int number1=Integer.parseInt(request.getParameter("number1"));
int number=Integer.parseInt(request.getParameter("number"));
if(number>number1 )
{%>
<script>
window.alert("您題數(shù)填多啦!");
history.back();
</script>
<%
}
else{
String sql5="select max(qnum) as qnum from question where sbnum='"+sbnum+"' and pnum='"+pnum+"'";
ResultSet rs2=db.executeQuery(sql5);
rs2.next();
String qnum=rs2.getString("qnum");
String sql="select question,num from question where sbnum='"+sbnum+"' and mark='"+mark+"' and diff='"+diff+"'and type='"+type+"' and state='"+0+"'order by num";
ResultSet rs=db.executeQuery(sql);
int bian;
if (qnum==null){
bian=1;
}
else {
int peng = Integer.parseInt(qnum, 10);
bian=peng+1;
}
for (int i=1;i<=number;i++)
{
rs.next();
String wt=rs.getString("question");
int num1=rs.getInt("num");
num1=num1+1;
String sql2="update question set num='"+num1+"' where question='"+wt+"'";
db1.executeUpdate(sql2);
String sql3="insert into question(sbnum,pnum,qnum,question,type,diff,mark,state,num)values('"+sbnum+"','"+pnum+"','"+bian+"','"+wt+"','"+type+"','"+diff+"','"+mark+"','"+1+"','"+1+"')";
db2.executeUpdate(sql3);
bian++;
}
rs2.close();
%>
<br>
<br>
<TABLE WIDTH=750 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
<TR>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=231 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=4 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=75 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=105 HEIGHT=1></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=5 HEIGHT=1></TD>
</TR>
<TR>
<TD COLSPAN=4>
<IMG SRC="images/temp_01.jpg" WIDTH=420 HEIGHT=15></TD>
<TD COLSPAN=4>
<IMG SRC="images/temp_02.jpg" WIDTH=330 HEIGHT=15></TD>
</TR>
<TR>
<TD COLSPAN=8>
<IMG SRC="images/temp_03.jpg" WIDTH=750 HEIGHT=5></TD>
</TR>
<TR>
<TD>
<table width="231" border="0" cellspacing="0" cellpadding="0" height="226" background="images/left_top.jpg">
<tr>
<td width="231">
<div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Your
Content</font></div>
</td>
</tr>
</table>
</TD>
<TD ROWSPAN=2>
<IMG SRC="images/temp_05.jpg" WIDTH=4 HEIGHT=455></TD>
<TD COLSPAN=5 ROWSPAN=2>
<table width="510" border="0" cellspacing="0" cellpadding="0" height="455" background="images/main_bg.jpg">
<tr>
<td width="510">
<table width="510" border="0" cellspacing="0" cellpadding="0" height="455">
<tr>
<td width="510" height="78">
<div align="center"><img src="images/blank_banner.gif" width="468" height="60"></div>
</td>
</tr>
<tr>
<td>
<div align="center">
<p></p>
<form name="form2" method="post" action="random.jsp">
<input type="hidden" name="pnum" value="<%=pnum%>">
<input type="submit" name="Submit2" value="繼續(xù)隨機生成">
<input type="hidden" name="hiddenField2">
</form>
<p class="ccc"> </p>
<p> </p>
<form name="form1" method="post" action="preview1.jsp">
<input type="hidden" name="pnum" value="<%=pnum%>">
<input type="submit" name="Submit" value="完成試卷抽取">
<input type="hidden" name="sbnum" value="<%=sbnum%>">
</form>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</TD>
<TD ROWSPAN=2>
<IMG SRC="images/temp_07.jpg" WIDTH=5 HEIGHT=455></TD>
</TR>
<TR>
<TD>
<table width="231" border="0" cellspacing="0" cellpadding="0" height="229" background="images/left_bottom.jpg">
<tr>
<td width="231">
<div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Your
Content</font></div>
</td>
</tr>
</table>
</TD>
</TR>
<TR>
<TD COLSPAN=8>
<IMG SRC="images/temp_09.jpg" WIDTH=750 HEIGHT=5></TD>
</TR>
<TR>
<TD COLSPAN=8>
<IMG SRC="images/temp_10.jpg" WIDTH=750 HEIGHT=20></TD>
</TR>
</TABLE>
<%}%>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -