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

📄 action.asp

📁 asp考试系统
💻 ASP
字号:
<!--#include file="../../inc/config.asp" -->
<!--#include file="../../inc/conn.asp" -->
<%
'取得传递过来的参数值
dim userID,testID,updateTime
userID=Request.Form("L_userID")
testID=Request.Form("L_testID")
updateTime=Request.Form("L_updateTime")

if Request("action")="save" then
 	dim conn,sql,rs
	set conn=Server.CreateObject("ADODB.CONNECTION")
	set conn=openExamData()
	'取得处理试卷的问题ID列表
	sql="select L_questionID from L_questions where L_testID="&testID
	set rs=Server.createObject("adodb.recordset")
	rs.open sql,conn,1,3
	
	if not rs.bof and not rs.eof then
		do while not rs.eof
			dim solution
			solution=Request(rs("L_questionID"))
			'当传递的答案即不为空字符串,也不为空值,记录答案
			if solution<>"" and not isNull(solution) then
				dim sqlSolution,rsSolution
				sqlSolution="select top 1 * from L_solutions where L_userID="&userID&" and L_questionID="&rs("L_questionID")
				set rsSolution=Server.createObject("adodb.recordset")
				rsSolution.open sqlSolution,conn,1,3
				if not rsSolution.bof and not rsSolution.eof then
					rsSolution("L_description")=solution
					rsSolution("L_updateTime")=updateTime
					rsSolution.update
					rsSolution.close
					set rsSolution=nothing
				else
					rsSolution.addnew
					rsSolution("L_userID")=userID
					rsSolution("L_testID")=testID
					rsSolution("L_questionID")=rs("L_questionID")
					rsSolution("L_description")=solution
					rsSolution("L_updateTime")=updateTime
					rsSolution.update
					rsSolution.close
					set rsSolution=nothing
				end if
			end if
		rs.movenext
		loop
	end if
end if
'重定向到试卷管理页面  
response.Redirect("view.asp?testID="&testID)
%><!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>
</body>
</html>

⌨️ 快捷键说明

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