网络<% Language=VBScript %>
<%
if Request.ServerVariables("http_method")="POST" then
if Request.Form("submit")="加入" then
'处理加入试题请求
set mrs=server.CreateObject("adodb.recordset")
mrs.ActiveConnection="dsn=testsys"
mrs.Source="select * from question"
mrs.Open ,,1,3
'往数据库的表question中加入试题内容
mrs.AddNew
mrs("teachid")=session("teachid")
mrs("sub")=Request.Form("selsub")
mrs("question")=Request.Form("question")
mrs("A")=Request.Form("opta")
mrs("B")=Request.Form("optb")
mrs("C")=Request.Form("optc")
mrs("D")=Request.Form("optd")
mrs("answer")=Request.Form("answer")
mrs.Update
mrs.Close
set mrs=nothing
end if
end if
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<FORM action="taddquestion.asp" method=post id=form1 name=form1>
<P><STRONG><FONT color=crimson face=幼圆
size=4>往试题库里加入试题</FONT></STRONG></P>
<P>课程---
<%Response.Write Request.Form("selsub")%></P>
<P>
<TABLE border=0 cellPadding=1 cellSpacing=1 width=90%>
<TR>
<TD>题目</TD></TR>
<TR>
<TD><TEXTAREA id=TEXTAREA1 name=question 114px; WIDTH: 60%"></TEXTAREA></TD></TR>
<TR>
<TD>选择答案
<TR>
<TD>A.
<INPUT id=text1 name=opta 21px; WIDTH: 40%">
<TR>
<TD>
<P>B.
<INPUT id=text2 name=optb 21px; WIDTH: 40%"></P>
<TR>
<TD>C.
<INPUT id=text3 name=optc 21px; WIDTH: 40%">
<TR>
<TD>
<P>D.
<INPUT id=text4 name=optd 21px; WIDTH: 40%"></P>
<TR>
<TD>
<P>正确答案
<INPUT id=radio1 name=answer type=radio value=A>A
<INPUT id=radio2 name=answer type=radio value=B>B
<INPUT id=radio3 name=answer type=radio value=C>C
<INPUT id=radio4 name=answer type=radio value=D>D
</P>
</TD></TR></TABLE><INPUT id=submit1 name=submit type=submit value=加入>
<%
'用类型为hidden的input保存目前加入试题库的科目名称
Response.Write "<input type=hidden name=selsub value=" & Request.Form("selsub") & ">"
%>
</P>
</FORM>
</BODY>
</HTML>
网络考场(7)(转)taddquestion.asp
80酷酷网 80kuku.com