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

📄 editsub.jsp

📁 在线考试系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="../../conndb.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>编辑题目</title>
</head>

<body onload="show()">
<script language="javascript">
function show()
{
	window.setTimeout("show()",1000);
	var today=new Date();
	var date0=today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日"+today.getHours()+"点"+today.getMinutes()+"分"+today.getSeconds()+"秒";
	self.status=date0.toString();
}
</script>

<%
int i=0;
int j=0;
int k=0;
String subject=null;
String teacon=(String)session.getAttribute("teacon");
Statement stmt=conn.createStatement();
ResultSet Crs=null;
ResultSet Frs=null;
if(teacon.equals("Clanguage"))
{
	j=1;
	subject="C语言";
}
if(teacon.equals("Structure"))
{	
	j=2;
	subject="计算机结构";
}
if(teacon.equals("Internet"))
{	
	j=3;
	subject="Internet";
}
if(teacon.equals("Java"))
{	
	j=4;
	subject="Java";
}	
switch(j)
{
	case 1:
		Crs=stmt.executeQuery("select * from Cchoice");
		break;
	case 2:
		Crs=stmt.executeQuery("select * from Schoice");
		break;
	case 3:
		Crs=stmt.executeQuery("select * from Ichoice");
		break;
	case 4:
		Crs=stmt.executeQuery("select * from Jchoice");
		break;
}
%>

 <table width="1220" height="300" border="0" align="center" cellpadding="0" cellspacing="0">
 	<tr>
	  <td  height="35" colspan="5"><div align="center"><font size="5" color="#0000FF"><%=subject%>题目编辑</font></div>		</td>
	</tr>
	<tr>
		<td width="1220">
		<form id="form3" name="add_form" method="post" action="addSub.jsp?subtype=choice">
		 <table width="1220">
		 <tr>
		   <td colspan="7" height="35">一、选择题</td>
			<td width="81"><label><input type="submit" name="addChoice" value="添加选择题"/>
			</label></td>
		</tr>
		</table>
	  </form>
	</td>
	</tr>
<%
while(Crs.next())
{
	i++;
	String Cid=Crs.getString("id");
	String choicesub=Crs.getString("choicesub");
	String A=Crs.getString("A");
	String B=Crs.getString("B");
	String C=Crs.getString("C");
	String D=Crs.getString("D");
	String rigopt=Crs.getString("rigopt");
%>
	<tr>
      <td width="1220">
	  <form id="form1" name="editform" method="post" action="reworkSub.jsp?Cid=<%=Cid%>&subtype=choice">
	    <table width="1220" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="35" colspan="4"> 题目<%=i%>、
              <label>
                <input name="choicesub" type="text" value="<%=choicesub%>" size="110" maxlength="200" />
              </label>
             正确答案:
              <label>
                <input name="rigopt" type="text" id="rigopt" value="<%=rigopt%>" size="17" maxlength="1" />
            </label></td>
			  <td width="50"><input type="button" name="delete2" value="删除"
			onclick="javascript:location.replace('delSub.jsp?Cid=<%=Cid%>&subtype=choice')"/></td>
        </tr>
		  <tr>
			<td width="290" height="35"><label> A、
			  <input name="A" type="text" value="<%=A%>" />
			</label>            </td>
			<td width="290"><label> B、
			  <input name="B" type="text" value="<%=B%>" />
			</label></td>
			<td width="290"><label> C、
			  <input name="C" type="text" value="<%=C%>" />
			</label></td>
			<td width="290"><label> D、
			  <input name="D" type="text" value="<%=D%>" />
			</label></td>
			<td width="50"><input type="submit" name="reworkChoice" value="修改"/></td>
		  </tr>
		</table>
	    </form>
	  </td>
	<%}%>
	</tr>
	
	<tr>
		<td width="1220">
		<form id="form4" name="add_form" method="post" action="addSub.jsp?subtype=fill">
		 <table width="1220">
		 <tr>
		   <td colspan="7" height="35">二、填空题</td>
			<td width="81"><label><input type="submit" name="addFill" value="添加填空题"/>
			</label></td>
		</tr>
		</table>
	  </form>
	</td>
	</tr>
	
	<%
	switch(j)
	{
		case 1:
			Frs=stmt.executeQuery("select * from Cfill");
			break;
		case 2:
			Frs=stmt.executeQuery("select * from Sfill");
			break;
		case 3:
			Frs=stmt.executeQuery("select * from Ifill");
			break;
		case 4:
			Frs=stmt.executeQuery("select * from Jfill");
			break;
	}
	while(Frs.next())
	{
		k++;
		String Fid=Frs.getString("id");
	%>
	<tr>
      <td>
	  <form id="form1" name="fillform" method="post" action="reworkSub.jsp?Fid=<%=Fid%>&subtype=fill">
	    <table width="1220" height="70" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="35" colspan="4" width="1170"> 
			题目<%=k%>、
              <label>
                <input name="fillsub" type="text" value="<%=Frs.getString("fillsub")%>" size="100" maxlength="200" />
              </label>     
			  <td width="50">       <input type="button" name="delete" value="删除"
			   	onclick="javascript:window.location='delSub.jsp?Fid=<%=Fid%>&amp;subtype=fill'"/></td>
		 </tr>
		 <tr>
            <td width="1170" height="35" colspan="4">
			 正确答案:
              <label>
                <input name="rigans" type="text" id="rigans" value="<%=Frs.getString("rigans")%>" size="50" maxlength="40"/>
              </label>
			  <td width="50"><input type="submit" name="reworkFill" value="修改"/></td>
		</tr>
        </table>
	  </form>
	  </td>
	<%}%>
	</tr>
		
	<tr>
	<td height="40" colspan="5"><div align="center"><a href="../../index.jsp">首页</a></div>
	</td>
	
	</tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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