edittopicok.asp

来自「网络教学平台由教师教学系统、学生学习系统和教学管理系统三大模块组成」· ASP 代码 · 共 91 行

ASP
91
字号
<!--#include file="Check.asp"-->
<!--#include file="Conn.asp"-->
<!--#include FILE="Config.asp"-->
<!--#include FILE="UpClass.asp"-->
<%
set upload=new upload_5xsoft ''建立上传对象
id=upload.form("id")
If Trim(upload.form("answer"))="" Then
	Response.Write "<script>alert('请输入答案!');history.go(-1);</script>"
	Response.End
End If
If id="" Then
	Response.Write "无效ID,请与<a href=http://www.cnvvv.com/ target=_blank>http://www.cnvvv.com</a>联系!"
	Response.End
End If
if right(SoftPath,1)<>"/" then SoftPath=SoftPath&"/" 
PicList=""
for each formName in upload.objFile
	set file=upload.file(formName)
	If file.fileName<>"" Then
		ranNum = int(888*rnd)+111
		Ext = split(file.fileName,".")
		FileExt = Ext(ubound(Ext))'取得文件名后缀
		if file.FileSize>0 then
			FileName=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
			file.SaveAs Server.mappath(SoftPath&FileName)
			PicList=FileName&","&PicList
		End If
	End If
next
subjectview=upload.form("subjectview")
typeadd=upload.form("typeadd")

if typeadd="单选题" then
  sql="select * from TestTopic where id="& id
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,3,2
  if rs.eof then
	Response.Write "here is eof!!!"
  end if
  rs("subject")=subjectview
  rs("type")=typeadd
  rs("question")=upload.form("question")
  rs("text1")=upload.form("text1")
  rs("text2")=upload.form("text2")
  rs("text3")=upload.form("text3")
  rs("text4")=upload.form("text4")
  rs("text5")=upload.form("text5")
  rs("text6")=upload.form("text6")
  rs("answer")=upload.form("answer")
  rs("PicList")=rs("PicList")&PicList
  rs.update
end if
if typeadd="多选题" then
  sql="select * from TestTopic where id="& id
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,3,2
  if rs.eof then
  Response.Write "here is eof!!!"
  end if
  rs("subject")=subjectview
  rs("type")=typeadd
  rs("question")=upload.form("question")
  rs("text1")=upload.form("text1")
  rs("text2")=upload.form("text2")
  rs("text3")=upload.form("text3")
  rs("text4")=upload.form("text4")
  rs("text5")=upload.form("text5")
  rs("text6")=upload.form("text6")
  rs("answer")=upload.form("answer")
  rs("PicList")=rs("PicList")&PicList
  rs.update
end if
if typeadd="判断题" then
  sql="select * from TestTopic where id="& id
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,3,2
  if rs.eof then
  Response.Write "here is eof!!!"
  end if
  rs("subject")=subjectview
  rs("type")=typeadd
  rs("question")=upload.form("question")
  rs("answer")=upload.form("answer")
  rs("PicList")=rs("PicList")&PicList
  rs.update
end if
Response.Write "<script>alert('修改成功!');history.go(-1);</script>"
'Response.Redirect"EditTopic.asp?id="&id
%>

⌨️ 快捷键说明

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